All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: linux-doc@vger.kernel.org, Randy Dunlap <rdunlap@infradead.org>,
	Mauro Carvalho Chehab <mchehab+huawei@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 10:12:59 +0200	[thread overview]
Message-ID: <5fc09cd5678000ccca68200d9f692376024e4b33@intel.com> (raw)
In-Reply-To: <qf6t4cbpurcssabychbtxplqv7metgglduu4soqjexfxs6ongy@yryw3bnk44y6>

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.


BR,
Jani.


>
>     Traceback =========
>
>       File "/usr/lib/python3.14/site-packages/sphinx/util/parallel.py", line 137, in _join_one
>         raise SphinxParallelError(*result)
>     sphinx.errors.SphinxParallelError: docutils.utils.SystemMessage: Documentation/userspace-api/media/index.rst:69: (SEVERE/4) Problems with "include" directive path:
>     InputError: [Errno 2] No such file or directory: 'Documentation/userspace-api/sphinx-includes/subproject-index.rst'.
>
> Thanks,
> Mauro

-- 
Jani Nikula, Intel

  reply	other threads:[~2025-11-13  8:13 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 [this message]
2025-11-13 10:25       ` Mauro Carvalho Chehab
2025-11-13 19:36       ` Randy Dunlap
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=5fc09cd5678000ccca68200d9f692376024e4b33@intel.com \
    --to=jani.nikula@intel.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=rdunlap@infradead.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.