Skip to content

Commit 893f466

Browse files
committed
Do not add HTML mixin if not building html
1 parent 4274105 commit 893f466

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/pydata_sphinx_theme/translator.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ def setup_translators(app: Sphinx):
8383
behavior and configuration, and _only_ add the extra bootstrap rules.
8484
If we don't detect an HTML-based translator, then we do nothing.
8585
"""
86+
87+
# Do not add the mixin if the builder format is not HTML:
88+
if app.builder.format != "html":
89+
return
90+
8691
if not app.registry.translators.items():
8792
try:
8893
default_translator_class = app.builder.default_translator_class
@@ -101,10 +106,6 @@ def setup_translators(app: Sphinx):
101106
app.set_translator(app.builder.name, translator, override=True)
102107
else:
103108
for name, klass in app.registry.translators.items():
104-
if app.builder.format != "html":
105-
# Skip translators that are not HTML
106-
continue
107-
108109
translator = types.new_class(
109110
"BootstrapHTML5Translator",
110111
(

0 commit comments

Comments
 (0)