docs: fix linkcheck

When running with the linkcheck builder,
app.builder.default_translator_class is None, making us throw an
exception and give up.

We don't need the bootstrap extension in this case, so just do nothing
instead.

Fixes: f72033bb70 ("docs: add bootstrap extension")
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25585>
This commit is contained in:
Erik Faye-Lund 2023-10-06 10:05:45 +02:00 committed by Marge Bot
parent 00f9e41251
commit d5c2139ce4

View file

@ -96,6 +96,9 @@ class BootstrapHTML5TranslatorMixin:
self.body.append(tag)
def setup_translators(app):
if app.builder.default_translator_class is None:
return
if not app.registry.translators.items():
translator = types.new_class(
"BootstrapHTML5Translator",