<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/scripts/kernel-doc, branch sphinx-4.8</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=sphinx-4.8</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=sphinx-4.8'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2016-06-09T19:35:05+00:00</updated>
<entry>
<title>docs: kernel-doc: Add "example" and "note" to the magic section types</title>
<updated>2016-06-09T19:35:05+00:00</updated>
<author>
<name>Jonathan Corbet</name>
<email>corbet@lwn.net</email>
</author>
<published>2016-06-09T19:35:05+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=8569de68e79e94cce6709831edd94accb6942ade'/>
<id>urn:sha1:8569de68e79e94cce6709831edd94accb6942ade</id>
<content type='text'>
Lots of kerneldoc entries use "example:" or "note:" as section headers.
Until such a time as we can make them use proper markup, make them work as
intended.

Signed-off-by: Jonathan Corbet &lt;corbet@lwn.net&gt;
</content>
</entry>
<entry>
<title>scripts/kernel-doc: Add option to inject line numbers</title>
<updated>2016-06-04T08:35:31+00:00</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2016-06-03T20:21:34+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=0b0f5f29b282b18d26ce698e1aab0267234f77bf'/>
<id>urn:sha1:0b0f5f29b282b18d26ce698e1aab0267234f77bf</id>
<content type='text'>
Opt-in since this wreaks the rst output and must be removed
by consumers again. This is useful to adjust the linenumbers
for included kernel-doc snippets in shinx. With that sphinx
error message will be accurate when there's issues with the
rst-ness of the kernel-doc comments.

Especially when transitioning a new docbook .tmpl to .rst this
is extremely useful, since you can just use your editors compilation
quickfix list to accurately jump from error to error.

v2:
- Also make sure that we filter the LINENO for purpose/at declaration
  start so it only shows for selected blocks, not all of them (Jani).
  While at it make it a notch more accurate.
- Avoid undefined $lineno issues. I tried filtering these out at the
  callsite, but Jani spotted more when linting the entire kernel.
  Unamed unions and similar things aren't stored consistently and end
  up with an undefined line number (but also no kernel-doc text, just
  the parameter type). Simplify things and filter undefined line
  numbers in print_lineno() to catch them all.

v3: Fix LINENO 0 issue for kernel-doc comments without @param: lines
or any other special sections that directly jump to the description
after the "name - purpose" line. Only really possible for functions
without parameters. Noticed by Jani.

Cc: Jani Nikula &lt;jani.nikula@intel.com&gt;
Cc: linux-doc@vger.kernel.org
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
</entry>
<entry>
<title>scripts/kernel-doc: Also give functions symbolic names</title>
<updated>2016-06-03T08:41:01+00:00</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2016-06-01T21:46:24+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=b7afa92b55043b71a37a2f658553d3e260859859'/>
<id>urn:sha1:b7afa92b55043b71a37a2f658553d3e260859859</id>
<content type='text'>
state3 = prototype parsing, so name them accordingly.

Cc: Jani Nikula &lt;jani.nikula@intel.com&gt;
Cc: linux-doc@vger.kernel.org
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
</entry>
<entry>
<title>scripts/kernel-doc: Remove duplicated DOC: start handling</title>
<updated>2016-06-03T08:26:39+00:00</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2016-06-01T21:46:23+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=ebff7f929b2a72fa614f5e95fd34c56c82ac9c36'/>
<id>urn:sha1:ebff7f929b2a72fa614f5e95fd34c56c82ac9c36</id>
<content type='text'>
Further up in the state machinery we switch from STATE_NAME to
STATE_DOCBLOCK when we match /$doc_block/. Which means this block of
code here is entirely unreachable, unless there are multiple DOC:
sections within a single kernel-doc comment.

Getting a list of all the files with more than one DOC: section using

$ git grep -c " * DOC:" | grep -v ":1$"

and then doing a full audit of them reveals there are no such comment
blocks in the kernel.

Supporting multiple DOC: sections in a single kernel-doc comment does
not seem like a recommended way of doing things anyway, so nuke the code
for simplicity.

