Fall back to classic theme if rtd_theme not available

This commit is contained in:
Ammar Askar 2015-04-02 21:06:59 +05:00
parent c34d30566f
commit c1b3beab11

View File

@ -119,11 +119,16 @@ todo_include_todos = True
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
# Use RTD theme even when compiling locally.
# Attempt to use RTD theme even when compiling locally.
if os.environ.get("READTHEDOCS", "") != "True":
import sphinx_rtd_theme
try:
import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
except ImportError:
html_theme = "classic"
else:
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the