summaryrefslogtreecommitdiffstats
path: root/Documentation/sphinx
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-07-23 12:55:59 +0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-07-23 12:55:59 +0200
commit7e5b7d1b3a8facd4dc1ddb5d9ec53c0687d13de7 (patch)
tree68bf4cf7fc44e0f8bf6e46116996fe7b969fda4e /Documentation/sphinx
parent[media] doc-rst: cec: update documentation (diff)
parentdoc-rst: kernel-doc: fix handling of address_space tags (diff)
downloadlinux-7e5b7d1b3a8facd4dc1ddb5d9ec53c0687d13de7.tar.xz
linux-7e5b7d1b3a8facd4dc1ddb5d9ec53c0687d13de7.zip
Merge branch 'docs-next' of git://git.lwn.net/linux into topic/docs-next
* 'docs-next' of git://git.lwn.net/linux: doc-rst: kernel-doc: fix handling of address_space tags Revert "doc/sphinx: Enable keep_warnings" doc-rst: kernel-doc directive, fix state machine reporter docs: deprecate kernel-doc-nano-HOWTO.txt doc/sphinx: Enable keep_warnings Documentation: add watermark_scale_factor to the list of vm systcl file kernel-doc: Fix up warning output docs: Get rid of some kernel-documentation warnings
Diffstat (limited to 'Documentation/sphinx')
-rw-r--r--Documentation/sphinx/kernel-doc.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/Documentation/sphinx/kernel-doc.py b/Documentation/sphinx/kernel-doc.py
index dedb24e3bb7a..f6920c0af6ee 100644
--- a/Documentation/sphinx/kernel-doc.py
+++ b/Documentation/sphinx/kernel-doc.py
@@ -37,6 +37,7 @@ from docutils import nodes, statemachine
from docutils.statemachine import ViewList
from docutils.parsers.rst import directives
from sphinx.util.compat import Directive
+from sphinx.ext.autodoc import AutodocReporter
class KernelDocDirective(Directive):
"""Extract kernel-doc comments from the specified file"""
@@ -117,12 +118,17 @@ class KernelDocDirective(Directive):
lineoffset += 1
node = nodes.section()
- node.document = self.state.document
- self.state.nested_parse(result, self.content_offset, node)
+ buf = self.state.memo.title_styles, self.state.memo.section_level, self.state.memo.reporter
+ self.state.memo.reporter = AutodocReporter(result, self.state.memo.reporter)
+ self.state.memo.title_styles, self.state.memo.section_level = [], 0
+ try:
+ self.state.nested_parse(result, 0, node, match_titles=1)
+ finally:
+ self.state.memo.title_styles, self.state.memo.section_level, self.state.memo.reporter = buf
return node.children
- except Exception as e:
+ except Exception as e: # pylint: disable=W0703
env.app.warn('kernel-doc \'%s\' processing failed with: %s' %
(" ".join(cmd), str(e)))
return [nodes.error(None, nodes.paragraph(text = "kernel-doc missing"))]