From: Jani Nikula <jani.nikula@intel.com>
To: Markus Heiser <markus.heiser@darmarit.de>
Cc: Jani Nikula <jani.nikula@intel.com>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
Jonathan Corbet <corbet@lwn.net>,
Grant Likely <grant.likely@secretlab.ca>,
Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
Dan Allen <dan@opendevise.io>,
Russel Winder <russel@winder.org.uk>,
Keith Packard <keithp@keithp.com>,
LKML <linux-kernel@vger.kernel.org>,
linux-doc@vger.kernel.org, Hans Verkuil <hverkuil@xs4all.nl>
Subject: [PATCH 06/10] Documentation/sphinx: configure the kernel-doc extension
Date: Fri, 20 May 2016 16:39:37 +0300 [thread overview]
Message-ID: <2ab30db47c5ef5c87ac2e25e6562389ded4e81fe.1463748027.git.jani.nikula@intel.com> (raw)
In-Reply-To: <cover.1463748027.git.jani.nikula@intel.com>
In-Reply-To: <cover.1463748027.git.jani.nikula@intel.com>
Tell Sphinx where to find the extension, and pass on the kernel src tree
and kernel-doc paths to the extension.
With this, any .rst files under Documentation may contain the kernel-doc
rst directive to include kernel-doc documentation from any source file.
While building, it may be handy to pass kernel-doc extension
configuration on the command line. For example, 'make SPHINXOPTS="-D
kerneldoc_verbosity=0" htmldocs' silences all stderr output from
kernel-doc when the kernel-doc exit code is 0. (The stderr will be
logged unconditionally when the exit code is non-zero.)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
Documentation/Makefile.sphinx | 4 +++-
Documentation/conf.py | 10 ++++++++--
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
index 25a7970bfe5c..8a662be9bd87 100644
--- a/Documentation/Makefile.sphinx
+++ b/Documentation/Makefile.sphinx
@@ -25,7 +25,9 @@ HAVE_RST2PDF := $(shell if python -c "import rst2pdf" >/dev/null 2>&1; then echo
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS = -d $(BUILDDIR)/.doctrees $(PAPEROPT_$(PAPER)) -c $(srctree)/$(src) $(SPHINXOPTS) $(srctree)/$(src)
+KERNELDOC = $(srctree)/scripts/kernel-doc
+KERNELDOC_CONF = -D kerneldoc_srctree=$(srctree) -D kerneldoc_bin=$(KERNELDOC)
+ALLSPHINXOPTS = -d $(BUILDDIR)/.doctrees $(KERNELDOC_CONF) $(PAPEROPT_$(PAPER)) -c $(srctree)/$(src) $(SPHINXOPTS) $(srctree)/$(src)
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
diff --git a/Documentation/conf.py b/Documentation/conf.py
index ff86f5e88049..0d33cb157716 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -18,7 +18,7 @@ import os
# 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('.'))
+sys.path.insert(0, os.path.abspath('sphinx'))
# -- General configuration ------------------------------------------------
@@ -28,7 +28,7 @@ import os
# 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 = ['kernel-doc']
# Gracefully handle missing rst2pdf.
try:
@@ -376,3 +376,9 @@ epub_exclude_files = ['search.html']
pdf_documents = [
('index', u'Kernel', u'Kernel', u'J. Random Bozo'),
]
+
+# kernel-doc extension configuration for running Sphinx directly (e.g. by Read
+# the Docs). In a normal build, these are supplied from the Makefile via command
+# line arguments.
+kerneldoc_bin = '../scripts/kernel-doc'
+kerneldoc_srctree = '..'
--
2.1.4
next prev parent reply other threads:[~2016-05-20 13:40 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-20 13:39 [PATCH 00/10] Documentation/Sphinx Jani Nikula
2016-05-20 13:39 ` [PATCH 01/10] kernel-doc: fix use of uninitialized value Jani Nikula
2016-05-20 13:39 ` [PATCH 02/10] kernel-doc: support printing exported and non-exported symbols Jani Nikula
2016-05-20 13:39 ` [PATCH 03/10] Documentation/sphinx: add basic working Sphinx configuration and build Jani Nikula
2016-05-20 13:39 ` [PATCH 04/10] Documentation: add .gitignore Jani Nikula
2016-05-20 13:39 ` [PATCH 05/10] Documentation/sphinx: add Sphinx kernel-doc directive extension Jani Nikula
2016-06-03 20:35 ` Jonathan Corbet
2016-06-04 6:57 ` Markus Heiser
2016-05-20 13:39 ` Jani Nikula [this message]
2016-05-20 13:39 ` [PATCH 07/10] sphinx: cheesy script to convert .tmpl files Jani Nikula
2016-05-20 13:39 ` [PATCH 08/10] Documentation: add kernel hacking rst Jani Nikula
2016-05-20 13:39 ` [PATCH 09/10] Documentation: add kernel api rst Jani Nikula
2016-05-20 13:39 ` [PATCH 10/10] Documentation: moar files Jani Nikula
2016-05-29 20:33 ` [PATCH 00/10] Documentation/Sphinx Jani Nikula
2016-05-30 9:10 ` Daniel Vetter
2016-05-30 10:47 ` Markus Heiser
2016-05-30 14:46 ` Jani Nikula
2016-05-30 15:29 ` Daniel Vetter
2016-05-30 16:39 ` Markus Heiser
2016-05-30 20:05 ` Jani Nikula
2016-05-30 21:23 ` Mauro Carvalho Chehab
2016-05-31 10:16 ` Markus Heiser
2016-06-24 10:40 ` Mauro Carvalho Chehab
2016-06-27 6:15 ` Markus Heiser
2016-06-27 17:08 ` Mauro Carvalho Chehab
2016-06-29 12:41 ` Markus Heiser
2016-05-31 7:27 ` Markus Heiser
2016-05-31 8:07 ` Daniel Vetter
2016-05-31 9:39 ` Markus Heiser
2016-05-31 10:30 ` Jani Nikula
2016-05-31 11:12 ` Markus Heiser
2016-06-03 20:47 ` rst2pdf (was [PATCH 00/10] Documentation/Sphinx) Jonathan Corbet
2016-06-07 6:02 ` Markus Heiser
2016-06-07 6:44 ` Jani Nikula
2016-06-10 17:08 ` Markus Heiser
2016-06-03 21:04 ` [PATCH 00/10] Documentation/Sphinx Jonathan Corbet
2016-06-03 22:54 ` Daniel Vetter
2016-06-04 11:45 ` Jani Nikula
2016-06-01 1:07 ` Jonathan Corbet
2016-06-01 6:42 ` Daniel Vetter
2016-06-03 20:16 ` Jonathan Corbet
2016-06-03 20:24 ` Daniel Vetter
2016-06-03 20:27 ` Jonathan Corbet
2016-06-04 13:01 ` Jani Nikula
2016-06-04 12:54 ` Jani Nikula
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2ab30db47c5ef5c87ac2e25e6562389ded4e81fe.1463748027.git.jani.nikula@intel.com \
--to=jani.nikula@intel.com \
--cc=corbet@lwn.net \
--cc=dan@opendevise.io \
--cc=daniel.vetter@ffwll.ch \
--cc=grant.likely@secretlab.ca \
--cc=hverkuil@xs4all.nl \
--cc=keithp@keithp.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=markus.heiser@darmarit.de \
--cc=mchehab@osg.samsung.com \
--cc=russel@winder.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®