Skip to content

Commit 40d92fc

Browse files
committed
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
2 parents 689968d + a33ae83 commit 40d92fc

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

Documentation/conf.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ def have_command(cmd):
3131
# Get Sphinx version
3232
major, minor, patch = sphinx.version_info[:3]
3333

34+
#
35+
# Warn about older versions that we don't want to support for much
36+
# longer.
37+
#
38+
if (major < 2) or (major == 2 and minor < 4):
39+
print('WARNING: support for Sphinx < 2.4 will be removed soon.')
3440

3541
# If extensions (or modules to document with autodoc) are in another directory,
3642
# add these directories to sys.path here. If the directory is relative to the
@@ -339,7 +345,11 @@ def get_cline_version():
339345

340346
# Custom sidebar templates, maps document names to template names.
341347
# Note that the RTD theme ignores this
342-
html_sidebars = { '**': ["about.html", 'searchbox.html', 'localtoc.html', 'sourcelink.html']}
348+
html_sidebars = { '**': ['searchbox.html', 'localtoc.html', 'sourcelink.html']}
349+
350+
# about.html is available for alabaster theme. Add it at the front.
351+
if html_theme == 'alabaster':
352+
html_sidebars['**'].insert(0, 'about.html')
343353

344354
# Output file base name for HTML help builder.
345355
htmlhelp_basename = 'TheLinuxKerneldoc'

Documentation/sphinx/load_config.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import os
55
import sys
6-
from sphinx.util.pycompat import execfile_
6+
from sphinx.util.osutil import fs_encoding
77

88
# ------------------------------------------------------------------------------
99
def loadConfig(namespace):
@@ -48,7 +48,9 @@ def loadConfig(namespace):
4848
sys.stdout.write("load additional sphinx-config: %s\n" % config_file)
4949
config = namespace.copy()
5050
config['__file__'] = config_file
51-
execfile_(config_file, config)
51+
with open(config_file, 'rb') as f:
52+
code = compile(f.read(), fs_encoding, 'exec')
53+
exec(code, config)
5254
del config['__file__']
5355
namespace.update(config)
5456
else:

0 commit comments

Comments
 (0)