Skip to content

Commit 2ecfedf

Browse files
committed
Fix readthedocs building theme selection. [skip ci]
It appears that the html_theme variable is now mandatory. Replace the two different theme setting approaches and their surrounding *if on readthedocs* logic with something that works everywhere.
1 parent dcb2b17 commit 2ecfedf

1 file changed

Lines changed: 7 additions & 16 deletions

File tree

‎doc/conf.py‎

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -173,22 +173,13 @@
173173
# The theme to use for HTML and HTML Help pages. See the documentation for
174174
# a list of builtin themes.
175175

176-
if not on_rtd: # only import and set the theme if we're building docs locally
177-
import sphinx_rtd_theme
178-
179-
html_theme = 'sphinx_rtd_theme'
180-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
181-
html_style = 'css/pyinstaller.css'
182-
else:
183-
# RTD adds some defaults to conf.py which make it behave
184-
# differently. So we need a different way to specify our css.
185-
html_context = {
186-
'css_files': [
187-
'https://media.readthedocs.org/css/sphinx_rtd_theme.css',
188-
'https://media.readthedocs.org/css/readthedocs-doc-embed.css',
189-
'_static/css/pyinstaller.css',
190-
],
191-
}
176+
import sphinx_rtd_theme
177+
html_theme = 'sphinx_rtd_theme'
178+
179+
180+
def setup(app):
181+
app.add_css_file('css/pyinstaller.css')
182+
192183

193184
# Theme options are theme-specific and customize the look and feel of a theme
194185
# further. For a list of options available for each theme, see the

0 commit comments

Comments
 (0)