Linux Documentation
 help / color / mirror / Atom feed
* [PATCH] docs: conf.py: use master_doc instead of hardcoding index
@ 2026-11-24 16:38 Jani Nikula
  0 siblings, 0 replies; only message in thread
From: Jani Nikula @ 2026-11-24 16:38 UTC (permalink / raw)
  To: linux-doc; +Cc: jani.nikula

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-24 16:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 16:38 [PATCH] docs: conf.py: use master_doc instead of hardcoding index Jani Nikula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox