From: Jani Nikula <jani.nikula@intel.com>
To: linux-doc@vger.kernel.org
Cc: jani.nikula@intel.com
Subject: [PATCH] docs: conf.py: use master_doc instead of hardcoding index
Date: Tue, 24 Nov 2026 18:38:20 +0200 [thread overview]
Message-ID: <20261124163820.1587424-1-jani.nikula@intel.com> (raw)
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>
---
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.
--
2.47.3
reply other threads:[~2026-11-24 16:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261124163820.1587424-1-jani.nikula@intel.com \
--to=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