Skip to content

kernel-doc improvements

Mauro Carvalho Chehab linux-doc lkml 3 versions – Applied

Status from this message: I've applied this set, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest posting 2/213 patches 1 replyApplied
  2. v2 posting 1/22 patches 1 replyApplied
  3. v111 patches 1 replySuperseded

Patches in v2 posting 2/2 Applied

#Subject and filesSizeRepliesApplied
1/13docs: sphinx-build-wrapper: better handle troff .TH markupstools/docs/sphinx-build-wrapper+4 -40 replies
2/13docs: sphinx-build-wrapper: don't allow "/" on file namestools/docs/sphinx-build-wrapper+3 -10 replies
3/13docs: kdoc_output: use a method to emit the .TH headertools/lib/python/kdoc/kdoc_output.py+26 -80 replies
4/13docs: kdoc_output: remove extra attribute on man .TH headerstools/lib/python/kdoc/kdoc_output.py+1 -10 replies
5/13docs: kdoc_output: use a single manual for everythingtools/lib/python/kdoc/kdoc_output.py+4 -80 replies
6/13docs: kdoc_output: don't use a different modulename for functionstools/lib/python/kdoc/kdoc_output.py+3 -60 replies
7/13docs: kdoc_output: fix naming for DOC markupstools/docs/sphinx-build-wrapper tools/lib/python/kdoc/kdoc_output.py+24 -160 replies
8/13docs: kdoc_output: describe the class init parameterstools/lib/python/kdoc/kdoc_output.py+28 -10 replies
9/13docs: kdoc_output: pick a better default for modulenametools/docs/kernel-doc tools/lib/python/kdoc/kdoc_output.py+4 -40 replies
10/13docs: kdoc_output: Change the logic to handle man highlighttools/lib/python/kdoc/kdoc_output.py+17 -90 replies
11/13docs: kdoc_output: add a logic to handle tables inside kernel-doc markupstools/lib/python/kdoc/kdoc_output.py+130 -00 replies
12/13docs: kdoc_output: add support to handle code blockstools/lib/python/kdoc/kdoc_output.py+64 -00 replies
13/13docs: kdoc_output: better handle liststools/lib/python/kdoc/kdoc_output.py+8 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 00/13] kernel-doc improvements

Hi Jon,

This patch kernel-doc improvements. On v2, I'm keeping just the patches related to man pages generation.

The first patches on this series are focused mostly on .TH (troff header) line, but, as a side effect, it also change the name of man pages generated from DOC kernel-doc annotations. At the previous state, those were overriden due to lots of duplicated names.

The rationale for most of such changes is that modern troff/man page specs say that .TH has up to 5 arguments,, as defined at [1]:

.TH topic section [footer-middle] [footer-inside] [header-middle]

[1] https://man7.org/linux/man-pages/man7/groff_man_style.7.html

Right now, Kernel uses 6 arguments, probably due to some legacy man page definitions.

After double checking, modern man pages use this format:

	.TH "{name}" {section} "{date}" "{modulename}" "{manual}"

Right now, man pages generation are messing up on how it encodes each position at .TH, depending on the type of object it emits.

After this series, the definition is more consistent and file output is better named.

It also fixes two issues at sphinx-build-wrapper related to how it generate files names from the .TH header.

The last 4 patches on this series are new: they fix lots of issues related to groff format: there, new lines continue the test from previous pagragraph. This cause issues mainly on:

- tables;
- code blocks;
- lists

With the changes, the output now looks a lot better.

Please notice that the code there is not meant to fully implement rst -> troff/groff conversion. Instead, it is meant to make the output reasonable.

A more complete approach would be to use docutils or Sphinx libraries, but that would likely require to also write a troff output plugin, as the "man" builder is very limited. Also, this could be problematic, as kernel-doc classes can be called from Sphinx. I don't think we need that much complexity, as what we mainly need is to avoid bad line grouping when generating man pages.

This series should not affect HTML documentation. It only affect man page generation and ManFormat output class.

Mauro Carvalho Chehab (13):
docs: sphinx-build-wrapper: better handle troff .TH markups
docs: sphinx-build-wrapper: don't allow "/" on file names
docs: kdoc_output: use a method to emit the .TH header
docs: kdoc_output: remove extra attribute on man .TH headers
docs: kdoc_output: use a single manual for everything
docs: kdoc_output: don't use a different modulename for functions
docs: kdoc_output: fix naming for DOC markups
docs: kdoc_output: describe the class init parameters
docs: kdoc_output: pick a better default for modulename
docs: kdoc_output: Change the logic to handle man highlight
docs: kdoc_output: add a logic to handle tables inside kernel-doc
markups
docs: kdoc_output: add support to handle code blocks
docs: kdoc_output: better handle lists

 tools/docs/kernel-doc                |   1 -
 tools/docs/sphinx-build-wrapper      |  10 +-
 tools/lib/python/kdoc/kdoc_output.py | 297 +++++++++++++++++++++++++--
 3 files changed, 283 insertions(+), 25 deletions(-)
Signature · 1 line
2.52.0