|
76 | 76 |
|
77 | 77 |
|
78 | 78 | # 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 |
82 | 82 | # 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")) |
101 | 90 |
|
102 | 91 | breathe_projects = {"ExecuTorch": "../build/xml/"}
|
103 | 92 | breathe_default_project = "ExecuTorch"
|
|
0 commit comments