Skip to content

Commit 6a4931a

Browse files
mchehabJonathan Corbet
authored andcommitted
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@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <29cbe375dc418d6fa5793f55199799b5b52dcd38.1768838938.git.mchehab+huawei@kernel.org>
1 parent f123cff commit 6a4931a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Documentation/conf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
# Add location of Sphinx extensions
2020
sys.path.insert(0, os.path.join(kern_doc_dir, "sphinx"))
2121

22+
# Allow sphinx.ext.autodoc to document files at tools and scripts
23+
sys.path.append(os.path.join(kern_doc_dir, "..", "tools"))
24+
sys.path.append(os.path.join(kern_doc_dir, "..", "scripts"))
25+
2226
# Minimal supported version
2327
needs_sphinx = "3.4.3"
2428

@@ -152,6 +156,7 @@ def have_command(cmd):
152156
"maintainers_include",
153157
"parser_yaml",
154158
"rstFlatTable",
159+
"sphinx.ext.autodoc",
155160
"sphinx.ext.autosectionlabel",
156161
"sphinx.ext.ifconfig",
157162
"translations",

0 commit comments

Comments
 (0)