|
24 | 24 | author = "ANSYS, Inc." |
25 | 25 | release = version = __version__ |
26 | 26 | cname = os.getenv("DOCUMENTATION_CNAME", default="nocname.com") |
| 27 | +switcher_version = get_version_match(__version__) |
| 28 | +docs_prefix = switcher_version if switcher_version == "dev" else f"release/{switcher_version}" |
27 | 29 |
|
28 | 30 | # Select desired logo, theme, and declare the html title |
29 | 31 | html_logo = pyansys_logo_black |
|
40 | 42 | html_theme_options = { |
41 | 43 | "switcher": { |
42 | 44 | "json_url": f"https://{cname}/release/versions.json", |
43 | | - "version_match": get_version_match(__version__), |
| 45 | + "version_match": switcher_version, |
44 | 46 | }, |
45 | 47 | "navbar_end": ["version-switcher", "theme-switcher", "navbar-icon-links"], |
46 | 48 | "github_url": "https://github.com/pyansys/pygeometry", |
|
167 | 169 |
|
168 | 170 | .. admonition:: Download this example! |
169 | 171 |
|
170 | | - Download this example from this |
171 | | - `link <https://geometry.docs.pyansys.com/{{ env.docname }}.ipynb>`_. |
| 172 | + Download this example as a Jupyter Notebook from |
| 173 | + `here <{cname_pref}/{ipynb_file_loc}>`_. |
| 174 | +
|
| 175 | +""".format( |
| 176 | + cname_pref=f"https://{cname}/{docs_prefix}", ipynb_file_loc="{{ env.docname }}.ipynb" |
| 177 | +) |
172 | 178 |
|
173 | | -""" |
174 | 179 | nbsphinx_prolog = """ |
175 | 180 |
|
176 | 181 | .. admonition:: Download this example! |
177 | 182 |
|
178 | | - Download this example from this |
179 | | - `link <https://geometry.docs.pyansys.com/{{ env.docname }}.ipynb>`_. |
| 183 | + Download this example as a Jupyter Notebook from |
| 184 | + `here <{cname_pref}/{ipynb_file_loc}>`_. |
180 | 185 |
|
181 | 186 | ---- |
182 | | -""" |
| 187 | +""".format( |
| 188 | + cname_pref=f"https://{cname}/{docs_prefix}", ipynb_file_loc="{{ env.docname }}.ipynb" |
| 189 | +) |
183 | 190 |
|
184 | 191 | typehints_defaults = "comma" |
185 | 192 | simplify_optional_unions = False |
|
0 commit comments