Skip to content

Commit 9a2e766

Browse files
authored
compatibility with sphinx 7.3 (#100)
2 parents e365b9a + 437e078 commit 9a2e766

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Unreleased
55

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

910

1011
Version 2.1.1

src/pallets_sphinx_themes/theme_check.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from functools import wraps
22

3+
from sphinx.theming import HTMLThemeFactory
4+
35

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

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

13-
while theme is not None:
14-
if theme.name == "pocoo":
15-
app.config.is_pallets_theme = True
16-
break
17-
18-
theme = theme.base
19-
else:
15+
if theme is None:
2016
app.config.is_pallets_theme = False
17+
return
18+
19+
pocoo_dir = HTMLThemeFactory(app).create("pocoo").get_theme_dirs()[0]
20+
app.config.is_pallets_theme = pocoo_dir in theme.get_theme_dirs()
2121

2222

2323
def only_pallets_theme(default=None):

0 commit comments

Comments
 (0)