docs: fix bootstrap-extension

We shouldn't use this extension at all if we're not using the HTML
builder. This should hopefully fix this issue a bit more fundamentally.

This caused issues when using the spelling extension, something I do
locally from time to time.

Fixes: f72033bb70 ("docs: add bootstrap extension")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29888>
This commit is contained in:
Erik Faye-Lund 2024-06-24 18:40:22 +02:00 committed by Marge Bot
parent 18db05d3e6
commit f4e7204e73

View File

@ -96,7 +96,7 @@ class BootstrapHTML5TranslatorMixin:
self.body.append(tag)
def setup_translators(app):
if app.builder.default_translator_class is None:
if app.builder.format != "html":
return
if not app.registry.translators.items():
@ -111,10 +111,6 @@ def setup_translators(app):
app.set_translator(app.builder.name, translator, override=True)
else:
for name, klass in app.registry.translators.items():
if app.builder.format != "html":
# Skip translators that are not HTML
continue
translator = types.new_class(
"BootstrapHTML5Translator",
(