Linux Documentation
 help / color / mirror / Atom feed
From: Jonathan Corbet <corbet@lwn.net>
To: Jani Nikula <jani.nikula@intel.com>, linux-doc@vger.kernel.org
Cc: jani.nikula@intel.com
Subject: Re: [PATCH] docs: conf.py: use master_doc instead of hardcoding index
Date: Wed, 02 Dec 2026 12:41:52 -0700	[thread overview]
Message-ID: <87ld67bhbz.fsf@trenco.lwn.net> (raw)
In-Reply-To: <20261124163820.1587424-1-jani.nikula@intel.com>

Jani Nikula <jani.nikula@intel.com> writes:

> 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.

It's probably time to consider our minimal Sphinx requirement.  Some of
those older versions are painful enough to use that *not* supporting
them is likely to be a service to humanity.

> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  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"

Applied, thanks.

jon

      parent reply	other threads:[~2026-12-02 19:41 UTC|newest]

Thread overview: 4+ 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
2026-12-02 15:51   ` Jonathan Corbet
2026-12-02 19:41 ` Jonathan Corbet [this message]

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=87ld67bhbz.fsf@trenco.lwn.net \
    --to=corbet@lwn.net \
    --cc=jani.nikula@intel.com \
    --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