Skip to content

Commit 8ae22da

Browse files
committed
Address comments
1 parent 595badc commit 8ae22da

File tree

1 file changed

+10
-21
lines changed

1 file changed

+10
-21
lines changed

docs/source/conf.py

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -76,28 +76,17 @@
7676

7777

7878
# The code below will cut version displayed in the dropdown like this:
79-
# tags like v0.1.0 = > 0.1
80-
# main will remain main
81-
# if not set will fail back to main
79+
# By default, set to "main".
80+
# If it's a tag like refs/tags/v1.2.3-rc4 or refs/tags/v1.2.3, then
81+
# cut to v1.2
8282
# the version varible is used in layout.html: https://github.com/pytorch/executorch/blob/main/docs/source/_templates/layout.html#L29
83-
if et_version_docs:
84-
if et_version_docs.startswith("refs/tags/v"):
85-
version = ".".join(
86-
et_version_docs.split("/")[-1].split("-")[0].lstrip("v").split(".")[:2]
87-
)
88-
print(f"Version: {version}")
89-
release = version
90-
html_title = " ".join((project, version, "documentation"))
91-
elif et_version_docs.startswith("refs/heads/"):
92-
version = et_version_docs.split("/")[-1]
93-
print(f"Version: {version}")
94-
release = version
95-
html_title = " ".join((project, version, "documentation"))
96-
else:
97-
version = "main"
98-
release = "main"
99-
html_title = " ".join((project, version, "documentation"))
100-
83+
version = release = "main"
84+
if et_version_docs.startswith("refs/tags/v"):
85+
version = ".".join(
86+
et_version_docs.split("/")[-1].split("-")[0].lstrip("v").split(".")[:2]
87+
)
88+
print(f"Version: {version}")
89+
html_title = " ".join((project, version, "documentation"))
10190

10291
breathe_projects = {"ExecuTorch": "../build/xml/"}
10392
breathe_default_project = "ExecuTorch"

0 commit comments

Comments
 (0)