Skip to content

Commit b67f00e

Browse files
committed
[no ci] docs: minor fixes to render v1.1.6 docs
1 parent 4a0bb52 commit b67f00e

File tree

3 files changed

+18
-36
lines changed

3 files changed

+18
-36
lines changed

docsrc/poly.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
BRANCH_REGEX = r"^(dev)$"
2222

2323
#: Regex matching the tags to build docs for
24-
# TAG_REGEX = r"^v(1\.1\.6|(?!1\.)[\.0-9]*)$"
25-
TAG_REGEX = r""
24+
TAG_REGEX = r"^v(1\.1\.6|(?!1\.)[\.0-9]*)$"
25+
# TAG_REGEX = r""
2626

2727
#: Output dir relative to project root
2828
OUTPUT_DIR = "_build_polyversion"

docsrc/pre-build.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,28 @@ def patch_conf(sourcedir):
5050
root = Git.root(Path(__file__).parent)
5151
else:
5252
root = str(Path(os.path.abspath(sourcedir)).parent.parent)
53-
cursrc = os.path.join(root, "docsrc", "source")
53+
sourcedir = Path(sourcedir)
54+
cursrc = Path(root) / "docsrc" / "source"
5455
if os.path.abspath(cursrc) == os.path.abspath(sourcedir):
5556
return
5657
# copy the configuration file: shared for all versions
57-
conf_src = os.path.join(cursrc, "conf.py")
58-
conf_dst = os.path.join(sourcedir, "conf.py")
59-
if os.path.exists(conf_src):
58+
conf_src = Path(cursrc) / "conf.py"
59+
conf_dst = Path(sourcedir) / "conf.py"
60+
if conf_src.exists():
6061
logger.info("Overwriting old conf.py with current conf.py")
6162
shutil.copy2(conf_src, conf_dst)
6263
# copy HTML and CSS for versioning sidebar
63-
versioning_src = os.path.join(cursrc, "_templates", "versioning.html")
64-
versioning_dst = os.path.join(sourcedir, "_templates", "versioning.html")
65-
if os.path.exists(versioning_src):
66-
os.makedirs(os.path.join(sourcedir, "_templates"), exist_ok=True)
67-
shutil.copy2(versioning_src, versioning_dst)
68-
css_src = os.path.join(cursrc, "_static", "custom.css")
69-
css_dst = os.path.join(sourcedir, "_static", "custom.css")
70-
if os.path.exists(css_src):
71-
os.makedirs(os.path.join(sourcedir, "_static"), exist_ok=True)
72-
shutil.copy2(css_src, css_dst)
64+
copy_rel_paths = [
65+
"_static/bayesflow_hor_dark.png",
66+
"_static/bayesflow_hor.png",
67+
"_static/custom.css",
68+
]
69+
for path in copy_rel_paths:
70+
srcfile = cursrc / path
71+
dstfile = sourcedir / path
72+
if srcfile.exists():
73+
os.makedirs(dstfile.parent, exist_ok=True)
74+
shutil.copy2(srcfile, dstfile)
7375

7476

7577
if __name__ == "__main__":

docsrc/source/_templates/versioning.html

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)