Skip to content

gh-157517: Docs: don't copy HTML sources, fix sidebar sources links - #157522

Merged
StanFromIreland merged 5 commits into
python:mainfrom
m-aciek:doc-html-dont-copy-source
Sep 15, 2026
Merged

StanFromIreland merged 5 commits into
python:mainfrom
m-aciek:doc-html-dont-copy-source

Conversation

@m-aciek

@m-aciek m-aciek commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Closes #157517.

  • Saving ~13MB on every HTML build. (html_copy_source = False)
  • Previously source link was always pointing at main even for older documentation versions. Fix.
  • Fix translation source links for projects with subtags, like pt-br.
  • Hide translation source link on main (/dev/ URL). This way we avoid exposing a new variable in docsbuild-scripts or extra logic just for this link correctness.
  • Translation links may in rare cases lead to 404 (when translation team falls behind), they fallback to latest available version when docs version is unavailable, but we don't introduce a new variable in docsbuild-scripts. The implementation serves correctly ~90% of cases.

@chatgpt-codex-connector

This comment was marked as resolved.

@m-aciek m-aciek changed the title gh-157571: Docs: don't copy HTML sources, fix sidebar sources links gh-157517: Docs: don't copy HTML sources, fix sidebar sources links Sep 14, 2026
@StanFromIreland

Copy link
Copy Markdown
Member

You'll have to update your branch to fix the CI.

@m-aciek

m-aciek commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, merged main.

Comment thread Doc/conf.py Outdated
Co-authored-by: Stan Ulbrych <stan@python.org>
@read-the-docs-community

read-the-docs-community Bot commented Sep 14, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #34570101 | 📁 Comparing 3d52181 against main (c215919)

  🔍 Preview build  

3 files changed
± c-api/bytearray.html
± c-api/bytes.html
± whatsnew/changelog.html

Simplification, there's no need to rely on html_show_sourcelink Sphinx configuration

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hugovk hugovk added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Sep 15, 2026

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@StanFromIreland
StanFromIreland merged commit 5601e1e into python:main Sep 15, 2026
40 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @m-aciek for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Sep 15, 2026
@bedevere-app

bedevere-app Bot commented Sep 15, 2026

Copy link
Copy Markdown

GH-157567 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Sep 15, 2026
@miss-islington-app

Copy link
Copy Markdown

Sorry, @m-aciek and @StanFromIreland, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 5601e1ec3b5b4b94f189f8a457eea445cda6be45 3.13

@bedevere-app

bedevere-app Bot commented Sep 15, 2026

Copy link
Copy Markdown

GH-157568 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Sep 15, 2026
hugovk pushed a commit that referenced this pull request Sep 15, 2026
…ks in docs builds (GH-157522) (#157567)

Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
hugovk pushed a commit that referenced this pull request Sep 15, 2026
…ks in docs builds (GH-157522) (#157568)

Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
@bedevere-app

bedevere-app Bot commented Sep 15, 2026

Copy link
Copy Markdown

GH-157570 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Sep 15, 2026
StanFromIreland added a commit that referenced this pull request Sep 15, 2026
…ks in docs builds (GH-157522) (#157570)

(cherry picked from commit 5601e1e)

Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Docs: avoid copying documentation sources into HTML builds and fix sidebar source links

3 participants