From 5abeb9fc962aee61eda02e0c75e872004635e9d5 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Sat, 9 Sep 2023 22:54:10 +0100 Subject: [PATCH] Fix the check for HTML builders This makes it possible to use Furo with all HTML builder setups. --- src/furo/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/furo/__init__.py b/src/furo/__init__.py index 17c2bfbc..665c9312 100644 --- a/src/furo/__init__.py +++ b/src/furo/__init__.py @@ -231,10 +231,10 @@ def _builder_inited(app: sphinx.application.Sphinx) -> None: "and specifying it as an `html_theme` is sufficient." ) - if not isinstance(app.builder, StandaloneHTMLBuilder) or app.builder.name not in { - "html", - "dirhtml", - }: + looks_like_html_builder = isinstance(app.builder, StandaloneHTMLBuilder) or ( + app.builder.name in {"html", "dirhtml"} + ) + if not looks_like_html_builder: raise ConfigError( "Furo is being used as an extension in a non-HTML build. " "This should not happen."