Skip to content

Commit ddc3f94

Browse files
committed
Update the Sphinx configuration to use the ReadTheDocs theme
1 parent 0c2f7fd commit ddc3f94

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

conf.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@
2222
# documentation root, use os.path.abspath to make it absolute, like shown here.
2323
#sys.path.insert(0, os.path.abspath('.'))
2424

25+
# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
26+
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
27+
28+
if not on_rtd: # only import and set the theme if we're building docs locally
29+
import sphinx_rtd_theme
30+
html_theme = 'sphinx_rtd_theme'
31+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
32+
33+
# otherwise, readthedocs.org uses their theme by default, so no need to specify it
34+
2535
# -- General configuration -----------------------------------------------------
2636

2737
# If your documentation needs a minimal Sphinx version, state it here.
@@ -95,10 +105,6 @@
95105

96106
# -- Options for HTML output ---------------------------------------------------
97107

98-
# The theme to use for HTML and HTML Help pages. See the documentation for
99-
# a list of builtin themes.
100-
html_theme = 'sphinxdoc'
101-
102108
# Theme options are theme-specific and customize the look and feel of a theme
103109
# further. For a list of options available for each theme, see the
104110
# documentation.

0 commit comments

Comments
 (0)