Skip to content

Commit 2c04a31

Browse files
committed
chore: Add typed remove_tabs_js fix for inline-tabs
1 parent f5b4fe4 commit 2c04a31

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/conf.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
import vcspull
1010

11+
if t.TYPE_CHECKING:
12+
from sphinx.application import Sphinx
13+
1114
# Get the project root dir, which is the parent dir of this
1215
cwd = Path.cwd()
1316
project_root = cwd.parent
@@ -250,3 +253,14 @@ def linkcode_resolve(
250253
fn,
251254
linespec,
252255
)
256+
257+
258+
def remove_tabs_js(app: "Sphinx", exc: Exception) -> None:
259+
# Fix for sphinx-inline-tabs#18
260+
if app.builder.format == "html" and not exc:
261+
tabs_js = Path(app.builder.outdir) / "_static" / "tabs.js"
262+
tabs_js.unlink()
263+
264+
265+
def setup(app: "Sphinx") -> None:
266+
app.connect("build-finished", remove_tabs_js)

0 commit comments

Comments
 (0)