From b8a9f2f228c5c706b7524b0941be15c766320aff Mon Sep 17 00:00:00 2001 From: David Adam Date: Tue, 26 Nov 2019 18:17:20 +0800 Subject: [PATCH] docs: restore compatibility with Sphinx < 1.8.0 --- sphinx_doc_src/conf.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sphinx_doc_src/conf.py b/sphinx_doc_src/conf.py index dc06c190d..a83dee80a 100644 --- a/sphinx_doc_src/conf.py +++ b/sphinx_doc_src/conf.py @@ -29,7 +29,11 @@ def setup(app): os.path.join(this_dir, "fish_indent_lexer.py"), lexername="FishIndentLexer" ) lexers["fish-docs-samples"] = fish_indent_lexer - app.add_css_file("custom.css") + # add_css_file only appears in Sphinx 1.8.0 + if hasattr(app, "add_css_file"): + app.add_css_file("custom.css") + else: + app.add_stylesheet("custom.css") # The default language to assume