|
76 | 76 | # and replace the values accordingly. |
77 | 77 | # See Doc/tools/extensions/patchlevel.py |
78 | 78 | version, release = get_version_info() |
| 79 | +v = get_header_version_info() |
| 80 | +branch = "main" if v.releaselevel == "alpha" else f"{v.major}.{v.minor}" |
79 | 81 |
|
80 | 82 | rst_epilog = f""" |
81 | 83 | .. |python_version_literal| replace:: ``Python {version}`` |
|
294 | 296 | "repository_url": repository_url or None, |
295 | 297 | "pr_id": os.getenv("READTHEDOCS_VERSION"), |
296 | 298 | "enable_analytics": os.getenv("PYTHON_DOCS_ENABLE_ANALYTICS"), |
| 299 | + "source_branch": branch, |
297 | 300 | } |
298 | 301 |
|
299 | 302 | # This 'Last updated on:' timestamp is inserted at the bottom of every page. |
|
303 | 306 | # Path to find HTML templates to override theme |
304 | 307 | templates_path = ['tools/templates'] |
305 | 308 |
|
| 309 | +# We link to sources on GitHub, so don't copy them into the HTML output. |
| 310 | +html_copy_source = False |
| 311 | + |
306 | 312 | # Custom sidebar templates, filenames relative to this file. |
307 | 313 | html_sidebars = { |
308 | 314 | # Defaults taken from https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_sidebars |
|
564 | 570 | # Options for sphinx.ext.extlinks |
565 | 571 | # ------------------------------- |
566 | 572 |
|
567 | | -v = get_header_version_info() |
568 | | -branch = "main" if v.releaselevel == "alpha" else f"{v.major}.{v.minor}" |
569 | | - |
570 | 573 | # This config is a dictionary of external sites, |
571 | 574 | # mapping unique short aliases to a base URL and a prefix. |
572 | 575 | # https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html |
|
0 commit comments