Skip to content

Commit ee67c82

Browse files
committed
docs(conf): Add typed fix for syncing of tabs
See also: pradyunsg/sphinx-inline-tabs#18 (comment)
1 parent 9307424 commit ee67c82

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/conf.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
from pathlib import Path
88

99
import gp_libs
10+
1011
import linkify_issues
1112

13+
if t.TYPE_CHECKING:
14+
from sphinx.application import Sphinx
15+
1216
# Get the project root dir, which is the parent dir of this
1317
cwd = Path(__file__).parent
1418
project_root = cwd.parent
@@ -240,3 +244,14 @@ def linkcode_resolve(
240244
fn,
241245
linespec,
242246
)
247+
248+
249+
def remove_tabs_js(app: "Sphinx", exc: Exception) -> None:
250+
# Fix for sphinx-inline-tabs#18
251+
if app.builder.format == "html" and not exc:
252+
tabs_js = Path(app.builder.outdir) / "_static" / "tabs.js"
253+
tabs_js.unlink()
254+
255+
256+
def setup(app: "Sphinx") -> None:
257+
app.connect("build-finished", remove_tabs_js)

0 commit comments

Comments
 (0)