* [PATCH] Discuss a couple common errors in kernel-doc usage.
@ 2007-01-05 15:03 Robert P. J. Day
2007-01-07 4:00 ` Randy Dunlap
2007-01-07 11:36 ` Pavel Machek
0 siblings, 2 replies; 3+ messages in thread
From: Robert P. J. Day @ 2007-01-05 15:03 UTC (permalink / raw)
To: Linux kernel mailing list; +Cc: Randy Dunlap
Explain a couple of the most common errors in kernel-doc usage.
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
---
seems useful to emphasize these issues since they occur occasionally
in the source.
diff --git a/Documentation/kernel-doc-nano-HOWTO.txt b/Documentation/kernel-doc-nano-HOWTO.txt
index 284e7e1..ba50129 100644
--- a/Documentation/kernel-doc-nano-HOWTO.txt
+++ b/Documentation/kernel-doc-nano-HOWTO.txt
@@ -107,10 +107,14 @@ The format of the block comment is like this:
* (section header: (section description)? )*
(*)?*/
-The short function description cannot be multiline, but the other
-descriptions can be (and they can contain blank lines). Avoid putting a
-spurious blank line after the function name, or else the description will
-be repeated!
+The short function description ***cannot be multiline***, but the other
+descriptions can be (and they can contain blank lines). If you continue
+that initial short description onto a second line, that second line will
+appear further down at the beginning of the description section, which is
+almost certainly not what you had in mind.
+
+Avoid putting a spurious blank line after the function name, or else the
+description will be repeated!
All descriptive text is further processed, scanning for the following special
patterns, which are highlighted appropriately.
@@ -121,6 +125,31 @@ patterns, which are highlighted appropriately.
'@parameter' - name of a parameter
'%CONST' - name of a constant.
+NOTE 1: The multi-line descriptive text you provide does *not* recognize
+line breaks, so if you try to format some text nicely, as in:
+
+ Return codes
+ 0 - cool
+ 1 - invalid arg
+ 2 - out of memory
+
+this will all run together and produce:
+
+ Return codes 0 - cool 1 - invalid arg 2 - out of memory
+
+NOTE 2: If the descriptive text you provide has lines that begin with
+some phrase followed by a colon, each of those phrases will be taken as
+a new section heading, which means you should similarly try to avoid text
+like:
+
+ Return codes:
+ 0: cool
+ 1: invalid arg
+ 2: out of memory
+
+every line of which would start a new section. Again, probably not
+what you were after.
+
Take a look around the source tree for examples.
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Discuss a couple common errors in kernel-doc usage.
2007-01-05 15:03 [PATCH] Discuss a couple common errors in kernel-doc usage Robert P. J. Day
@ 2007-01-07 4:00 ` Randy Dunlap
2007-01-07 11:36 ` Pavel Machek
1 sibling, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2007-01-07 4:00 UTC (permalink / raw)
To: Robert P. J. Day, akpm; +Cc: Linux kernel mailing list
On Fri, 5 Jan 2007 10:03:53 -0500 (EST) Robert P. J. Day wrote:
>
> Explain a couple of the most common errors in kernel-doc usage.
>
> Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
It seems that you have been looking at my kdoc todo list....
> ---
>
> seems useful to emphasize these issues since they occur occasionally
> in the source.
>
> diff --git a/Documentation/kernel-doc-nano-HOWTO.txt b/Documentation/kernel-doc-nano-HOWTO.txt
> index 284e7e1..ba50129 100644
> --- a/Documentation/kernel-doc-nano-HOWTO.txt
> +++ b/Documentation/kernel-doc-nano-HOWTO.txt
> @@ -107,10 +107,14 @@ The format of the block comment is like this:
> * (section header: (section description)? )*
> (*)?*/
>
> -The short function description cannot be multiline, but the other
> -descriptions can be (and they can contain blank lines). Avoid putting a
> -spurious blank line after the function name, or else the description will
> -be repeated!
> +The short function description ***cannot be multiline***, but the other
> +descriptions can be (and they can contain blank lines). If you continue
> +that initial short description onto a second line, that second line will
> +appear further down at the beginning of the description section, which is
> +almost certainly not what you had in mind.
> +
> +Avoid putting a spurious blank line after the function name, or else the
> +description will be repeated!
>
> All descriptive text is further processed, scanning for the following special
> patterns, which are highlighted appropriately.
> @@ -121,6 +125,31 @@ patterns, which are highlighted appropriately.
> '@parameter' - name of a parameter
> '%CONST' - name of a constant.
>
> +NOTE 1: The multi-line descriptive text you provide does *not* recognize
> +line breaks, so if you try to format some text nicely, as in:
> +
> + Return codes
> + 0 - cool
> + 1 - invalid arg
> + 2 - out of memory
> +
> +this will all run together and produce:
> +
> + Return codes 0 - cool 1 - invalid arg 2 - out of memory
> +
> +NOTE 2: If the descriptive text you provide has lines that begin with
> +some phrase followed by a colon, each of those phrases will be taken as
> +a new section heading, which means you should similarly try to avoid text
> +like:
> +
> + Return codes:
> + 0: cool
> + 1: invalid arg
> + 2: out of memory
> +
> +every line of which would start a new section. Again, probably not
> +what you were after.
> +
> Take a look around the source tree for examples.
>
>
> -
---
~Randy
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Discuss a couple common errors in kernel-doc usage.
2007-01-05 15:03 [PATCH] Discuss a couple common errors in kernel-doc usage Robert P. J. Day
2007-01-07 4:00 ` Randy Dunlap
@ 2007-01-07 11:36 ` Pavel Machek
1 sibling, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2007-01-07 11:36 UTC (permalink / raw)
To: Robert P. J. Day; +Cc: Linux kernel mailing list, Randy Dunlap
Hi!
> Explain a couple of the most common errors in kernel-doc usage.
>
> Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
>
> ---
>
> seems useful to emphasize these issues since they occur occasionally
> in the source.
>
> diff --git a/Documentation/kernel-doc-nano-HOWTO.txt b/Documentation/kernel-doc-nano-HOWTO.txt
> index 284e7e1..ba50129 100644
> --- a/Documentation/kernel-doc-nano-HOWTO.txt
> +++ b/Documentation/kernel-doc-nano-HOWTO.txt
> @@ -107,10 +107,14 @@ The format of the block comment is like this:
> * (section header: (section description)? )*
> (*)?*/
>
> -The short function description cannot be multiline, but the other
> -descriptions can be (and they can contain blank lines). Avoid putting a
> -spurious blank line after the function name, or else the description will
> -be repeated!
> +The short function description ***cannot be multiline***, but the other
Can we shout a bit less?
Pavel
--
Thanks for all the (sleeping) penguins.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-01-09 20:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-05 15:03 [PATCH] Discuss a couple common errors in kernel-doc usage Robert P. J. Day
2007-01-07 4:00 ` Randy Dunlap
2007-01-07 11:36 ` Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).