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)
commitaf250290430e1e678eef8c5c646a1bfd6af7b68a
treeddae2c4401af821831404688bde061f6803d2e22
parentc17add56ca4ee618b07ed9a21e2a29f0a90dc0ba
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