diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2021-01-01 01:21:11 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-01-23 09:53:17 -0500 |
commit | 10a1df3cd43ba2fe893d5dd1aeb2e7109ef0007f (patch) | |
tree | e85d60f96895f660feb2af3855d56c016ffb5666 /doc/sphinx/kerneldoc.py | |
parent | 4afc4f37c70eb3b275cdcbd99818fb47493aa7ad (diff) | |
download | u-boot-10a1df3cd43ba2fe893d5dd1aeb2e7109ef0007f.zip u-boot-10a1df3cd43ba2fe893d5dd1aeb2e7109ef0007f.tar.gz u-boot-10a1df3cd43ba2fe893d5dd1aeb2e7109ef0007f.tar.bz2 |
doc: update Kernel documentation build system
Update the docomentation build system according to Linux v5.11-rc1.
With this patch we can build the HTML documentation using either of
Sphinx 2 and Sphinx 3.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
[Fix warning in b4860qds.rst about "Switch Settings"]
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'doc/sphinx/kerneldoc.py')
-rw-r--r-- | doc/sphinx/kerneldoc.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/doc/sphinx/kerneldoc.py b/doc/sphinx/kerneldoc.py index 4bcbd6a..e9857ab 100644 --- a/doc/sphinx/kerneldoc.py +++ b/doc/sphinx/kerneldoc.py @@ -62,6 +62,7 @@ class KernelDocDirective(Directive): 'export': directives.unchanged, 'internal': directives.unchanged, 'identifiers': directives.unchanged, + 'no-identifiers': directives.unchanged, 'functions': directives.unchanged, } has_content = False @@ -70,6 +71,11 @@ class KernelDocDirective(Directive): env = self.state.document.settings.env cmd = [env.config.kerneldoc_bin, '-rst', '-enable-lineno'] + # Pass the version string to kernel-doc, as it needs to use a different + # dialect, depending what the C domain supports for each specific + # Sphinx versions + cmd += ['-sphinx-version', sphinx.__version__] + filename = env.config.kerneldoc_srctree + '/' + self.arguments[0] export_file_patterns = [] @@ -99,6 +105,12 @@ class KernelDocDirective(Directive): else: cmd += ['-no-doc-sections'] + if 'no-identifiers' in self.options: + no_identifiers = self.options.get('no-identifiers').split() + if no_identifiers: + for i in no_identifiers: + cmd += ['-nosymbol', i] + for pattern in export_file_patterns: for f in glob.glob(env.config.kerneldoc_srctree + '/' + pattern): env.note_dependency(os.path.abspath(f)) @@ -136,7 +148,8 @@ class KernelDocDirective(Directive): lineoffset = int(match.group(1)) - 1 # we must eat our comments since the upset the markup else: - result.append(line, filename, lineoffset) + doc = env.srcdir + "/" + env.docname + ":" + str(self.lineno) + result.append(line, doc + ": " + filename, lineoffset) lineoffset += 1 node = nodes.section() |