doc: fix sphinx compatibility
authorThomas Monjalon <thomas@monjalon.net>
Wed, 8 Apr 2020 08:09:23 +0000 (10:09 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 15 Apr 2020 13:21:06 +0000 (15:21 +0200)
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().

Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
doc/guides/conf.py

index c368fa5..08dcfcf 100644 (file)
@@ -415,4 +415,8 @@ 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:
+        # New function in sphinx 1.8
+        app.add_css_file('css/custom.css')
+    except:
+        app.add_stylesheet('css/custom.css')