Commit 9966512a authored by Michal Čihař's avatar Michal Čihař

Be more flexible with theme for docs

- use default on RTD
- use alabaster if available
- fallback to default
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent dd807ff6
......@@ -15,8 +15,6 @@
import sys
import os
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
......@@ -107,10 +105,14 @@ pygments_style = 'sphinx'
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
if on_rtd:
if os.environ.get('READTHEDOCS', None) == 'True':
html_theme = 'default'
else:
html_theme = 'alabaster'
try:
import alabaster
html_theme = 'alabaster'
except ImportErrror:
html_theme = 'default'
# 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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment