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