Skip to content

Commit

Permalink
docs: Use html_style property instead of add_stylesheet()
Browse files Browse the repository at this point in the history
add_stylesheet() is deprecated since Sphinx 1.8

Fix this build error on Sphinx 1.8 or higher

Exception occurred:
  File "docs/source/conf.py", line 137, in setup
    app.add_stylesheet('css/custom.css')
AttributeError: 'Sphinx' object has no attribute 'add_stylesheet'

Signed-off-by: Justin Yang <justin.yang@themedium.io>
  • Loading branch information
justin-themedium authored and ryjones committed Oct 6, 2021
1 parent 6656f72 commit 7d51df1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ Pygments==2.1.3
pytz==2016.4
six==1.10.0
snowballstemmer==1.2.1
Sphinx==1.7.2
sphinx-rtd-theme==0.2.5b2
Sphinx==1.8.0
sphinx-rtd-theme==0.4.2
recommonmark==0.4.0
3 changes: 2 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

html_style = 'css/custom.css'

def placeholderReplace(app, docname, source):
result = source[0]
for key in app.config.placeholder_replacements:
Expand All @@ -134,7 +136,6 @@ def placeholderReplace(app, docname, source):


def setup(app):
app.add_stylesheet('css/custom.css')
app.add_config_value('placeholder_replacements', {}, True)
app.connect('source-read', placeholderReplace)

Expand Down

0 comments on commit 7d51df1

Please sign in to comment.