aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarIT.de>2016-08-24 09:35:24 -0400
committerJonathan Corbet <corbet@lwn.net>2016-09-01 10:19:02 -0400
commitb62b9d81a06f60ae4ad5f7a9c969f5b9680e2829 (patch)
tree07e63a98dcee6c93c88d70be40d8321ff005f217
parent82801d065b4915d030e7f63212d146a75042aa91 (diff)
docs: sphinx-extensions: add metadata parallel-safe
The setup() function of a Sphinx-extension can return a dictionary. This is treated by Sphinx as metadata of the extension [1]. With metadata "parallel_read_safe = True" a extension is marked as save for "parallel reading of source". This is needed if you want build in parallel with N processes. E.g.: make SPHINXOPTS=-j4 htmldocs will no longer log warnings like: WARNING: the foobar extension does not declare if it is safe for parallel reading, assuming it isn't - please ask the extension author to check and make it explicit. Add metadata to extensions: * kernel-doc * flat-table * kernel-include [1] http://www.sphinx-doc.org/en/stable/extdev/#extension-metadata Signed-off-by: Markus Heiser <markus.heiser@darmarIT.de> Tested-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
-rw-r--r--Documentation/sphinx/kernel-doc.py8
-rwxr-xr-xDocumentation/sphinx/kernel_include.py7
-rwxr-xr-x[-rw-r--r--]Documentation/sphinx/rstFlatTable.py6
3 files changed, 21 insertions, 0 deletions
diff --git a/Documentation/sphinx/kernel-doc.py b/Documentation/sphinx/kernel-doc.py
index f6920c0af6ee..d15e07f36881 100644
--- a/Documentation/sphinx/kernel-doc.py
+++ b/Documentation/sphinx/kernel-doc.py
@@ -39,6 +39,8 @@ from docutils.parsers.rst import directives
39from sphinx.util.compat import Directive 39from sphinx.util.compat import Directive
40from sphinx.ext.autodoc import AutodocReporter 40from sphinx.ext.autodoc import AutodocReporter
41 41
42__version__ = '1.0'
43
42class KernelDocDirective(Directive): 44class KernelDocDirective(Directive):
43 """Extract kernel-doc comments from the specified file""" 45 """Extract kernel-doc comments from the specified file"""
44 required_argument = 1 46 required_argument = 1
@@ -139,3 +141,9 @@ def setup(app):
139 app.add_config_value('kerneldoc_verbosity', 1, 'env') 141 app.add_config_value('kerneldoc_verbosity', 1, 'env')
140 142
141 app.add_directive('kernel-doc', KernelDocDirective) 143 app.add_directive('kernel-doc', KernelDocDirective)
144
145 return dict(
146 version = __version__,
147 parallel_read_safe = True,
148 parallel_write_safe = True
149 )
diff --git a/Documentation/sphinx/kernel_include.py b/Documentation/sphinx/kernel_include.py
index db5738238733..f523aa68a36b 100755
--- a/Documentation/sphinx/kernel_include.py
+++ b/Documentation/sphinx/kernel_include.py
@@ -39,11 +39,18 @@ from docutils.parsers.rst import directives
39from docutils.parsers.rst.directives.body import CodeBlock, NumberLines 39from docutils.parsers.rst.directives.body import CodeBlock, NumberLines
40from docutils.parsers.rst.directives.misc import Include 40from docutils.parsers.rst.directives.misc import Include
41 41
42__version__ = '1.0'
43
42# ============================================================================== 44# ==============================================================================
43def setup(app): 45def setup(app):
44# ============================================================================== 46# ==============================================================================
45 47
46 app.add_directive("kernel-include", KernelInclude) 48 app.add_directive("kernel-include", KernelInclude)
49 return dict(
50 version = __version__,
51 parallel_read_safe = True,
52 parallel_write_safe = True
53 )
47 54
48# ============================================================================== 55# ==============================================================================
49class KernelInclude(Include): 56class KernelInclude(Include):
diff --git a/Documentation/sphinx/rstFlatTable.py b/Documentation/sphinx/rstFlatTable.py
index 26db852e3c74..55f275793028 100644..100755
--- a/Documentation/sphinx/rstFlatTable.py
+++ b/Documentation/sphinx/rstFlatTable.py
@@ -73,6 +73,12 @@ def setup(app):
73 roles.register_local_role('cspan', c_span) 73 roles.register_local_role('cspan', c_span)
74 roles.register_local_role('rspan', r_span) 74 roles.register_local_role('rspan', r_span)
75 75
76 return dict(
77 version = __version__,
78 parallel_read_safe = True,
79 parallel_write_safe = True
80 )
81
76# ============================================================================== 82# ==============================================================================
77def c_span(name, rawtext, text, lineno, inliner, options=None, content=None): 83def c_span(name, rawtext, text, lineno, inliner, options=None, content=None):
78# ============================================================================== 84# ==============================================================================