From f4e7204e7381f29b4eaa2a79f7fd92e7ceb7fe42 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 24 Jun 2024 18:40:22 +0200 Subject: [PATCH] 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: f72033bb707 ("docs: add bootstrap extension") Part-of: --- docs/_exts/bootstrap.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/_exts/bootstrap.py b/docs/_exts/bootstrap.py index bb0e595c4d1..18e46cea160 100644 --- a/docs/_exts/bootstrap.py +++ b/docs/_exts/bootstrap.py @@ -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", (