Skip to contentSkip to conversation

doc: fix sphinx compatibility

PATCH Applied Thomas Monjalon 1 participant 2 messages Apr 9, 2020 – Apr 16, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc: fix sphinx compatibility

The function add_stylesheet() is deprecated since sphinx 1.8. It will be removed in sphinx 4.0.
It is replaced by add_css_file().

---
 doc/guides/conf.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
doc/guides/conf.py +4 -1
index c368fa51d4..6974f0fd2f 100644
@@ -415,4 +415,7 @@ def setup(app):
         # Process the numref references once the doctree has been created.
         app.connect('doctree-resolved', process_numref)
 
-    app.add_stylesheet('css/custom.css')
+    try:
+        app.add_css_file('css/custom.css')
+    except:
+        app.add_stylesheet('css/custom.css')
Signature · 1 line
2.26.0