Skip to content

Commit

Permalink
Add sphinx_rtd_theme to the list of extensions
Browse files Browse the repository at this point in the history
This fixes left menu not being expanded when anchor used:
readthedocs/sphinx_rtd_theme#1525
Also get rid of the old fallback and choose the theme explicitly.
  • Loading branch information
psss committed Sep 14, 2023
1 parent 3ff2507 commit e1e3de7
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,6 @@
import os
import sys

try:
# use bootstrap theme if user has it installed
import sphinx_bootstrap_theme
HTML_THEME = 'bootstrap'
html_theme_path = [sphinx_bootstrap_theme.get_html_theme_path()]
except ImportError:
try:
# fall back to sphinx_rtd_theme if available
import sphinx_rtd_theme
HTML_THEME = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
except ImportError:
# and fall back to 'default' if neither of those are available
HTML_THEME = 'default'

# 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.
Expand All @@ -45,6 +30,7 @@
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx_rtd_theme',
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -125,7 +111,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = HTML_THEME
html_theme = "sphinx_rtd_theme"

# 1.3.1 sphinx READTHEDOCS build compat
# SEE:
Expand Down

0 comments on commit e1e3de7

Please sign in to comment.