[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <57823e4d8d025ad34e4891215e387778564fcdcb.1768488832.git.mchehab+huawei@kernel.org>
Date: Thu, 15 Jan 2026 16:40:24 +0100
From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To: Jonathan Corbet <corbet@....net>,
Linux Doc Mailing List <linux-doc@...r.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
linux-kernel@...r.kernel.org,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Shuah Khan <skhan@...uxfoundation.org>,
Jani Nikula <jani.nikula@...ux.intel.com>
Subject: [PATCH v2 03/15] docs: conf: don't rely on cwd to get documentation location
Instead of relying that Sphinx will be called from Documentation/
dir, pick the location based on __file__.
Suggested-by: Jani Nikula <jani.nikula@...ux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
---
Documentation/conf.py | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/Documentation/conf.py b/Documentation/conf.py
index 548e57b1fb01..f62982f83501 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -13,10 +13,11 @@ from textwrap import dedent
import sphinx
-# If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute, like shown here.
-sys.path.insert(0, os.path.abspath("sphinx"))
+# Location of Documentation/ directory
+kern_doc_dir = os.path.dirname(os.path.abspath(__file__))
+
+# Add location of Sphinx extensions
+sys.path.insert(0, os.path.join(kern_doc_dir, "sphinx"))
# Minimal supported version
needs_sphinx = "3.4.3"
@@ -32,9 +33,6 @@ else:
# Include patterns that don't contain directory names, in glob format
include_patterns = ["**.rst"]
-# Location of Documentation/ directory
-kern_doc_dir = os.path.abspath(".")
-
# Exclude of patterns that don't contain directory names, in glob format.
exclude_patterns = []
--
2.52.0
Powered by blists - more mailing lists