Skip to content

Commit 3d35f27

Browse files
authored
docs: move to html_css_files as add_stylesheet is deprecated/removed (#581)
With Sphinx 4 the function `add_stylesheet()` was temporarily removed and added back in in newer versions of Sphinx. As alternative the `html_css_files` variable is mentioned, which is available since Sphinx 1.8. The `python3-sphinx` package with version `4.3.2-1` from Ubuntu 22.04 jammy doesn't have the `add_stylesheet()` API, which breaks documentation generation on said platform. sphinx-doc/sphinx#9683 (comment)
1 parent 3eed33d commit 3d35f27

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Diff for: docs/conf.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,12 @@ def _warn_node(self, msg, node, **kwargs):
169169

170170
# Add custom .css files
171171
# https://github.com/snide/sphinx_rtd_theme/issues/117#issuecomment-41571653
172-
def setup(app):
173-
app.add_stylesheet("custom.css")
174-
app.add_stylesheet("rtfd-css.css")
172+
# 2022-06-22: move to `html_css_files` as `add_stylesheet` is deprecated/removed
173+
# https://github.com/sphinx-doc/sphinx/issues/9683#issuecomment-932878909
174+
html_css_files = [
175+
"custom.css",
176+
"rtfd-css.css",
177+
]
175178

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

0 commit comments

Comments
 (0)