Messages in this thread Patch in this message | | | From | Mauro Carvalho Chehab <> | Subject | [RFC PATCH 1/2] scripts/kernel-doc: Auto-detect common code-blocks | Date | Thu, 10 May 2018 10:38:16 -0400 |
| |
Comments that end with a comma and have certain keywords should be presented as code-blocks
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> --- scripts/kernel-doc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 0057d8eafcc1..8ce2d0f54369 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -803,7 +803,8 @@ sub output_highlight_rst { # if (! $in_literal) { $block .= $line . "\n"; - if (($line =~ /$sphinx_literal/) || ($line =~ /$sphinx_cblock/)) { + if (($block =~ s/(code|example|artwork|flow|diagram)([^\:]*:)\n/$1$2:\n/) || + ($line =~ /$sphinx_literal/) || ($line =~ /$sphinx_cblock/)) { $in_literal = 1; $litprefix = ""; $output .= highlight_block($block); -- 2.17.0
| |