2018-06-06 15:46:45

by Mauro Carvalho Chehab

[permalink] [raw]
Subject: [PATCH v2 53/53] kernel-doc: describe the ``literal`` syntax

changeset b97f193abf83 ("scripts/kernel-doc: fix parser
for apostrophes") added support for ``literal`` inside
kernel-doc, in order to allow using the "%" symbol inside
a literal block, as this is used at printk() description.

Document it.

Fixes: b97f193abf83 ("scripts/kernel-doc: fix parser for apostrophes")
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
---
Documentation/doc-guide/kernel-doc.rst | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/Documentation/doc-guide/kernel-doc.rst b/Documentation/doc-guide/kernel-doc.rst
index b32e4813ff6f..b24854b5d6be 100644
--- a/Documentation/doc-guide/kernel-doc.rst
+++ b/Documentation/doc-guide/kernel-doc.rst
@@ -149,6 +149,16 @@ Domain`_ references.
``%CONST``
Name of a constant. (No cross-referencing, just formatting.)

+````literal````
+ A literal block that should be handled as-is. The output will use a
+ ``monospaced font``.
+
+ Useful if you need to use special characters that would otherwise have some
+ meaning either by kernel-doc script of by reStructuredText.
+
+ This is particularly useful if you need to use things like ``%ph`` inside
+ a function description.
+
``$ENVVAR``
Name of an environment variable. (No cross-referencing, just formatting.)

--
2.9.3



2018-06-06 16:33:07

by Markus Heiser

[permalink] [raw]
Subject: Re: [PATCH v2 53/53] kernel-doc: describe the ``literal`` syntax

Hi Mauro,

> Am 16.05.2017 um 14:16 schrieb Mauro Carvalho Chehab <[email protected]>:
>
> changeset b97f193abf83 ("scripts/kernel-doc: fix parser
> for apostrophes") added support for ``literal`` inside
> kernel-doc, in order to allow using the "%" symbol inside
> a literal block, as this is used at printk() description.
>
> Document it.
>
> Fixes: b97f193abf83 ("scripts/kernel-doc: fix parser for apostrophes")
> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
> ---
> Documentation/doc-guide/kernel-doc.rst | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/Documentation/doc-guide/kernel-doc.rst b/Documentation/doc-guide/kernel-doc.rst
> index b32e4813ff6f..b24854b5d6be 100644
> --- a/Documentation/doc-guide/kernel-doc.rst
> +++ b/Documentation/doc-guide/kernel-doc.rst
> @@ -149,6 +149,16 @@ Domain`_ references.
> ``%CONST``
> Name of a constant. (No cross-referencing, just formatting.)
>
> +````literal````
> + A literal block that should be handled as-is. The output will use a
> + ``monospaced font``.

just nitpicking; this is not literal block, this is called an inline literal [1]

To be complete: "blocks" are allways indented.

[1] http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#inline-literals

--- Markus --