All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Jonathan Corbet <corbet@lwn.net>
Cc: "Mauro Carvalho Chehab" <mchehab+huawei@kernel.org>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Nícolas F. R. A. Prado" <nfraprado@collabora.com>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	"Shuah Khan" <skhan@linuxfoundation.org>
Subject: [PATCH 00/13] Add kernel-doc modules to Documentation/tools
Date: Wed, 14 Jan 2026 14:17:13 +0100	[thread overview]
Message-ID: <cover.1768396023.git.mchehab+huawei@kernel.org> (raw)

Hi Jon,

This is the splitted version of my RFC to use sphinx.ext.autodoc
to document kernel-doc modules. It documents only kernel-doc
modules, but, once we merge it, we can document other things.

This series comes after:
    https://lore.kernel.org/linux-doc/cover.1768395332.git.mchehab+huawei@kernel.org/T/#t

patch 1 is actually not directly related: if fixes a bug I noticed
on Sphinx indexes with a large maxdepth;

patch 2 adds sphinx.ext.autodoc and place the directories where
python modules can be found. It doesn't use the extension, though.
This will happen only at the final patch;

patches 3 to 12 are basically documentation cleanups and fixes that
ensure that the documentation will be complete.

patch 13 creates new *.rst files that points to python.lib.kdoc
files.

With this version, python files inside tools/ or scripts/
can be documented, but there is a catch (probably due to PEP8):

    - files must end with ".py"
    - file names can't have "-".

So, unfortunately, we can't document kernel-doc.py, except if
we rename it to kernel_doc.py.

As I mentioned at RFC, we could use:

    $ sphinx-apidoc scripts tools -o foobar
    $ sphinx-apidoc tools/docs -o foobar
    ...

to generate .rst skeletons with the modules to be added, but
manual work is needed afterwards.

Mauro Carvalho Chehab (13):
  docs: custom.css: prevent li marker to override text
  docs: enable Sphinx autodoc extension to allow documenting python
  docs: custom.css: add CSS for python
  docs: kdoc: latex_fonts: Improve docstrings and comments
  docs: kdoc_files: Improve docstrings and comments
  docs: kdoc_item: Improve docstrings and comments
  docs: kdoc_parser: Improve docstrings and comments
  docs: kdoc_output: Improve docstrings and comments
  docs: kdoc_re: Improve docstrings and comments
  docs: kdoc: parse_data_structs: Improve docstrings and comments
  docs: kdoc: enrich_formatter: Improve docstrings and comments
  docs: kdoc: python_version: Improve docstrings and comments
  docs: add kernel-doc modules documentation

 Documentation/conf.py                       |  11 +-
 Documentation/sphinx-static/custom.css      |  12 ++
 Documentation/tools/index.rst               |   1 +
 Documentation/tools/kdoc.rst                |  12 ++
 Documentation/tools/kdoc_ancillary.rst      |  46 +++++
 Documentation/tools/kdoc_output.rst         |  14 ++
 Documentation/tools/kdoc_parser.rst         |  29 ++++
 Documentation/tools/python.rst              |  10 ++
 tools/lib/python/kdoc/enrich_formatter.py   |  20 ++-
 tools/lib/python/kdoc/kdoc_files.py         |  23 +--
 tools/lib/python/kdoc/kdoc_item.py          |  18 ++
 tools/lib/python/kdoc/kdoc_output.py        |  60 ++++---
 tools/lib/python/kdoc/kdoc_parser.py        | 175 +++++++++++---------
 tools/lib/python/kdoc/kdoc_re.py            |  18 +-
 tools/lib/python/kdoc/latex_fonts.py        |  95 ++++++-----
 tools/lib/python/kdoc/parse_data_structs.py |  62 ++++---
 tools/lib/python/kdoc/python_version.py     |  20 ++-
 17 files changed, 430 insertions(+), 196 deletions(-)
 create mode 100644 Documentation/tools/kdoc.rst
 create mode 100644 Documentation/tools/kdoc_ancillary.rst
 create mode 100644 Documentation/tools/kdoc_output.rst
 create mode 100644 Documentation/tools/kdoc_parser.rst
 create mode 100644 Documentation/tools/python.rst

-- 
2.52.0


             reply	other threads:[~2026-01-14 13:17 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-14 13:17 Mauro Carvalho Chehab [this message]
2026-01-14 13:17 ` [PATCH 01/13] docs: custom.css: prevent li marker to override text Mauro Carvalho Chehab
2026-01-14 13:17 ` [PATCH 02/13] docs: enable Sphinx autodoc extension to allow documenting python Mauro Carvalho Chehab
2026-01-15 10:19   ` Jani Nikula
2026-01-15 11:50     ` Mauro Carvalho Chehab
2026-01-15 12:18       ` Jani Nikula
2026-01-15 12:57         ` Mauro Carvalho Chehab
2026-01-14 13:17 ` [PATCH 03/13] docs: custom.css: add CSS for python Mauro Carvalho Chehab
2026-01-14 13:17 ` [PATCH 04/13] docs: kdoc: latex_fonts: Improve docstrings and comments Mauro Carvalho Chehab
2026-01-14 13:17 ` [PATCH 05/13] docs: kdoc_files: " Mauro Carvalho Chehab
2026-01-14 13:17 ` [PATCH 06/13] docs: kdoc_item: " Mauro Carvalho Chehab
2026-01-14 13:17 ` [PATCH 07/13] docs: kdoc_parser: " Mauro Carvalho Chehab
2026-01-14 13:17 ` [PATCH 08/13] docs: kdoc_output: " Mauro Carvalho Chehab
2026-01-14 13:17 ` [PATCH 09/13] docs: kdoc_re: " Mauro Carvalho Chehab
2026-01-14 13:17 ` [PATCH 10/13] docs: kdoc: parse_data_structs: " Mauro Carvalho Chehab
2026-01-14 13:17 ` [PATCH 11/13] docs: kdoc: enrich_formatter: " Mauro Carvalho Chehab
2026-01-14 13:17 ` [PATCH 12/13] docs: kdoc: python_version: " Mauro Carvalho Chehab
2026-01-14 13:17 ` [PATCH 13/13] docs: add kernel-doc modules documentation Mauro Carvalho Chehab
2026-01-14 18:01 ` [PATCH 00/13] Add kernel-doc modules to Documentation/tools Jonathan Corbet
2026-01-14 20:20   ` Mauro Carvalho Chehab
2026-01-14 20:46     ` Jonathan Corbet
2026-01-15  1:29       ` Mauro Carvalho Chehab
2026-01-15 10:17         ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1768396023.git.mchehab+huawei@kernel.org \
    --to=mchehab+huawei@kernel.org \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nfraprado@collabora.com \
    --cc=rdunlap@infradead.org \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.