[Qemu-devel] [RFC 03/10] docs/conf.py: Enable use of kerneldoc sphinx extension

Peter Maydell posted 10 patches 6 years, 8 months ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Peter Maydell <peter.maydell@linaro.org>
[Qemu-devel] [RFC 03/10] docs/conf.py: Enable use of kerneldoc sphinx extension
Posted by Peter Maydell 6 years, 8 months ago
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 docs/conf.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/docs/conf.py b/docs/conf.py
index befbcc6c3e1..9109edbcb97 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -41,8 +41,7 @@ except NameError:
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use an absolute path starting from qemu_docdir.
 #
-# sys.path.insert(0, os.path.join(qemu_docdir, "my_subdir"))
-
+sys.path.insert(0, os.path.join(qemu_docdir, "sphinx"))
 
 # -- General configuration ------------------------------------------------
 
@@ -54,7 +53,7 @@ needs_sphinx = '1.3'
 # Add any Sphinx extension module names here, as strings. They can be
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
 # ones.
-extensions = []
+extensions = ['kerneldoc']
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
@@ -213,4 +212,10 @@ texinfo_documents = [
 ]
 
 
+# -- Options for configuring kerneldoc extension  -------------------------
 
+# We use paths starting from qemu_docdir here so that you can run
+# sphinx-build from anywhere and the kerneldoc extension can still
+# find everything.
+kerneldoc_bin = os.path.join(qemu_docdir, '../scripts/kernel-doc')
+kerneldoc_srctree = os.path.join(qemu_docdir, '..')
-- 
2.20.1