Skip to content

Commit

Permalink
conf: Add sphinx_rtd_theme to extensions, remove env based import
Browse files Browse the repository at this point in the history
The RTD build failed with "NameError: name 'html_theme' is notdefined".

Remove the conditional import and align to what Spicy and the
sphinx_rtd_theme docs [1] indicate should be done.

[1] https://sphinx-rtd-theme.readthedocs.io/en/stable/installing.html
  • Loading branch information
awelzel committed Aug 24, 2023
1 parent cc5db09 commit c267e69
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions += ['zeek', 'sphinx.ext.todo', 'zeek_pygments', 'literal-emph']
extensions += ['sphinx.ext.extlinks']
extensions += ['sphinx_rtd_theme']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down Expand Up @@ -141,15 +142,7 @@

# -- Options for HTML output ---------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if not on_rtd:
# only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_theme = 'sphinx_rtd_theme'

html_last_updated_fmt = '%B %d, %Y'

Expand Down

0 comments on commit c267e69

Please sign in to comment.