diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2023-01-13 10:35:26 -0600 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2023-01-13 10:35:26 -0600 |
commit | 40d92fc4fa81a93b4659b98512dcb9d0ccd94cfd (patch) | |
tree | a14587e30172e4efe427bd28c71d88ef9e12222b /Documentation | |
parent | 689968db7b6145b2e4beb8b472d31162ffa5ad7d (diff) | |
parent | a33ae832bf3f2ac33e2e44b99f76130d3be848c5 (diff) | |
download | linux-stable-40d92fc4fa81a93b4659b98512dcb9d0ccd94cfd.tar.gz linux-stable-40d92fc4fa81a93b4659b98512dcb9d0ccd94cfd.tar.bz2 linux-stable-40d92fc4fa81a93b4659b98512dcb9d0ccd94cfd.zip |
Merge tag 'docs-6.2-fixes' of git://git.lwn.net/linux
Pull documentation fixes from Jonathan Corbet:
"Three documentation fixes (or rather two and one warning):
- Sphinx 6.0 broke our configuration mechanism, so fix it
- I broke our configuration for non-Alabaster themes; Akira fixed it
- Deprecate Sphinx < 2.4 with an eye toward future removal"
* tag 'docs-6.2-fixes' of git://git.lwn.net/linux:
docs/conf.py: Use about.html only in sidebar of alabaster theme
docs: Deprecate use of Sphinx < 2.4.x
docs: Fix the docs build with Sphinx 6.0
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/conf.py | 12 | ||||
-rw-r--r-- | Documentation/sphinx/load_config.py | 6 |
2 files changed, 15 insertions, 3 deletions
diff --git a/Documentation/conf.py b/Documentation/conf.py index a5c45df0bd83..d927737e3c10 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -31,6 +31,12 @@ def have_command(cmd): # Get Sphinx version major, minor, patch = sphinx.version_info[:3] +# +# Warn about older versions that we don't want to support for much +# longer. +# +if (major < 2) or (major == 2 and minor < 4): + print('WARNING: support for Sphinx < 2.4 will be removed soon.') # 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 @@ -339,7 +345,11 @@ html_use_smartypants = False # Custom sidebar templates, maps document names to template names. # Note that the RTD theme ignores this -html_sidebars = { '**': ["about.html", 'searchbox.html', 'localtoc.html', 'sourcelink.html']} +html_sidebars = { '**': ['searchbox.html', 'localtoc.html', 'sourcelink.html']} + +# about.html is available for alabaster theme. Add it at the front. +if html_theme == 'alabaster': + html_sidebars['**'].insert(0, 'about.html') # Output file base name for HTML help builder. htmlhelp_basename = 'TheLinuxKerneldoc' diff --git a/Documentation/sphinx/load_config.py b/Documentation/sphinx/load_config.py index eeb394b39e2c..8b416bfd75ac 100644 --- a/Documentation/sphinx/load_config.py +++ b/Documentation/sphinx/load_config.py @@ -3,7 +3,7 @@ import os import sys -from sphinx.util.pycompat import execfile_ +from sphinx.util.osutil import fs_encoding # ------------------------------------------------------------------------------ def loadConfig(namespace): @@ -48,7 +48,9 @@ def loadConfig(namespace): sys.stdout.write("load additional sphinx-config: %s\n" % config_file) config = namespace.copy() config['__file__'] = config_file - execfile_(config_file, config) + with open(config_file, 'rb') as f: + code = compile(f.read(), fs_encoding, 'exec') + exec(code, config) del config['__file__'] namespace.update(config) else: |