From 7d51df1ffbfd99d6bae7899f84bc36c6d082c1f2 Mon Sep 17 00:00:00 2001 From: Justin Yang Date: Fri, 24 Sep 2021 09:39:15 +0900 Subject: [PATCH] docs: Use html_style property instead of add_stylesheet() 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 --- docs/requirements.txt | 4 ++-- docs/source/conf.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index e798ba74e68..cc1e9570cc7 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -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 diff --git a/docs/source/conf.py b/docs/source/conf.py index f10e6cf0dbf..7433a765158 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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: @@ -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)