File tree Expand file tree Collapse file tree
src/pallets_sphinx_themes Expand file tree Collapse file tree Original file line number Diff line number Diff 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
1011Version 2.1.1
Original file line number Diff line number Diff line change 11from functools import wraps
22
3+ from sphinx .theming import HTMLThemeFactory
4+
35
46def 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
2323def only_pallets_theme (default = None ):
You can’t perform that action at this time.
0 commit comments