Skip to content

Improve Sphinx kerneldoc extension

Mauro Carvalho Chehab linux-doc lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4scripts/lib/kdoc/kdoc_files.py: don't try to join Nonescripts/lib/kdoc/kdoc_files.py+5 -20 replies
2/4scripts/lib/kdoc/kdoc_parser.py: move states to a separate classscripts/lib/kdoc/kdoc_parser.py+62 -570 replies
3/4scripts:kdoc_files.py: use glob for export_file seekscripts/lib/kdoc/kdoc_files.py+3 -10 replies
4/4docs: sphinx: kerneldoc: Use python class if availableDocumentation/sphinx/kerneldoc.py+130 -80 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/4] Improve Sphinx kerneldoc extension

Hi Jon,

As promised, this series improves the Sphinx kerneldoc extension making it using the kernel-doc.py classes directly if available.

The script still supports excecuting kernel-doc via shell, and, in verbose mode, it will show the command line arguments to run kernel-doc manually, even when the Python classes are used. The idea is that the command line verbose will help to eventually debug issues if one needs to run kernel-doc.py manually.

On other words, after this series, if one does:

make htmldocs KERNELDOC=scripts/kernel-doc.py

Or, simply (as internally KERNELDOC is set to scripts/kernel-doc.py):

make htmldocs

It will use the Python classes instead of running a subprocess.

If one uses, instead:

make htmldocs KERNELDOC=scripts/kernel-doc
or:
make htmldocs KERNELDOC=scripts/kernel-doc.pl

As the file extension doesn't end with .py, it will excecute the Python or the Perl version of kernel-doc via a subprocess.

On this version, I opted to re-create the Python objects for every single kernel-doc line, so no caches from past runs are used. I'm working on a version that will cache results, but it is currently causing some regressions. So, let's do the changes step-by-step, applying first this improvement patch series.

PS.: the first patches on this series are addressing some some bugs and one improvement that I noticed while debugging the patch changing kerneldoc Sphinx extension.

Mauro Carvalho Chehab (4):
scripts/lib/kdoc/kdoc_files.py: don't try to join None scripts/lib/kdoc/kdoc_parser.py: move states to a separate class scripts:kdoc_files.py: use glob for export_file seek
docs: sphinx: kerneldoc: Use python class if available

 Documentation/sphinx/kerneldoc.py | 138 ++++++++++++++++++++++++++++--
 scripts/lib/kdoc/kdoc_files.py    |  11 ++-
 scripts/lib/kdoc/kdoc_parser.py   | 119 ++++++++++++++------------
 3 files changed, 200 insertions(+), 68 deletions(-)
Signature · 1 line
2.49.0