Skip to content

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

Description

@m-aciek

Documentation

The documentation sidebar links directly to source files on GitHub, but HTML builds still include copies of the reStructuredText sources under _sources. These copies unnecessarily increase the size and file count of the build output.

The sidebar source links also need to account for the documentation version:

  • “Show source” always points to CPython’s main branch, including when viewing documentation for released versions.
  • “Show translation source” can point to a nonexistent branch when viewing development documentation.

I propose to disable source copying while preserving the sidebar actions, and make both source links point to the appropriate branches for the documentation being viewed.

A local build comparison found that disabling source copying removed 554 files and reduced the output size by approximately 12.72 MiB. Build time improved only slightly; the main benefit is smaller build output.

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

docsDocumentation in the Doc dir

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions