From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Jonathan Corbet <corbet@lwn.net>
Cc: "Michal Koutný" <mkoutny@suse.com>,
"Bagas Sanjaya" <bagasdotme@gmail.com>,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
"Linux Documentation" <linux-doc@vger.kernel.org>,
"Linux cgroups" <cgroups@vger.kernel.org>,
"Tejun Heo" <tj@kernel.org>,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Andrea Righi" <arighi@nvidia.com>,
"Johannes Bechberger" <me@mostlynerdless.de>,
"Changwoo Min" <changwoo@igalia.com>,
"Shashank Balaji" <shashank.mahadasyam@sony.com>,
"Ingo Molnar" <mingo@kernel.org>, "Jake Rice" <jake@jakerice.dev>,
"Cengiz Can" <cengiz@kernel.wtf>
Subject: Re: [PATCH 2/2] Documentation: cgroup-v2: Replace manual table of contents with contents:: directive
Date: Wed, 10 Sep 2025 15:50:41 +0200 [thread overview]
Message-ID: <20250910155021.418ac199@foz.lan> (raw)
In-Reply-To: <875xdqtp7m.fsf@trenco.lwn.net>
Em Wed, 10 Sep 2025 07:24:45 -0600
Jonathan Corbet <corbet@lwn.net> escreveu:
> Michal Koutný <mkoutny@suse.com> writes:
>
> > On Wed, Sep 10, 2025 at 02:23:34PM +0700, Bagas Sanjaya <bagasdotme@gmail.com> wrote:
> >> manually-arranged table of contents (as reST comments) gets out-of-sync
> >> with actual toctree as not all of these are added to it.
> >
> > Is this true? I generated HTML with this patch and the resulting ToC
> > matches what's in the comment.
> >
> >> Replace it with automatically-generated table of contents via contents::
> >> directive.
> >
> > Mauro, what's the best practice wrt consistent ToC and having it in
> > plaintext form?
>
> I fairly routinely get patches fixing manual TOCs that are not updated
> to match changes elsewhere. We have a nice system that can manage the
> TOC automatically for us, it seems best to me to use it.
Agreed. If you use:
.. toctree::
:maxdepth: 1
:glob:
*
There won't be the need of manually updating the TOC tree.
That's said, I guess very few documents currently use grub:
$ git grep :glob: Documentation/|wc -l
7
Also, it has some drawbacks, as you can't control anymore the order
where the docs will be placed. So, if this is important, you may need
to do something different, or maybe use things like (untested):
.. toctree::
:maxdepth: 1
:glob:
pre*
main*
post*
> That said, if having the TOC in the plain-text version of the document
> is deemed to be important, then it needs to be kept and manually
> maintained.
Agreed.
Thanks,
Mauro
next prev parent reply other threads:[~2025-09-10 13:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-10 7:23 [PATCH 0/2] cgroup v2 docs update Bagas Sanjaya
2025-09-10 7:23 ` [PATCH 1/2] Documentation: cgroup-v2: Use document path for cross-references Bagas Sanjaya
2025-09-10 7:23 ` [PATCH 2/2] Documentation: cgroup-v2: Replace manual table of contents with contents:: directive Bagas Sanjaya
2025-09-10 8:13 ` Michal Koutný
2025-09-10 11:11 ` Bagas Sanjaya
2025-09-10 13:24 ` Jonathan Corbet
2025-09-10 13:50 ` Mauro Carvalho Chehab [this message]
2025-09-10 14:27 ` Jonathan Corbet
2025-09-10 16:44 ` Tejun Heo
2025-09-10 23:27 ` Bagas Sanjaya
2025-09-10 23:34 ` Bagas Sanjaya
2025-09-10 14:37 ` Michal Koutný
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=20250910155021.418ac199@foz.lan \
--to=mchehab+huawei@kernel.org \
--cc=arighi@nvidia.com \
--cc=bagasdotme@gmail.com \
--cc=cengiz@kernel.wtf \
--cc=cgroups@vger.kernel.org \
--cc=changwoo@igalia.com \
--cc=corbet@lwn.net \
--cc=hannes@cmpxchg.org \
--cc=jake@jakerice.dev \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=me@mostlynerdless.de \
--cc=mingo@kernel.org \
--cc=mkoutny@suse.com \
--cc=shashank.mahadasyam@sony.com \
--cc=tj@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox