From: Jani Nikula <jani.nikula@intel.com>
To: linux-doc@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>
Subject: Re: [PATCH] docs: conf.py: use master_doc instead of hardcoding index
Date: Wed, 02 Dec 2026 17:28:36 +0200 [thread overview]
Message-ID: <7bb61e5c719b74fa208e322694dd9336e938c473@intel.com> (raw)
In-Reply-To: <20261124163820.1587424-1-jani.nikula@intel.com>
On Tue, 24 Nov 2026, Jani Nikula <jani.nikula@intel.com> wrote:
> The name of the root document is specified by the master_doc
> configuration option. Use that instead of hardcoding "index" in conf.py.
>
> It would be preferrable to use root_doc, but that was only introduced in
> Sphinx 4.0. While at it, add a FIXME comment next to master_doc about
> it.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Forgot to add Jon in recipients originally. Ping. :)
> ---
> Documentation/conf.py | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/conf.py b/Documentation/conf.py
> index 5ab26ce89daf..6c986f64f764 100644
> --- a/Documentation/conf.py
> +++ b/Documentation/conf.py
> @@ -103,9 +103,8 @@ def config_init(app, config):
>
> # get index.rst, if it exists
> doc = os.path.basename(app.srcdir)
> - fname = "index"
> - if os.path.exists(os.path.join(app.srcdir, fname + ".rst")):
> - latex_documents.append((fname, doc + ".tex",
> + if os.path.exists(os.path.join(app.srcdir, master_doc + ".rst")):
> + latex_documents.append((master_doc, doc + ".tex",
> "Linux %s Documentation" % doc.capitalize(),
> "The kernel development community",
> "manual"))
> @@ -114,7 +113,7 @@ def config_init(app, config):
> # When building all docs, or when a main index.rst doesn't exist, seek
> # for it on subdirectories
> for doc in os.listdir(app.srcdir):
> - fname = os.path.join(doc, "index")
> + fname = os.path.join(doc, master_doc)
> if not os.path.exists(os.path.join(app.srcdir, fname + ".rst")):
> continue
>
> @@ -267,6 +266,7 @@ source_suffix = {
> # source_encoding = 'utf-8-sig'
>
> # The master toctree document.
> +# FIXME: switch to root_doc when needs_sphinx gets bumped to >= 4.0.
> master_doc = "index"
>
> # General information about the project.
--
Jani Nikula, Intel
next prev parent reply other threads:[~2026-12-02 15:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 16:38 [PATCH] docs: conf.py: use master_doc instead of hardcoding index Jani Nikula
2026-12-02 15:28 ` Jani Nikula [this message]
2026-12-02 15:51 ` Jonathan Corbet
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=7bb61e5c719b74fa208e322694dd9336e938c473@intel.com \
--to=jani.nikula@intel.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.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