Skip to content

Commit

Permalink
docs: clean apidocs before building each tag
Browse files Browse the repository at this point in the history
  • Loading branch information
dbhart committed Oct 4, 2024
1 parent f2a1a82 commit cbadc37
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions docs/build_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
}
]

subprocess.run(
["sphinx-build", "-b", "html", ".", os.path.join("_build", "html")], shell=True
)

for tag in tags:
versions.append(
dict(
Expand All @@ -37,6 +33,17 @@
preferred=False,
)
)

with open(os.path.join("_static", "switcher.json"), "w") as fswitch:
json.dump(versions, fswitch)

subprocess.run(
["sphinx-build", "-b", "html", ".", os.path.join("_build", "html")], shell=True
)

os.remove(os.path.join("_static", "switcher.json"))

for tag in tags:
os.environ["VERSION_INFO"] = repr(tag)
subprocess.run(["git", "checkout", tag], shell=True)
files = glob.glob("apidocs/*.rst")
Expand All @@ -46,6 +53,3 @@
["sphinx-build", "-b", "html", ".", os.path.join("_build", "html", tag)],
shell=True,
)

with open(os.path.join("_build", "html", "_static", "switcher.json"), "w") as fswitch:
json.dump(versions, fswitch)

0 comments on commit cbadc37

Please sign in to comment.