From bceac0151c903252a4f5e2e86cac55599f706c21 Mon Sep 17 00:00:00 2001 From: Angus Hollands Date: Tue, 12 Dec 2023 10:01:15 +0000 Subject: [PATCH] FIX: exit if non-html builder (#104) --- sphinx_external_toc/events.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sphinx_external_toc/events.py b/sphinx_external_toc/events.py index dc57ea1..aa78fd6 100644 --- a/sphinx_external_toc/events.py +++ b/sphinx_external_toc/events.py @@ -333,6 +333,8 @@ def ensure_index_file(app: Sphinx, exception: Optional[Exception]) -> None: redirect_url = f"{root_name}.html" elif app.builder.name == "dirhtml": redirect_url = f"{root_name}/index.html" + else: + return redirect_text = f'\n' index_path.write_text(redirect_text, encoding="utf8")