From e28557d2f0e99f4de4b4c8605b443770a3340f85 Mon Sep 17 00:00:00 2001 From: Michael Banck Date: Thu, 7 Oct 2021 16:07:41 +0200 Subject: [PATCH] Fix sphinx build. (#2080) Sphinx' add_stylesheet() has been deprecated for a long time and got removed in recent versions of sphinx. If available, use add_css_file() instead. Close #2079. --- docs/conf.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 20fa354c..ae19400c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -194,4 +194,7 @@ intersphinx_mapping = {'https://docs.python.org/': None} # A possibility to have an own stylesheet, to add new rules or override existing ones # For the latter case, the CSS specificity of the rules should be higher than the default ones def setup(app): - app.add_stylesheet("custom.css") + if hasattr(app, 'add_css_file'): + app.add_css_file('custom.css') + else: + app.add_stylesheet('custom.css')