2025-06-22 08:02:43 +02:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
# pylint: disable=C0103,C0209
|
|
|
|
|
|
|
|
"""
|
|
|
|
The Linux Kernel documentation build configuration file.
|
|
|
|
"""
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
import os
|
2022-08-27 13:37:18 +09:00
|
|
|
import shutil
|
2025-06-22 08:02:43 +02:00
|
|
|
import sys
|
|
|
|
|
|
|
|
import sphinx
|
|
|
|
|
|
|
|
# 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("sphinx"))
|
|
|
|
|
|
|
|
from load_config import loadConfig # pylint: disable=C0413,E0401
|
|
|
|
|
|
|
|
# Minimal supported version
|
|
|
|
needs_sphinx = "3.4.3"
|
2022-08-27 13:37:18 +09:00
|
|
|
|
2025-06-22 08:02:30 +02:00
|
|
|
# Get Sphinx version
|
2025-06-22 08:02:43 +02:00
|
|
|
major, minor, patch = sphinx.version_info[:3] # pylint: disable=I1101
|
2025-06-22 08:02:30 +02:00
|
|
|
|
|
|
|
# Include_patterns were added on Sphinx 5.1
|
|
|
|
if (major < 5) or (major == 5 and minor < 1):
|
|
|
|
has_include_patterns = False
|
|
|
|
else:
|
|
|
|
has_include_patterns = True
|
|
|
|
# Include patterns that don't contain directory names, in glob format
|
2025-06-22 08:02:43 +02:00
|
|
|
include_patterns = ["**.rst"]
|
2025-06-22 08:02:30 +02:00
|
|
|
|
|
|
|
# Location of Documentation/ directory
|
2025-06-22 08:02:43 +02:00
|
|
|
doctree = os.path.abspath(".")
|
2025-06-22 08:02:30 +02:00
|
|
|
|
|
|
|
# Exclude of patterns that don't contain directory names, in glob format.
|
|
|
|
exclude_patterns = []
|
|
|
|
|
|
|
|
# List of patterns that contain directory names in glob format.
|
|
|
|
dyn_include_patterns = []
|
2025-06-22 08:02:43 +02:00
|
|
|
dyn_exclude_patterns = ["output"]
|
2025-06-22 08:02:30 +02:00
|
|
|
|
|
|
|
# Properly handle include/exclude patterns
|
|
|
|
# ----------------------------------------
|
|
|
|
|
|
|
|
def update_patterns(app, config):
|
|
|
|
"""
|
|
|
|
On Sphinx, all directories are relative to what it is passed as
|
|
|
|
SOURCEDIR parameter for sphinx-build. Due to that, all patterns
|
|
|
|
that have directory names on it need to be dynamically set, after
|
|
|
|
converting them to a relative patch.
|
|
|
|
|
|
|
|
As Sphinx doesn't include any patterns outside SOURCEDIR, we should
|
|
|
|
exclude relative patterns that start with "../".
|
|
|
|
"""
|
|
|
|
|
|
|
|
# setup include_patterns dynamically
|
|
|
|
if has_include_patterns:
|
|
|
|
for p in dyn_include_patterns:
|
|
|
|
full = os.path.join(doctree, p)
|
|
|
|
|
2025-06-22 08:02:43 +02:00
|
|
|
rel_path = os.path.relpath(full, start=app.srcdir)
|
2025-06-22 08:02:30 +02:00
|
|
|
if rel_path.startswith("../"):
|
|
|
|
continue
|
|
|
|
|
|
|
|
config.include_patterns.append(rel_path)
|
|
|
|
|
|
|
|
# setup exclude_patterns dynamically
|
|
|
|
for p in dyn_exclude_patterns:
|
|
|
|
full = os.path.join(doctree, p)
|
|
|
|
|
2025-06-22 08:02:43 +02:00
|
|
|
rel_path = os.path.relpath(full, start=app.srcdir)
|
2025-06-22 08:02:30 +02:00
|
|
|
if rel_path.startswith("../"):
|
|
|
|
continue
|
|
|
|
|
|
|
|
config.exclude_patterns.append(rel_path)
|
|
|
|
|
2025-06-22 08:02:43 +02:00
|
|
|
|
2022-08-27 13:37:18 +09:00
|
|
|
# helper
|
|
|
|
# ------
|
|
|
|
|
2025-06-22 08:02:43 +02:00
|
|
|
|
2022-08-27 13:37:18 +09:00
|
|
|
def have_command(cmd):
|
|
|
|
"""Search ``cmd`` in the ``PATH`` environment.
|
|
|
|
|
|
|
|
If found, return True.
|
|
|
|
If not found, return False.
|
|
|
|
"""
|
|
|
|
return shutil.which(cmd) is not None
|
2016-08-16 13:25:43 -03:00
|
|
|
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# -- General configuration ------------------------------------------------
|
|
|
|
|
2025-06-22 08:02:43 +02:00
|
|
|
# Add any Sphinx extensions in alphabetic order
|
|
|
|
extensions = [
|
|
|
|
"automarkup",
|
|
|
|
"kernel_abi",
|
|
|
|
"kerneldoc",
|
|
|
|
"kernel_feat",
|
|
|
|
"kernel_include",
|
|
|
|
"kfigure",
|
|
|
|
"maintainers_include",
|
|
|
|
"rstFlatTable",
|
|
|
|
"sphinx.ext.autosectionlabel",
|
|
|
|
"sphinx.ext.ifconfig",
|
|
|
|
"translations",
|
|
|
|
]
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
2025-05-07 14:11:17 +02:00
|
|
|
# Since Sphinx version 3, the C function parser is more pedantic with regards
|
|
|
|
# to type checking. Due to that, having macros at c:function cause problems.
|
|
|
|
# Those needed to be escaped by using c_id_attributes[] array
|
|
|
|
c_id_attributes = [
|
|
|
|
# GCC Compiler types not parsed by Sphinx:
|
|
|
|
"__restrict__",
|
|
|
|
|
|
|
|
# include/linux/compiler_types.h:
|
|
|
|
"__iomem",
|
|
|
|
"__kernel",
|
|
|
|
"noinstr",
|
|
|
|
"notrace",
|
|
|
|
"__percpu",
|
|
|
|
"__rcu",
|
|
|
|
"__user",
|
|
|
|
"__force",
|
|
|
|
"__counted_by_le",
|
|
|
|
"__counted_by_be",
|
|
|
|
|
|
|
|
# include/linux/compiler_attributes.h:
|
|
|
|
"__alias",
|
|
|
|
"__aligned",
|
|
|
|
"__aligned_largest",
|
|
|
|
"__always_inline",
|
|
|
|
"__assume_aligned",
|
|
|
|
"__cold",
|
|
|
|
"__attribute_const__",
|
|
|
|
"__copy",
|
|
|
|
"__pure",
|
|
|
|
"__designated_init",
|
|
|
|
"__visible",
|
|
|
|
"__printf",
|
|
|
|
"__scanf",
|
|
|
|
"__gnu_inline",
|
|
|
|
"__malloc",
|
|
|
|
"__mode",
|
|
|
|
"__no_caller_saved_registers",
|
|
|
|
"__noclone",
|
|
|
|
"__nonstring",
|
|
|
|
"__noreturn",
|
|
|
|
"__packed",
|
|
|
|
"__pure",
|
|
|
|
"__section",
|
|
|
|
"__always_unused",
|
|
|
|
"__maybe_unused",
|
|
|
|
"__used",
|
|
|
|
"__weak",
|
|
|
|
"noinline",
|
|
|
|
"__fix_address",
|
|
|
|
"__counted_by",
|
|
|
|
|
|
|
|
# include/linux/memblock.h:
|
|
|
|
"__init_memblock",
|
|
|
|
"__meminit",
|
|
|
|
|
|
|
|
# include/linux/init.h:
|
|
|
|
"__init",
|
|
|
|
"__ref",
|
|
|
|
|
|
|
|
# include/linux/linkage.h:
|
|
|
|
"asmlinkage",
|
|
|
|
|
|
|
|
# include/linux/btf.h
|
|
|
|
"__bpf_kfunc",
|
|
|
|
]
|
2020-09-04 10:13:45 -06:00
|
|
|
|
docs: conf.py: avoid thousands of duplicate label warning on Sphinx
The autosectionlabel extension is nice, as it allows to refer to
a section by its name without requiring any extra tag to create
a reference name.
However, on its default, it has two serious problems:
1) the namespace is global. So, two files with different
"introduction" section would create a label with the
same name. This is easily solvable by forcing the extension
to prepend the file name with:
autosectionlabel_prefix_document = True
2) It doesn't work hierarchically. So, if there are two level 1
sessions (let's say, one labeled "open" and another one "ioctl")
and both have a level 2 "synopsis" label, both section 2 will
have the same identical name.
Currently, there's no way to tell Sphinx to create an
hierarchical reference like:
open / synopsis
ioctl / synopsis
This causes around 800 warnings. So, the fix should be to
not let autosectionlabel to produce references for anything
that it is not at a chapter level within any doc, with:
autosectionlabel_maxdepth = 2
Fixes: 58ad30cf91f0 ("docs: fix reference to core-api/namespaces.rst")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/74f4d8d91c648d7101c45b4b99cc93532f4dadc6.1584716446.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2020-03-20 16:11:03 +01:00
|
|
|
# Ensure that autosectionlabel will produce unique names
|
|
|
|
autosectionlabel_prefix_document = True
|
|
|
|
autosectionlabel_maxdepth = 2
|
|
|
|
|
2022-08-27 13:37:18 +09:00
|
|
|
# Load math renderer:
|
|
|
|
# For html builder, load imgmath only when its dependencies are met.
|
|
|
|
# mathjax is the default math renderer since Sphinx 1.8.
|
2025-06-22 08:02:43 +02:00
|
|
|
have_latex = have_command("latex")
|
|
|
|
have_dvipng = have_command("dvipng")
|
2022-08-27 13:38:17 +09:00
|
|
|
load_imgmath = have_latex and have_dvipng
|
|
|
|
|
|
|
|
# Respect SPHINX_IMGMATH (for html docs only)
|
2025-06-22 08:02:43 +02:00
|
|
|
if "SPHINX_IMGMATH" in os.environ:
|
|
|
|
env_sphinx_imgmath = os.environ["SPHINX_IMGMATH"]
|
|
|
|
if "yes" in env_sphinx_imgmath:
|
2022-08-27 13:38:17 +09:00
|
|
|
load_imgmath = True
|
2025-06-22 08:02:43 +02:00
|
|
|
elif "no" in env_sphinx_imgmath:
|
2022-08-27 13:38:17 +09:00
|
|
|
load_imgmath = False
|
|
|
|
else:
|
|
|
|
sys.stderr.write("Unknown env SPHINX_IMGMATH=%s ignored.\n" % env_sphinx_imgmath)
|
|
|
|
|
2022-08-27 13:37:18 +09:00
|
|
|
if load_imgmath:
|
|
|
|
extensions.append("sphinx.ext.imgmath")
|
2025-06-22 08:02:43 +02:00
|
|
|
math_renderer = "imgmath"
|
2022-08-27 13:37:18 +09:00
|
|
|
else:
|
2025-06-22 08:02:43 +02:00
|
|
|
math_renderer = "mathjax"
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# Add any paths that contain templates here, relative to this directory.
|
2025-06-22 08:02:43 +02:00
|
|
|
templates_path = ["sphinx/templates"]
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# The suffix(es) of source filenames.
|
|
|
|
# You can specify multiple suffix as a list of string:
|
|
|
|
# source_suffix = ['.rst', '.md']
|
|
|
|
source_suffix = '.rst'
|
|
|
|
|
|
|
|
# The encoding of source files.
|
2025-06-22 08:02:43 +02:00
|
|
|
# source_encoding = 'utf-8-sig'
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# The master toctree document.
|
2025-06-22 08:02:43 +02:00
|
|
|
master_doc = "index"
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# General information about the project.
|
2025-06-22 08:02:43 +02:00
|
|
|
project = "The Linux Kernel"
|
|
|
|
copyright = "The kernel development community" # pylint: disable=W0622
|
|
|
|
author = "The kernel development community"
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# The version info for the project you're documenting, acts as replacement for
|
|
|
|
# |version| and |release|, also used in various other places throughout the
|
|
|
|
# built documents.
|
|
|
|
#
|
2016-05-28 15:25:41 +03:00
|
|
|
# In a normal build, version and release are are set to KERNELVERSION and
|
|
|
|
# KERNELRELEASE, respectively, from the Makefile via Sphinx command line
|
|
|
|
# arguments.
|
|
|
|
#
|
|
|
|
# The following code tries to extract the information by reading the Makefile,
|
|
|
|
# when Sphinx is run directly (e.g. by Read the Docs).
|
|
|
|
try:
|
|
|
|
makefile_version = None
|
|
|
|
makefile_patchlevel = None
|
2025-06-22 08:02:43 +02:00
|
|
|
with open("../Makefile", encoding="utf=8") as fp:
|
|
|
|
for line in fp:
|
|
|
|
key, val = [x.strip() for x in line.split("=", 2)]
|
|
|
|
if key == "VERSION":
|
|
|
|
makefile_version = val
|
|
|
|
elif key == "PATCHLEVEL":
|
|
|
|
makefile_patchlevel = val
|
|
|
|
if makefile_version and makefile_patchlevel:
|
|
|
|
break
|
|
|
|
except Exception:
|
2016-05-28 15:25:41 +03:00
|
|
|
pass
|
|
|
|
finally:
|
|
|
|
if makefile_version and makefile_patchlevel:
|
2025-06-22 08:02:43 +02:00
|
|
|
version = release = makefile_version + "." + makefile_patchlevel
|
2016-05-28 15:25:41 +03:00
|
|
|
else:
|
|
|
|
version = release = "unknown version"
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
2025-06-22 08:02:43 +02:00
|
|
|
|
2022-09-23 16:28:57 -06:00
|
|
|
def get_cline_version():
|
2025-06-22 08:02:43 +02:00
|
|
|
"""
|
|
|
|
HACK: There seems to be no easy way for us to get at the version and
|
|
|
|
release information passed in from the makefile...so go pawing through the
|
|
|
|
command-line options and find it for ourselves.
|
|
|
|
"""
|
|
|
|
|
|
|
|
c_version = c_release = ""
|
2022-09-23 16:28:57 -06:00
|
|
|
for arg in sys.argv:
|
2025-06-22 08:02:43 +02:00
|
|
|
if arg.startswith("version="):
|
2022-09-23 16:28:57 -06:00
|
|
|
c_version = arg[8:]
|
2025-06-22 08:02:43 +02:00
|
|
|
elif arg.startswith("release="):
|
2022-09-23 16:28:57 -06:00
|
|
|
c_release = arg[8:]
|
|
|
|
if c_version:
|
|
|
|
if c_release:
|
2025-06-22 08:02:43 +02:00
|
|
|
return c_version + "-" + c_release
|
2022-09-23 16:28:57 -06:00
|
|
|
return c_version
|
2025-06-22 08:02:43 +02:00
|
|
|
return version # Whatever we came up with before
|
|
|
|
|
2022-09-23 16:28:57 -06:00
|
|
|
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
|
|
|
# for a list of supported languages.
|
|
|
|
#
|
|
|
|
# This is also used if you do content translation via gettext catalogs.
|
|
|
|
# Usually you set "language" from the command line for these cases.
|
2025-06-22 08:02:43 +02:00
|
|
|
language = "en"
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# There are two options for replacing |today|: either, you set today to some
|
|
|
|
# non-false value, then it is used:
|
2025-06-22 08:02:43 +02:00
|
|
|
# today = ''
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
# Else, today_fmt is used as the format for a strftime call.
|
2025-06-22 08:02:43 +02:00
|
|
|
# today_fmt = '%B %d, %Y'
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# The reST default role (used for this markup: `text`) to use for all
|
|
|
|
# documents.
|
2025-06-22 08:02:43 +02:00
|
|
|
# default_role = None
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# If true, '()' will be appended to :func: etc. cross-reference text.
|
2025-06-22 08:02:43 +02:00
|
|
|
# add_function_parentheses = True
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# If true, the current module name will be prepended to all description
|
|
|
|
# unit titles (such as .. function::).
|
2025-06-22 08:02:43 +02:00
|
|
|
# add_module_names = True
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# If true, sectionauthor and moduleauthor directives will be shown in the
|
|
|
|
# output. They are ignored by default.
|
2025-06-22 08:02:43 +02:00
|
|
|
# show_authors = False
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# The name of the Pygments (syntax highlighting) style to use.
|
2025-06-22 08:02:43 +02:00
|
|
|
pygments_style = "sphinx"
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# A list of ignored prefixes for module index sorting.
|
2025-06-22 08:02:43 +02:00
|
|
|
# modindex_common_prefix = []
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# If true, keep warnings as "system message" paragraphs in the built documents.
|
2025-06-22 08:02:43 +02:00
|
|
|
# keep_warnings = False
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
|
|
|
todo_include_todos = False
|
|
|
|
|
2025-06-22 08:02:43 +02:00
|
|
|
primary_domain = "c"
|
|
|
|
highlight_language = "none"
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# -- Options for HTML output ----------------------------------------------
|
|
|
|
|
|
|
|
# The theme to use for HTML and HTML Help pages. See the documentation for
|
|
|
|
# a list of builtin themes.
|
|
|
|
|
2021-12-07 10:52:59 +01:00
|
|
|
# Default theme
|
2025-06-22 08:02:43 +02:00
|
|
|
html_theme = "alabaster"
|
2021-12-07 10:53:00 +01:00
|
|
|
html_css_files = []
|
2021-12-07 10:52:59 +01:00
|
|
|
|
|
|
|
if "DOCS_THEME" in os.environ:
|
|
|
|
html_theme = os.environ["DOCS_THEME"]
|
|
|
|
|
2025-06-22 08:02:43 +02:00
|
|
|
if html_theme in ["sphinx_rtd_theme", "sphinx_rtd_dark_mode"]:
|
2021-12-07 10:52:59 +01:00
|
|
|
# Read the Docs theme
|
|
|
|
try:
|
|
|
|
import sphinx_rtd_theme
|
2025-06-22 08:02:43 +02:00
|
|
|
|
2021-12-07 10:52:59 +01:00
|
|
|
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
|
|
|
|
|
|
|
# Add any paths that contain custom static files (such as style sheets) here,
|
|
|
|
# relative to this directory. They are copied after the builtin static files,
|
|
|
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
|
|
|
html_css_files = [
|
2025-06-22 08:02:43 +02:00
|
|
|
"theme_overrides.css",
|
2021-12-07 10:52:59 +01:00
|
|
|
]
|
docs: add support for RTD dark mode
This is actually an overlay on the top of the RTD theme, which
requires to include first the RTD theme.
It should be noticed that, when the dark theme is used, the
DOCS_CSS files won't be the last CSS themes. So, it won't
override the dark.css style by default. So, it is needed
to force the them override with "!important".
This small script, for instance, produces a nice output with
the RTD dark theme:
DOCS_THEME=sphinx_rtd_dark_mode
cat << EOF > dark_override.css
html body {
font-family: arial,helvetica,sans-serif;
}
html[data-theme='dark'] body {
color: white !important;
}
html[data-theme='dark'] .sig-name {
color: green !important;
}
html[data-theme='dark'] .wy-menu-vertical a {
color: #ffcc00 !important;
}
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3 {
color: #ffcc00 !important;
}
html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6 {
color: #ffcc00 !important;
}
html[data-theme="dark"] h7, html[data-theme="dark"] h8, html[data-theme="dark"] h9 {
color: #ffcc00 !important;
}
html[data-theme="dark"] .wy-nav-content a, html[data-theme="dark"] .wy-nav-content a:visited {
color: #ffcc00 !important;
}
EOF
make DOCS_CSS=dark_override.css DOCS_THEME=sphinx_rtd_dark_mode htmldocs
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/90d316e055ef7f4c9021b9eada8f8d3b2e750a66.1638870323.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2021-12-07 10:53:02 +01:00
|
|
|
|
|
|
|
# Read the Docs dark mode override theme
|
2025-06-22 08:02:43 +02:00
|
|
|
if html_theme == "sphinx_rtd_dark_mode":
|
docs: add support for RTD dark mode
This is actually an overlay on the top of the RTD theme, which
requires to include first the RTD theme.
It should be noticed that, when the dark theme is used, the
DOCS_CSS files won't be the last CSS themes. So, it won't
override the dark.css style by default. So, it is needed
to force the them override with "!important".
This small script, for instance, produces a nice output with
the RTD dark theme:
DOCS_THEME=sphinx_rtd_dark_mode
cat << EOF > dark_override.css
html body {
font-family: arial,helvetica,sans-serif;
}
html[data-theme='dark'] body {
color: white !important;
}
html[data-theme='dark'] .sig-name {
color: green !important;
}
html[data-theme='dark'] .wy-menu-vertical a {
color: #ffcc00 !important;
}
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3 {
color: #ffcc00 !important;
}
html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6 {
color: #ffcc00 !important;
}
html[data-theme="dark"] h7, html[data-theme="dark"] h8, html[data-theme="dark"] h9 {
color: #ffcc00 !important;
}
html[data-theme="dark"] .wy-nav-content a, html[data-theme="dark"] .wy-nav-content a:visited {
color: #ffcc00 !important;
}
EOF
make DOCS_CSS=dark_override.css DOCS_THEME=sphinx_rtd_dark_mode htmldocs
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/90d316e055ef7f4c9021b9eada8f8d3b2e750a66.1638870323.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2021-12-07 10:53:02 +01:00
|
|
|
try:
|
2025-06-22 08:02:43 +02:00
|
|
|
import sphinx_rtd_dark_mode # pylint: disable=W0611
|
|
|
|
|
|
|
|
extensions.append("sphinx_rtd_dark_mode")
|
docs: add support for RTD dark mode
This is actually an overlay on the top of the RTD theme, which
requires to include first the RTD theme.
It should be noticed that, when the dark theme is used, the
DOCS_CSS files won't be the last CSS themes. So, it won't
override the dark.css style by default. So, it is needed
to force the them override with "!important".
This small script, for instance, produces a nice output with
the RTD dark theme:
DOCS_THEME=sphinx_rtd_dark_mode
cat << EOF > dark_override.css
html body {
font-family: arial,helvetica,sans-serif;
}
html[data-theme='dark'] body {
color: white !important;
}
html[data-theme='dark'] .sig-name {
color: green !important;
}
html[data-theme='dark'] .wy-menu-vertical a {
color: #ffcc00 !important;
}
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3 {
color: #ffcc00 !important;
}
html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6 {
color: #ffcc00 !important;
}
html[data-theme="dark"] h7, html[data-theme="dark"] h8, html[data-theme="dark"] h9 {
color: #ffcc00 !important;
}
html[data-theme="dark"] .wy-nav-content a, html[data-theme="dark"] .wy-nav-content a:visited {
color: #ffcc00 !important;
}
EOF
make DOCS_CSS=dark_override.css DOCS_THEME=sphinx_rtd_dark_mode htmldocs
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/90d316e055ef7f4c9021b9eada8f8d3b2e750a66.1638870323.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2021-12-07 10:53:02 +01:00
|
|
|
except ImportError:
|
2025-06-22 08:02:43 +02:00
|
|
|
html_theme = "sphinx_rtd_theme"
|
docs: add support for RTD dark mode
This is actually an overlay on the top of the RTD theme, which
requires to include first the RTD theme.
It should be noticed that, when the dark theme is used, the
DOCS_CSS files won't be the last CSS themes. So, it won't
override the dark.css style by default. So, it is needed
to force the them override with "!important".
This small script, for instance, produces a nice output with
the RTD dark theme:
DOCS_THEME=sphinx_rtd_dark_mode
cat << EOF > dark_override.css
html body {
font-family: arial,helvetica,sans-serif;
}
html[data-theme='dark'] body {
color: white !important;
}
html[data-theme='dark'] .sig-name {
color: green !important;
}
html[data-theme='dark'] .wy-menu-vertical a {
color: #ffcc00 !important;
}
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3 {
color: #ffcc00 !important;
}
html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6 {
color: #ffcc00 !important;
}
html[data-theme="dark"] h7, html[data-theme="dark"] h8, html[data-theme="dark"] h9 {
color: #ffcc00 !important;
}
html[data-theme="dark"] .wy-nav-content a, html[data-theme="dark"] .wy-nav-content a:visited {
color: #ffcc00 !important;
}
EOF
make DOCS_CSS=dark_override.css DOCS_THEME=sphinx_rtd_dark_mode htmldocs
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/90d316e055ef7f4c9021b9eada8f8d3b2e750a66.1638870323.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2021-12-07 10:53:02 +01:00
|
|
|
|
2025-06-22 08:02:43 +02:00
|
|
|
if html_theme == "sphinx_rtd_theme":
|
|
|
|
# Add color-specific RTD normal mode
|
|
|
|
html_css_files.append("theme_rtd_colors.css")
|
docs: add support for RTD dark mode
This is actually an overlay on the top of the RTD theme, which
requires to include first the RTD theme.
It should be noticed that, when the dark theme is used, the
DOCS_CSS files won't be the last CSS themes. So, it won't
override the dark.css style by default. So, it is needed
to force the them override with "!important".
This small script, for instance, produces a nice output with
the RTD dark theme:
DOCS_THEME=sphinx_rtd_dark_mode
cat << EOF > dark_override.css
html body {
font-family: arial,helvetica,sans-serif;
}
html[data-theme='dark'] body {
color: white !important;
}
html[data-theme='dark'] .sig-name {
color: green !important;
}
html[data-theme='dark'] .wy-menu-vertical a {
color: #ffcc00 !important;
}
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3 {
color: #ffcc00 !important;
}
html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6 {
color: #ffcc00 !important;
}
html[data-theme="dark"] h7, html[data-theme="dark"] h8, html[data-theme="dark"] h9 {
color: #ffcc00 !important;
}
html[data-theme="dark"] .wy-nav-content a, html[data-theme="dark"] .wy-nav-content a:visited {
color: #ffcc00 !important;
}
EOF
make DOCS_CSS=dark_override.css DOCS_THEME=sphinx_rtd_dark_mode htmldocs
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/90d316e055ef7f4c9021b9eada8f8d3b2e750a66.1638870323.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2021-12-07 10:53:02 +01:00
|
|
|
|
2022-11-08 12:57:07 +01:00
|
|
|
html_theme_options = {
|
2025-06-22 08:02:43 +02:00
|
|
|
"navigation_depth": -1,
|
2022-11-08 12:57:07 +01:00
|
|
|
}
|
|
|
|
|
2021-12-07 10:52:59 +01:00
|
|
|
except ImportError:
|
2025-06-22 08:02:43 +02:00
|
|
|
html_theme = "alabaster"
|
2021-12-07 10:52:59 +01:00
|
|
|
|
2021-12-07 10:53:00 +01:00
|
|
|
if "DOCS_CSS" in os.environ:
|
|
|
|
css = os.environ["DOCS_CSS"].split(" ")
|
|
|
|
|
|
|
|
for l in css:
|
|
|
|
html_css_files.append(l)
|
|
|
|
|
2025-06-22 08:02:43 +02:00
|
|
|
if html_theme == "alabaster":
|
2022-09-23 16:28:57 -06:00
|
|
|
html_theme_options = {
|
2025-06-22 08:02:43 +02:00
|
|
|
"description": get_cline_version(),
|
|
|
|
"page_width": "65em",
|
|
|
|
"sidebar_width": "15em",
|
|
|
|
"fixed_sidebar": "true",
|
|
|
|
"font_size": "inherit",
|
|
|
|
"font_family": "serif",
|
2022-09-23 16:28:57 -06:00
|
|
|
}
|
2021-12-07 10:53:01 +01:00
|
|
|
|
2021-12-07 10:52:59 +01:00
|
|
|
sys.stderr.write("Using %s theme\n" % html_theme)
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# Add any paths that contain custom static files (such as style sheets) here,
|
|
|
|
# relative to this directory. They are copied after the builtin static files,
|
|
|
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
2025-06-22 08:02:43 +02:00
|
|
|
html_static_path = ["sphinx-static"]
|
2016-07-03 10:05:28 +02:00
|
|
|
|
2023-04-20 09:34:35 -06:00
|
|
|
# If true, Docutils "smart quotes" will be used to convert quotes and dashes
|
2024-02-25 18:46:00 +09:00
|
|
|
# to typographically correct entities. However, conversion of "--" to "—"
|
|
|
|
# is not always what we want, so enable only quotes.
|
2025-06-22 08:02:43 +02:00
|
|
|
smartquotes_action = "q"
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# Custom sidebar templates, maps document names to template names.
|
2022-09-23 16:28:57 -06:00
|
|
|
# Note that the RTD theme ignores this
|
2025-06-22 08:02:43 +02:00
|
|
|
html_sidebars = {"**": ["searchbox.html",
|
|
|
|
"kernel-toc.html",
|
|
|
|
"sourcelink.html"]}
|
2023-01-10 18:47:25 +09:00
|
|
|
|
|
|
|
# about.html is available for alabaster theme. Add it at the front.
|
2025-06-22 08:02:43 +02:00
|
|
|
if html_theme == "alabaster":
|
|
|
|
html_sidebars["**"].insert(0, "about.html")
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
2023-10-29 08:42:07 +01:00
|
|
|
# The name of an image file (relative to this directory) to place at the top
|
|
|
|
# of the sidebar.
|
2025-06-22 08:02:43 +02:00
|
|
|
html_logo = "images/logo.svg"
|
2023-10-29 08:42:07 +01:00
|
|
|
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
# Output file base name for HTML help builder.
|
2025-06-22 08:02:43 +02:00
|
|
|
htmlhelp_basename = "TheLinuxKerneldoc"
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# -- Options for LaTeX output ---------------------------------------------
|
|
|
|
|
|
|
|
latex_elements = {
|
2021-03-03 16:58:00 +01:00
|
|
|
# The paper size ('letterpaper' or 'a4paper').
|
2025-06-22 08:02:43 +02:00
|
|
|
"papersize": "a4paper",
|
2021-03-03 16:58:00 +01:00
|
|
|
# The font size ('10pt', '11pt' or '12pt').
|
2025-06-22 08:02:43 +02:00
|
|
|
"pointsize": "11pt",
|
2021-03-03 16:58:00 +01:00
|
|
|
# Latex figure (float) alignment
|
2025-06-22 08:02:43 +02:00
|
|
|
# 'figure_align': 'htbp',
|
2021-03-03 16:58:00 +01:00
|
|
|
# Don't mangle with UTF-8 chars
|
2025-06-22 08:02:43 +02:00
|
|
|
"inputenc": "",
|
|
|
|
"utf8extra": "",
|
2021-03-03 16:58:00 +01:00
|
|
|
# Set document margins
|
2025-06-22 08:02:43 +02:00
|
|
|
"sphinxsetup": """
|
2021-03-03 16:58:00 +01:00
|
|
|
hmargin=0.5in, vmargin=1in,
|
|
|
|
parsedliteralwraps=true,
|
|
|
|
verbatimhintsturnover=false,
|
2025-06-22 08:02:43 +02:00
|
|
|
""",
|
2024-02-19 09:05:38 -07:00
|
|
|
#
|
|
|
|
# Some of our authors are fond of deep nesting; tell latex to
|
|
|
|
# cope.
|
|
|
|
#
|
2025-06-22 08:02:43 +02:00
|
|
|
"maxlistdepth": "10",
|
2021-08-09 10:23:57 +09:00
|
|
|
# For CJK One-half spacing, need to be in front of hyperref
|
2025-06-22 08:02:43 +02:00
|
|
|
"extrapackages": r"\usepackage{setspace}",
|
2021-03-03 16:58:00 +01:00
|
|
|
# Additional stuff for the LaTeX preamble.
|
2025-06-22 08:02:43 +02:00
|
|
|
"preamble": """
|
2021-03-03 16:58:00 +01:00
|
|
|
% Use some font with UTF-8 support with XeLaTeX
|
2017-09-03 16:12:46 -03:00
|
|
|
\\usepackage{fontspec}
|
2018-10-04 18:06:03 -07:00
|
|
|
\\setsansfont{DejaVu Sans}
|
|
|
|
\\setromanfont{DejaVu Serif}
|
2017-09-03 16:12:46 -03:00
|
|
|
\\setmonofont{DejaVu Sans Mono}
|
2025-06-22 08:02:43 +02:00
|
|
|
""",
|
2019-07-14 07:16:18 -03:00
|
|
|
}
|
2017-09-03 16:12:46 -03:00
|
|
|
|
2022-02-18 23:11:17 +09:00
|
|
|
# Load kerneldoc specific LaTeX settings
|
2025-06-22 08:02:43 +02:00
|
|
|
latex_elements["preamble"] += """
|
2022-02-18 23:11:17 +09:00
|
|
|
% Load kerneldoc specific LaTeX settings
|
2025-06-22 08:02:43 +02:00
|
|
|
\\input{kerneldoc-preamble.sty}
|
|
|
|
"""
|
2017-06-19 07:49:06 -03:00
|
|
|
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
# Grouping the document tree into LaTeX files. List of tuples
|
|
|
|
# (source start file, target name, title,
|
|
|
|
# author, documentclass [howto, manual, or own class]).
|
2017-05-12 06:02:12 -03:00
|
|
|
# Sorted in alphabetical order
|
2025-06-22 08:02:43 +02:00
|
|
|
latex_documents = []
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
2019-07-09 06:52:36 -03:00
|
|
|
# Add all other index files from Documentation/ subdirectories
|
2025-06-22 08:02:43 +02:00
|
|
|
for fn in os.listdir("."):
|
2019-07-09 06:52:36 -03:00
|
|
|
doc = os.path.join(fn, "index")
|
|
|
|
if os.path.exists(doc + ".rst"):
|
|
|
|
has = False
|
|
|
|
for l in latex_documents:
|
|
|
|
if l[0] == doc:
|
|
|
|
has = True
|
|
|
|
break
|
|
|
|
if not has:
|
2025-06-22 08:02:43 +02:00
|
|
|
latex_documents.append(
|
|
|
|
(
|
|
|
|
doc,
|
|
|
|
fn + ".tex",
|
|
|
|
"Linux %s Documentation" % fn.capitalize(),
|
|
|
|
"The kernel development community",
|
|
|
|
"manual",
|
|
|
|
)
|
|
|
|
)
|
2019-07-09 06:52:36 -03:00
|
|
|
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
# The name of an image file (relative to this directory) to place at the top of
|
|
|
|
# the title page.
|
2025-06-22 08:02:43 +02:00
|
|
|
# latex_logo = None
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# For "manual" documents, if this is true, then toplevel headings are parts,
|
|
|
|
# not chapters.
|
2025-06-22 08:02:43 +02:00
|
|
|
# latex_use_parts = False
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# If true, show page references after internal links.
|
2025-06-22 08:02:43 +02:00
|
|
|
# latex_show_pagerefs = False
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# If true, show URL addresses after external links.
|
2025-06-22 08:02:43 +02:00
|
|
|
# latex_show_urls = False
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# Documents to append as an appendix to all manuals.
|
2025-06-22 08:02:43 +02:00
|
|
|
# latex_appendices = []
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# If false, no module index is generated.
|
2025-06-22 08:02:43 +02:00
|
|
|
# latex_domain_indices = True
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
2022-02-18 23:11:17 +09:00
|
|
|
# Additional LaTeX stuff to be copied to build directory
|
|
|
|
latex_additional_files = [
|
2025-06-22 08:02:43 +02:00
|
|
|
"sphinx/kerneldoc-preamble.sty",
|
2022-02-18 23:11:17 +09:00
|
|
|
]
|
|
|
|
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# -- Options for manual page output ---------------------------------------
|
|
|
|
|
|
|
|
# One entry per manual page. List of tuples
|
|
|
|
# (source start file, name, description, authors, manual section).
|
|
|
|
man_pages = [
|
2025-06-22 08:02:43 +02:00
|
|
|
(master_doc, "thelinuxkernel", "The Linux Kernel Documentation", [author], 1)
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
# If true, show URL addresses after external links.
|
2025-06-22 08:02:43 +02:00
|
|
|
# man_show_urls = False
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
|
|
|
|
# -- Options for Texinfo output -------------------------------------------
|
|
|
|
|
|
|
|
# Grouping the document tree into Texinfo files. List of tuples
|
|
|
|
# (source start file, target name, title, author,
|
|
|
|
# dir menu entry, description, category)
|
2025-06-22 08:02:43 +02:00
|
|
|
texinfo_documents = [(
|
|
|
|
master_doc,
|
|
|
|
"TheLinuxKernel",
|
|
|
|
"The Linux Kernel Documentation",
|
|
|
|
author,
|
|
|
|
"TheLinuxKernel",
|
|
|
|
"One line description of project.",
|
|
|
|
"Miscellaneous",
|
|
|
|
),]
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
|
|
|
# -- Options for Epub output ----------------------------------------------
|
|
|
|
|
|
|
|
# Bibliographic Dublin Core info.
|
|
|
|
epub_title = project
|
|
|
|
epub_author = author
|
|
|
|
epub_publisher = author
|
|
|
|
epub_copyright = copyright
|
|
|
|
|
|
|
|
# A list of files that should not be packed into the epub file.
|
2025-06-22 08:02:43 +02:00
|
|
|
epub_exclude_files = ["search.html"]
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
|
2025-06-22 08:02:43 +02:00
|
|
|
# =======
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
# rst2pdf
|
|
|
|
#
|
|
|
|
# Grouping the document tree into PDF files. List of tuples
|
|
|
|
# (source start file, target name, title, author, options).
|
|
|
|
#
|
2020-05-26 08:05:44 +02:00
|
|
|
# See the Sphinx chapter of https://ralsina.me/static/manual.pdf
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
#
|
|
|
|
# FIXME: Do not add the index file here; the result will be too big. Adding
|
|
|
|
# multiple PDF files here actually tries to get the cross-referencing right
|
|
|
|
# *between* PDF files.
|
|
|
|
pdf_documents = [
|
2025-06-22 08:02:43 +02:00
|
|
|
("kernel-documentation", "Kernel", "Kernel", "J. Random Bozo"),
|
Documentation/sphinx: add basic working Sphinx configuration and build
Add basic configuration and makefile to build documentation from any
.rst files under Documentation using Sphinx. For starters, there's just
the placeholder index.rst.
At the top level Makefile, hook Sphinx documentation targets alongside
(but independent of) the DocBook toolchain, having both be run on the
various 'make *docs' targets.
All Sphinx processing is placed into Documentation/Makefile.sphinx. Both
that and the Documentation/DocBook/Makefile are now expected to handle
all the documentation targets, explicitly ignoring them if they're not
relevant for that particular toolchain. The changes to the existing
DocBook Makefile are kept minimal.
There is graceful handling of missing Sphinx and rst2pdf (which is
needed for pdf output) by checking for the tool and python module,
respectively, with informative messages to the user.
If the Read the Docs theme (sphinx_rtd_theme) is available, use it, but
otherwise gracefully fall back to the Sphinx default theme, with an
informative message to the user, and slightly less pretty HTML output.
Sphinx can now handle htmldocs, pdfdocs (if rst2pdf is available),
epubdocs and xmldocs targets. The output documents are written into per
output type subdirectories under Documentation/output.
Finally, you can pass options to sphinx-build using the SPHINXBUILD make
variable. For example, 'make SPHINXOPTS=-v htmldocs' for more verbose
output from Sphinx.
This is based on the original work by Jonathan Corbet, but he probably
wouldn't recognize this as his own anymore.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-05-19 15:14:05 +03:00
|
|
|
]
|
2016-05-20 11:51:47 +03:00
|
|
|
|
|
|
|
# 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.
|
2025-06-22 08:02:43 +02:00
|
|
|
kerneldoc_bin = "../scripts/kernel-doc.py"
|
|
|
|
kerneldoc_srctree = ".."
|
2016-08-13 16:12:42 +02:00
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Since loadConfig overwrites settings from the global namespace, it has to be
|
|
|
|
# the last statement in the conf.py file
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
loadConfig(globals())
|
2025-06-22 08:02:30 +02:00
|
|
|
|
2025-06-22 08:02:43 +02:00
|
|
|
|
2025-06-22 08:02:30 +02:00
|
|
|
def setup(app):
|
2025-06-22 08:02:43 +02:00
|
|
|
"""Patterns need to be updated at init time on older Sphinx versions"""
|
|
|
|
|
2025-06-22 08:02:30 +02:00
|
|
|
app.connect('config-inited', update_patterns)
|