Skip to content

Commit cf16a97

Browse files
committed
docs: fix changelog page heading levels and sidebar
Give the changelog page its own title so version headings become sections: the current version now appears in the page ToC at the same level as older versions. Fold the changelog link into the Development sidebar section and use :titlesonly: to keep version headings out of the sidebar. Exclude docs/changelog.rst from docstrfmt, which rewrote the title to the same level as the included CHANGELOG.rst headings. Assisted-by: ClaudeCode:claude-fable-5 Claude-Session: https://claude.ai/code/session_018JS2hRNjfymjCZez1jvGVV
1 parent 4ed9658 commit cf16a97

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

.pre-commit-config.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ repos:
4444
- id: docstrfmt
4545
args: ["-l", "120"]
4646
additional_dependencies: ["sphinx>=9.1"]
47-
exclude: ^docs/index\.rst$ # https://github.com/LilSpazJoekp/docstrfmt/issues/176
47+
# index: https://github.com/LilSpazJoekp/docstrfmt/issues/176
48+
# changelog: title must outrank the included CHANGELOG.rst headings
49+
exclude: ^docs/(index|changelog)\.rst$
4850
- repo: https://github.com/astral-sh/ruff-pre-commit
4951
rev: 65dbdb59d2f2d9c3bdc343c566821ad3319ddaa3 # frozen: v0.16.3
5052
hooks:

docs/changelog.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1+
===========
2+
Changelog
3+
===========
4+
15
.. include:: ../CHANGELOG.rst

docs/index.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,15 @@ Where to start
9191

9292
.. toctree::
9393
:caption: Development
94+
:titlesonly:
9495
:hidden:
9596

9697
development/contributing
9798
development/release
99+
changelog
98100
Source Code <https://github.com/pypa/build/>
99101
Issue Tracker <https://github.com/pypa/build/issues>
100102

101-
.. toctree::
102-
:caption: Changelog
103-
:hidden:
104-
105-
changelog
106-
107103
.. _pip: https://github.com/pypa/pip
108104
.. _PyPI: https://pypi.org/
109105
.. _pipx: https://github.com/pipxproject/pipx

0 commit comments

Comments
 (0)