[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <954a544ed6222bafcce2f3761dfc6b77bf9140f8.1768488832.git.mchehab+huawei@kernel.org>
Date: Thu, 15 Jan 2026 16:40:25 +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>
Subject: [PATCH v2 04/15] docs: enable Sphinx autodoc extension to allow documenting python
Adding python documentation is simple with Sphinx: all we need
is to include the ext.autodoc extension and add the directories
where the Python code sits at the sys.path.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
---
Documentation/conf.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Documentation/conf.py b/Documentation/conf.py
index f62982f83501..687c61e9ac7b 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -19,6 +19,10 @@ 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"))
+# Allow sphinx.ext.autodoc to document files at tools and scripts
+sys.path.append(os.path.join(kern_doc_dir, "..", "tools"))
+sys.path.append(os.path.join(kern_doc_dir, "..", "scripts"))
+
# Minimal supported version
needs_sphinx = "3.4.3"
@@ -149,6 +153,7 @@ extensions = [
"maintainers_include",
"parser_yaml",
"rstFlatTable",
+ "sphinx.ext.autodoc",
"sphinx.ext.autosectionlabel",
"sphinx.ext.ifconfig",
"translations",
--
2.52.0
Powered by blists - more mailing lists