Skip to content

Commit 84c5ca5

Browse files
ujfalusilgirdwood
authored andcommitted
conf.py: Add support for sphinx 4.0+
add_stylesheet is removed with sphinx 4.0 and this will cause error in conf.py Fix it by trying to use the new add_css_file introduced in 1.8 and fall back to add_stylesheet for older sphinx version. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent 2ee4722 commit 84c5ca5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

conf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,10 @@
185185
def setup(app):
186186
# add_stylesheet() was renamed to add_css_file() in sphinx 1.8 released
187187
# in September 2018. add_stylesheet() will be removed in sphinx 4.0
188-
app.add_stylesheet("sof-custom.css")
188+
try:
189+
app.add_css_file('sof-custom.css')
190+
except AttributeError:
191+
app.add_stylesheet('sof-custom.css')
189192

190193
# Custom sidebar templates, must be a dictionary that maps document names
191194
# to template names.

0 commit comments

Comments
 (0)