From: Randy Dunlap <rdunlap@infradead.org>
To: Jani Nikula <jani.nikula@intel.com>,
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: linux-doc@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>
Subject: Re: [PATCH 4/4] Documentation: use a source-read extension to include the index boilerplate
Date: Thu, 13 Nov 2025 11:36:47 -0800 [thread overview]
Message-ID: <c44d53e5-71ab-423e-95b4-1ddb08e40823@infradead.org> (raw)
In-Reply-To: <5fc09cd5678000ccca68200d9f692376024e4b33@intel.com>
On 11/13/25 12:12 AM, Jani Nikula wrote:
> On Wed, 12 Nov 2025, Mauro Carvalho Chehab <mchehab+huawei@kernel.org> wrote:
>> On Wed, Nov 12, 2025 at 01:56:54PM +0200, Jani Nikula wrote:
>>> Reduce boilerplate all over the place by adding a small ad hoc extension
>>> in conf.py that adds the ../sphinx-includes/subproject-index.rst include
>>> to all SPHINXDIRS builds.
>>>
>>> Note that the docname is just 'index', because the SPHINXDIRS builds
>>> happen in the subdirectories.
>>>
>>> Cc: Randy Dunlap <rdunlap@infradead.org>
>>> Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
>>> Cc: Jonathan Corbet <corbet@lwn.net>
>>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>>
>>> diff --git a/Documentation/conf.py b/Documentation/conf.py
>>> index b9a43ee32a00..cb0936a71d52 100644
>>> --- a/Documentation/conf.py
>>> +++ b/Documentation/conf.py
>>> @@ -589,8 +589,14 @@ kerneldoc_srctree = ".."
>>> # ------------------------------------------------------------------------------
>>> loadConfig(globals())
>>>
>>> +# Add index link to SPHINXDIRS builds
>>> +def add_subproject_index(app, docname, source):
>>> + if app.builder.tags.has('subproject') and app.builder.tags.has('html'):
>>> + if docname == 'index':
>>> + source[0] += '\n.. include:: ../sphinx-includes/subproject-index.rst\n'
>>
>> The relative path there breaks SPINXDIRS, when it is pointing to use a sub-sub-dir
>> like:
>>
>> $ make SPHINXDIRS=userspace-api/media htmldocs
>
> Ugh, I looked at 'make help' for the "valid values for SPHINXDIRS",
> which only lists the top level directories. Patch 1 is also based on
> this.
>
> What a surprise, the documentation for documentation is useless.
Yeah, I only found out recently that subdirs can be specified there.
--
~Randy
next prev parent reply other threads:[~2025-11-13 19:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-12 11:56 [PATCH 0/4] Documentation: clean up subproject index boilerplate Jani Nikula
2025-11-12 11:56 ` [PATCH 1/4] Documentation: remove subproject index links deep in the structure Jani Nikula
2025-11-12 13:27 ` Mauro Carvalho Chehab
2025-11-12 11:56 ` [PATCH 2/4] Documentation: streamline subproject index link in translations Jani Nikula
2025-11-12 11:56 ` [PATCH 3/4] Documentation: include the boilerplate for SPHINXDIRS index link Jani Nikula
2025-11-12 13:35 ` Mauro Carvalho Chehab
2025-11-13 8:04 ` Jani Nikula
2025-11-13 10:11 ` Mauro Carvalho Chehab
2025-11-12 11:56 ` [PATCH 4/4] Documentation: use a source-read extension to include the index boilerplate Jani Nikula
2025-11-12 13:39 ` Mauro Carvalho Chehab
2025-11-13 8:12 ` Jani Nikula
2025-11-13 10:25 ` Mauro Carvalho Chehab
2025-11-13 19:36 ` Randy Dunlap [this message]
2025-11-13 6:50 ` [PATCH 0/4] Documentation: clean up subproject " Randy Dunlap
2025-11-13 16:33 ` Jonathan Corbet
2025-11-13 16:59 ` Jani Nikula
2025-12-04 13:43 ` Jani Nikula
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=c44d53e5-71ab-423e-95b4-1ddb08e40823@infradead.org \
--to=rdunlap@infradead.org \
--cc=corbet@lwn.net \
--cc=jani.nikula@intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=mchehab+huawei@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;
as well as URLs for NNTP newsgroup(s).