From: Mauro Carvalho Chehab <mchehab@kernel.org>
To: Jani Nikula <jani.nikula@intel.com>
Cc: Jonathan Corbet <corbet@lwn.net>,
ksummit-discuss@lists.linuxfoundation.org,
ksummit@lists.linux.dev
Subject: Re: [Ksummit-discuss] [TECH TOPIC] What kernel documentation could be
Date: Thu, 23 Jun 2022 10:57:47 +0100 [thread overview]
Message-ID: <20220623105747.079ac92b@sal.lan> (raw)
In-Reply-To: <875ykrrb45.fsf@intel.com>
Em Thu, 23 Jun 2022 12:18:50 +0300
Jani Nikula <jani.nikula@intel.com> escreveu:
> On Sat, 18 Jun 2022, Mauro Carvalho Chehab <mchehab@kernel.org> wrote:
> > The big missing feature on Sphinx itself is with regards to per-C-type
> > domain. So, if we have one struct and one function both called "foo",
> > the cross-references will be broken. This issue is known since Sphinx
> > 3.1, and there are already patches fixing it since then (I remember
> > testing them) but, up to today, the Sphinx upstream patches meant
> > to fix it weren't applied yet (as far as I can tell).
>
> https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#namespacing
>
> Integrating that needs to be done carefully, though, to not make a mess
> of it.
>
> > One thing that probably be solved on a different way is to have
> > a better solution for things like:
> >
> > Functions for feature 1
> > =======================
> >
> > .. kernel-doc:: include/some_header.h
> > :doc: Feature 1
> >
> > .. kernel-doc:: include/some_header.h
> > :functions:
> > func1
> > func2
> >
> > Functions for feature 2
> > =======================
> >
> > .. kernel-doc:: include/some_header.h
> > :doc: Feature 2
> >
> > .. kernel-doc:: include/some_header.h
> > :functions:
> > func3
> > func4
>
> Yeah, currently that leads to parsing the header four times by
> kernel-doc the script.
Yes.
> The solution would be to finally convert the
> script to a proper python Sphinx extension that can do caching. (This is
> how it works in Hawkmoth, FWIW.)
That's one solution, but see: there is already a python extension
that currently calls kernel-doc everytime. It could, instead,
cache the rst returned by its first run (or a parsed version of it)
and use the cached results the other 3 times.
Porting kernel-doc to python could be doable, but not trivial, due to several
reasons:
- it should keep running standalone, as otherwise debugging parsing issues
on kernel-doc would be a lot harder. In particular, kernel-doc --none is
really helpful to report kernel-doc tag errors;
- regressions will likely be introduced on a change like that;
- regular contributors to kernel-doc will need to ramp up with the newer
version;
- a port like that could increase the script run time, as the
optimizations and regular expressions there could behave different on
python.
> > Perhaps we could change Kernel-doc in a way that doing just:
> >
> > .. kernel-doc:: include/some_header.h
> >
> > would be enough.
>
> The order in nicely flowing documentation is not necessarily the same as
> the order in nicely flowing source code. I expect it to be much more
> acceptable to tweak the rst to achieve this than to do source code
> rearrangement to generate nice documentation.
True, but independently if the script would be rewritten in python or not,
one way would be to enrich the 'DOCS:' kernel-doc tag in order to mention
there the symbols that belong to each part of the document, e. g. something
like:
/**
* DOC: foo
*
* Some comments...
*
* symbols:
* foo
* bar
*/
One advantage is that all documentation will be on a single place,
so hopefully it would be easier to maintain.
Also, on documents using `DOC:` with such new `symbols` tag, kernel-doc
could validate if all documented symbols are singly included at all `DOC:`
sessions and if any symbols are missed/renamed/removed.
Regards,
Mauro
next prev parent reply other threads:[~2022-06-23 9:57 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-17 20:57 [TECH TOPIC] What kernel documentation could be Jonathan Corbet
2022-06-17 20:57 ` [Ksummit-discuss] " Jonathan Corbet
2022-06-17 21:48 ` Laurent Pinchart
2022-06-17 21:48 ` Laurent Pinchart
2022-06-27 15:18 ` Jonathan Corbet
2022-06-18 8:24 ` Mauro Carvalho Chehab
2022-06-18 8:24 ` Mauro Carvalho Chehab
2022-06-18 11:03 ` Miguel Ojeda
2022-06-18 11:16 ` Mauro Carvalho Chehab
2022-06-18 11:16 ` Mauro Carvalho Chehab
2022-06-18 14:37 ` Miguel Ojeda
2022-06-23 9:18 ` Jani Nikula
2022-06-23 9:57 ` Mauro Carvalho Chehab [this message]
2022-06-23 10:30 ` Jani Nikula
2022-06-23 13:40 ` Jonathan Corbet
2022-06-24 7:33 ` Mauro Carvalho Chehab
2022-06-24 16:37 ` Markus Heiser
2022-06-27 15:27 ` Jonathan Corbet
2022-06-27 15:31 ` Christoph Hellwig
2022-06-28 7:43 ` Mauro Carvalho Chehab
2022-06-28 7:57 ` Geert Uytterhoeven
2022-06-28 11:01 ` Mauro Carvalho Chehab
2022-07-02 12:43 ` Stephen Rothwell
2022-06-24 22:57 ` Jonathan Corbet
2022-06-25 9:10 ` Mauro Carvalho Chehab
2022-06-25 14:00 ` Jonathan Corbet
2022-06-25 18:11 ` Linus Torvalds
2022-06-26 7:55 ` Mauro Carvalho Chehab
2022-06-26 9:26 ` Mauro Carvalho Chehab
2022-06-26 9:53 ` Mauro Carvalho Chehab
2022-06-27 15:28 ` Liam Howlett
2022-06-27 15:54 ` Christian Brauner
2022-06-27 16:27 ` Mark Brown
2022-06-28 10:53 ` Mauro Carvalho Chehab
2022-06-28 16:13 ` Luck, Tony
2022-06-27 15:34 ` Jonathan Corbet
2022-06-27 17:07 ` Linus Torvalds
2022-07-01 8:48 ` [PATCH 0/4] Address some issues with sphinx detection Mauro Carvalho Chehab
2022-07-01 8:48 ` [PATCH 1/4] scripts: sphinx-pre-install: fix venv version check logic Mauro Carvalho Chehab
2022-07-01 8:48 ` [PATCH 2/4] scripts: sphinx-pre-install: report broken venv Mauro Carvalho Chehab
2022-07-01 8:48 ` [PATCH 3/4] scripts: sphinx-pre-install: check for PDF min version later on Mauro Carvalho Chehab
2022-07-01 8:48 ` [PATCH 4/4] scripts: sphinx-pre-install: provide both venv and package installs Mauro Carvalho Chehab
2022-07-02 10:11 ` [PATCH v2 0/5] Address some issues with sphinx detection Mauro Carvalho Chehab
2022-07-02 10:11 ` [PATCH v2 1/5] scripts: sphinx-pre-install: fix venv version check logic Mauro Carvalho Chehab
2022-07-02 10:11 ` [PATCH v2 2/5] scripts: sphinx-pre-install: report broken venv Mauro Carvalho Chehab
2022-07-02 10:11 ` [PATCH v2 3/5] scripts: sphinx-pre-install: check for PDF min version later on Mauro Carvalho Chehab
2022-07-02 10:11 ` [PATCH v2 4/5] scripts: sphinx-pre-install: provide both venv and package installs Mauro Carvalho Chehab
2022-07-02 10:11 ` [PATCH v2 5/5] scripts: sphinx-pre-install: place a warning for Sphinx >= 3.0 Mauro Carvalho Chehab
2022-07-05 4:15 ` [PATCH v2 0/5] Address some issues with sphinx detection Akira Yokosawa
2022-07-06 14:31 ` Akira Yokosawa
2022-07-07 20:33 ` Mauro Carvalho Chehab
2022-07-07 18:45 ` Jonathan Corbet
2022-07-07 20:25 ` Mauro Carvalho Chehab
2022-07-07 20:15 ` Mauro Carvalho Chehab
2022-07-08 11:34 ` Expectation to --no-pdf option (was Re: [PATCH v2 0/5] Address some issues with sphinx detection) Akira Yokosawa
2022-07-08 14:02 ` Jonathan Corbet
2022-07-08 14:59 ` Mauro Carvalho Chehab
2022-07-08 15:27 ` Akira Yokosawa
2022-07-08 23:01 ` Akira Yokosawa
2022-07-09 7:59 ` Mauro Carvalho Chehab
2022-07-11 11:23 ` Akira Yokosawa
2022-08-01 23:30 ` [PATCH v2 0/5] Address some issues with sphinx detection Tomasz Warniełło
2022-07-02 10:52 ` [Ksummit-discuss] [TECH TOPIC] What kernel documentation could be Mauro Carvalho Chehab
2022-06-25 17:43 ` Steven Rostedt
2022-06-25 17:48 ` Laurent Pinchart
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=20220623105747.079ac92b@sal.lan \
--to=mchehab@kernel.org \
--cc=corbet@lwn.net \
--cc=jani.nikula@intel.com \
--cc=ksummit-discuss@lists.linuxfoundation.org \
--cc=ksummit@lists.linux.dev \
/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.