提交 d69dab7d 编写于 作者: M Mauro Carvalho Chehab 提交者: Jonathan Corbet

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: NHans Verkuil <hverkuil@xs4all.nl>
Tested-by: NHans Verkuil <hverkuil@xs4all.nl>
Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tested-by: NAkira Yokosawa <akiyks@gmail.com>
Link: https://lore.kernel.org/r/80009f0d17ea0840d81e7e16fff6e7677919fdfc.1638004294.git.mchehab+huawei@kernel.orgSigned-off-by: NJonathan Corbet <corbet@lwn.net>
上级 b96ff02a
...@@ -249,11 +249,16 @@ except ImportError: ...@@ -249,11 +249,16 @@ except ImportError:
html_static_path = ['sphinx-static'] html_static_path = ['sphinx-static']
html_context = { html_css_files = [
'css_files': [ 'theme_overrides.css',
'_static/theme_overrides.css', ]
],
} if major <= 1 and minor < 8:
html_context = {
'css_files': [
'_static/theme_overrides.css',
],
}
# Add any extra paths that contain custom files (such as robots.txt or # Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied # .htaccess) here, relative to this directory. These files are copied
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册