From: Mauro Carvalho Chehab Date: Thu, 21 Aug 2025 08:16:39 +0000 (+0200) Subject: docs: conf.py: fix doc name with SPHINXDIRS X-Git-Tag: v6.18-rc1~107^2~60^2~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=280fa75c2cf51793313400d5e3737d5c3131dd5b;p=thirdparty%2Fkernel%2Fstable.git docs: conf.py: fix doc name with SPHINXDIRS When SPHINXDIRS is used, the current logic produces a wrong list of files, as it will not pick the SPHINXDIRS directory, picking instead their children. Add a rule to detect it and create the PDF doc with the right name. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/183f630643eacf414cfa8d892f03dd1b1055c21e.1755763127.git.mchehab+huawei@kernel.org --- diff --git a/Documentation/conf.py b/Documentation/conf.py index 217c3c778e1e8..69290cadc2db5 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -91,6 +91,19 @@ def config_init(app, config): # LaTeX and PDF output require a list of documents with are dependent # of the app.srcdir. Add them here + # When SPHINXDIRS is used, we just need to get index.rst, if it exists + if not os.path.samefile(doctree, app.srcdir): + doc = "index" + doc_name = os.path.basename(app.srcdir) + if os.path.exists(os.path.join(app.srcdir, doc + ".rst")): + latex_documents.append((doc, doc_name + ".tex", + "Linux %s Documentation" % doc_name.capitalize(), + "The kernel development community", + "manual")) + return + + # When building all docs, or when a main index.rst doesn't exist, seek + # for it on subdirectories for fn in os.listdir(app.srcdir): doc = os.path.join(fn, "index") if not os.path.exists(os.path.join(app.srcdir, doc + ".rst")):