Skip to content

Commit

Permalink
docs: sphinx-extensions: add metadata parallel-safe
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Markus Heiser authored and Jonathan Corbet committed Sep 1, 2016
1 parent 82801d0 commit b62b9d8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Documentation/sphinx/kernel-doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
from sphinx.util.compat import Directive
from sphinx.ext.autodoc import AutodocReporter

__version__ = '1.0'

class KernelDocDirective(Directive):
"""Extract kernel-doc comments from the specified file"""
required_argument = 1
Expand Down Expand Up @@ -139,3 +141,9 @@ def setup(app):
app.add_config_value('kerneldoc_verbosity', 1, 'env')

app.add_directive('kernel-doc', KernelDocDirective)

return dict(
version = __version__,
parallel_read_safe = True,
parallel_write_safe = True
)
7 changes: 7 additions & 0 deletions Documentation/sphinx/kernel_include.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,18 @@
from docutils.parsers.rst.directives.body import CodeBlock, NumberLines
from docutils.parsers.rst.directives.misc import Include

__version__ = '1.0'

# ==============================================================================
def setup(app):
# ==============================================================================

app.add_directive("kernel-include", KernelInclude)
return dict(
version = __version__,
parallel_read_safe = True,
parallel_write_safe = True
)

# ==============================================================================
class KernelInclude(Include):
Expand Down
6 changes: 6 additions & 0 deletions Documentation/sphinx/rstFlatTable.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ def setup(app):
roles.register_local_role('cspan', c_span)
roles.register_local_role('rspan', r_span)

return dict(
version = __version__,
parallel_read_safe = True,
parallel_write_safe = True
)

# ==============================================================================
def c_span(name, rawtext, text, lineno, inliner, options=None, content=None):
# ==============================================================================
Expand Down

0 comments on commit b62b9d8

Please sign in to comment.