Skip to content

Commit bceac01

Browse files
authored
FIX: exit if non-html builder (#104)
1 parent 3053d2e commit bceac01

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sphinx_external_toc/events.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ def ensure_index_file(app: Sphinx, exception: Optional[Exception]) -> None:
333333
redirect_url = f"{root_name}.html"
334334
elif app.builder.name == "dirhtml":
335335
redirect_url = f"{root_name}/index.html"
336+
else:
337+
return
336338

337339
redirect_text = f'<meta http-equiv="Refresh" content="0; url={redirect_url}" />\n'
338340
index_path.write_text(redirect_text, encoding="utf8")

0 commit comments

Comments
 (0)