From b8fa27a4ce150314f33cb07fc393deafbd1aac45 Mon Sep 17 00:00:00 2001 From: WuHaobo Date: Fri, 10 Apr 2020 03:26:41 +0800 Subject: [PATCH] make readthedocs available --- docs/conf.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index f259ed202..57a91b8c8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -63,9 +63,11 @@ language = 'zh' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -import sphinx_rtd_theme -html_theme = "sphinx_rtd_theme" -html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] +on_rtd = os.environ.get('READTHEDOCS', None) == 'True' +if not on_rtd: + import sphinx_rtd_theme + html_theme = "sphinx_rtd_theme" + html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files,