Skip to content

Commit d69dab7

Browse files
mchehabJonathan Corbet
authored andcommitted
docs: conf.py: fix support for Readthedocs v 1.0.0
As described at: https://stackoverflow.com/questions/23211695/modifying-content-width-of-the-sphinx-theme-read-the-docs since Sphinx 1.8, the standard way to setup a custom theme is to use html_css_files. While using html_context is OK with RTD 0.5.2, it doesn't work with 1.0.0, causing the theme to not load, producing a very weird html. Tested with: - Sphinx 1.7.9 + sphinx-rtd-theme 0.5.2 - Sphinx 2.4.4 + sphinx-rtd-theme 0.5.2 - Sphinx 2.4.4 + sphinx-rtd-theme 1.0.0 - Sphinx 4.3.0 + sphinx-rtd-theme 1.0.0 Reported-by: Hans Verkuil <[email protected]> Tested-by: Hans Verkuil <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Tested-by: Akira Yokosawa <[email protected]> Link: https://lore.kernel.org/r/80009f0d17ea0840d81e7e16fff6e7677919fdfc.1638004294.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet <[email protected]>
1 parent b96ff02 commit d69dab7

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Documentation/conf.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,16 @@
249249

250250
html_static_path = ['sphinx-static']
251251

252-
html_context = {
253-
'css_files': [
254-
'_static/theme_overrides.css',
255-
],
256-
}
252+
html_css_files = [
253+
'theme_overrides.css',
254+
]
255+
256+
if major <= 1 and minor < 8:
257+
html_context = {
258+
'css_files': [
259+
'_static/theme_overrides.css',
260+
],
261+
}
257262

258263
# Add any extra paths that contain custom files (such as robots.txt or
259264
# .htaccess) here, relative to this directory. These files are copied

0 commit comments

Comments
 (0)