Skip to content

Commit

Permalink
compatibility with sphinx 7.3 (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism authored Apr 19, 2024
2 parents e365b9a + 437e078 commit 9a2e766
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Unreleased

- Use modern packaging metadata with ``pyproject.toml`` instead of ``setup.cfg``.
- Use ``flit_core`` instead of ``setuptools`` as build backend.
- Compatibility with changes in Sphinx 7.3. :pr:`100`


Version 2.1.1
Expand Down
14 changes: 7 additions & 7 deletions src/pallets_sphinx_themes/theme_check.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from functools import wraps

from sphinx.theming import HTMLThemeFactory


def set_is_pallets_theme(app):
"""Set the ``is_pallets_theme`` config to ``True`` if the current
Expand All @@ -10,14 +12,12 @@ def set_is_pallets_theme(app):

theme = getattr(app.builder, "theme", None)

while theme is not None:
if theme.name == "pocoo":
app.config.is_pallets_theme = True
break

theme = theme.base
else:
if theme is None:
app.config.is_pallets_theme = False
return

pocoo_dir = HTMLThemeFactory(app).create("pocoo").get_theme_dirs()[0]
app.config.is_pallets_theme = pocoo_dir in theme.get_theme_dirs()


def only_pallets_theme(default=None):
Expand Down

0 comments on commit 9a2e766

Please sign in to comment.