Cc: Jani Nikula &lt;jani.nikula@intel.com&gt;
Cc: linux-doc@vger.kernel.org
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
[Jani: amended the commit message]
Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
</entry>
<entry>
<title>kernel-doc: reset contents and section harder</title>
<updated>2016-05-30T10:39:04+00:00</updated>
<author>
<name>Jani Nikula</name>
<email>jani.nikula@intel.com</email>
</author>
<published>2016-05-30T08:21:06+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=2f4ad40a05265827848200689094348363027069'/>
<id>urn:sha1:2f4ad40a05265827848200689094348363027069</id>
<content type='text'>
If the documentation comment does not have params or sections, the
section heading may leak from the previous documentation comment.

Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
</entry>
<entry>
<title>kernel-doc: concatenate contents of colliding sections</title>
<updated>2016-05-30T10:39:03+00:00</updated>
<author>
<name>Jani Nikula</name>
<email>jani.nikula@intel.com</email>
</author>
<published>2016-05-29T06:40:44+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=32217761ee9db0215350dfe1ca4e66f312fb8c54'/>
<id>urn:sha1:32217761ee9db0215350dfe1ca4e66f312fb8c54</id>
<content type='text'>
If there are multiple sections with the same section name, the current
implementation results in several sections by the same heading, with the
content duplicated from the last section to all. Even if there's the
error message, a more graceful approach is to combine all the
identically named sections into one, with concatenated contents.

With the supported sections already limited to select few, there are
massively fewer collisions than there used to be, but this is still
useful for e.g. when function parameters are documented in the middle of
a documentation comment, with description spread out above and
below. (This is not a recommended documentation style, but used in the
kernel nonetheless.)

We can now also demote the error to a warning.

Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
</entry>
<entry>
<title>kernel-doc: limit the "section header:" detection to a select few</title>
<updated>2016-05-30T10:39:03+00:00</updated>
<author>
<name>Jani Nikula</name>
<email>jani.nikula@intel.com</email>
</author>
<published>2016-05-29T08:35:28+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=f624adef3d0b9975076c1ba7549b81ed19e34437'/>
<id>urn:sha1:f624adef3d0b9975076c1ba7549b81ed19e34437</id>
<content type='text'>
kernel-doc currently identifies anything matching "section header:"
(specifically a string of word characters and spaces followed by a
colon) as a new section in the documentation comment, and renders the
section header accordingly.

Unfortunately, this turns all uses of colon into sections, mostly
unintentionally. Considering the output, erroneously creating sections
when not intended is always worse than erroneously not creating sections
when intended. For example, a line with "http://example.com" turns into
a "http" heading followed by "//example.com" in normal text style, which
is quite ugly. OTOH, "WARNING: Beware of the Leopard" is just fine even
if "WARNING" does not turn into a heading.

It is virtually impossible to change all the kernel-doc comments, either
way. The compromise is to pick the most commonly used and depended on
section headers (with variants) and accept them as section headers.

The accepted section headers are, case insensitive:

 * description:
 * context:
 * return:
 * returns:

Additionally, case sensitive:

 * @return:

All of the above are commonly used in the kernel-doc comments, and will
result in worse output if not identified as section headers. Also,
kernel-doc already has some special handling for all of them, so there's
nothing particularly controversial in adding more special treatment for
them.

While at it, improve the whitespace handling surrounding section
names. Do not consider the whitespace as part of the name.

Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
</entry>
<entry>
<title>kernel-doc/rst: remove fixme comment</title>
<updated>2016-05-30T10:39:02+00:00</updated>
<author>
<name>Jani Nikula</name>
<email>jani.nikula@intel.com</email>
</author>
<published>2016-05-28T07:48:37+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=cddfe325afedb67a15fbe1a91e82ffed40236413'/>
<id>urn:sha1:cddfe325afedb67a15fbe1a91e82ffed40236413</id>
<content type='text'>
Yes, for our purposes the type should contain typedef.

Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
</entry>
<entry>
<title>kernel-doc/rst: use *undescribed* instead of _undescribed_</title>
<updated>2016-05-30T10:39:02+00:00</updated>
<author>
<name>Jani Nikula</name>
<email>jani.nikula@intel.com</email>
</author>
<published>2016-05-27T21:48:17+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=d4b08e0cd2d74eb652d580607982d5054dc42991'/>
<id>urn:sha1:d4b08e0cd2d74eb652d580607982d5054dc42991</id>
<content type='text'>
The latter isn't special to rst.

Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
</entry>
<entry>
<title>kernel-doc: strip leading whitespace from continued param descs</title>
<updated>2016-05-30T10:39:01+00:00</updated>
<author>
<name>Jani Nikula</name>
<email>jani.nikula@intel.com</email>
</author>
<published>2016-05-27T21:41:50+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=b7886de43c9f8a19685cd6e81135de63b9529911'/>
<id>urn:sha1:b7886de43c9f8a19685cd6e81135de63b9529911</id>
<content type='text'>
If a param description spans multiple lines, check any leading
whitespace in the first continuation line, and remove same amount of
whitespace from following lines.

This allows indentation in the multi-line parameter descriptions for
aesthetical reasons while not causing accidentally significant
indentation in the rst output.

Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
</entry>
</feed>
