]> git.baikalelectronics.ru Git - kernel.git/commit
docs: kernel-doc: Don't mangle literal code blocks in comments
authorJonathan Corbet <corbet@lwn.net>
Tue, 6 Feb 2018 22:58:45 +0000 (15:58 -0700)
committerJonathan Corbet <corbet@lwn.net>
Thu, 15 Feb 2018 20:11:27 +0000 (13:11 -0700)
commita8462e0cf141e66db772ca46d48f2fb80de5354f
treeddae2c4401af821831404688bde061f6803d2e22
parent1c2ca564bc962c08e44491ff1e1622eec2e32013
docs: kernel-doc: Don't mangle literal code blocks in comments

It can be useful to put code snippets into kerneldoc comments; that can be
done with the "::" operator at the end of a line like this::

   if (desperate)
       run_in_circles();

The ".. code-block::" directive can also be used to this end.  kernel-doc
currently fails to understand these literal blocks and applies its normal
markup to them, which is then treated as literal by sphinx.  The result is
unsightly markup instead of a useful code snippet.

Apply a hack to the output code to recognize literal blocks and avoid
performing any special markup on them.  It's ugly, but that means it fits
in well with the rest of the script.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
scripts/kernel-doc