Skip to content

Commit 2231b6b

Browse files
d-v-bclaude
andauthored
docs(subpackages): render subpackage changelogs as docs pages (#4311)
* docs(zarr-indexing): render the changelog as a docs page The sidebar and landing page linked to CHANGELOG.md on the GitHub main branch, so the docs for any version showed the changelog of main. Add docs/release-notes.md, which includes CHANGELOG.md via pymdownx.snippets with the package root appended to base_path. The root file stays where towncrier, PyPI, and GitHub expect it, and each docs build now renders the release notes for its own version. The page is named release-notes.md rather than changelog.md because on a case-insensitive filesystem the latter shadows CHANGELOG.md and the include resolves to the page itself. Assisted-by: ClaudeCode:claude-fable-5-1 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * docs(zarr-indexing): add changelog fragment for #4311 Assisted-by: ClaudeCode:claude-fable-5-1 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * docs(zarr-indexing): fix stale page name in mkdocs comment Assisted-by: ClaudeCode:claude-fable-5-1 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * docs(zarr-metadata,zarr-http-server): render the changelog as a docs page Same change as for zarr-indexing: the sidebar and landing page linked to CHANGELOG.md on the GitHub main branch, so the docs for any version showed the changelog of main. Add docs/release-notes.md, which includes CHANGELOG.md via pymdownx.snippets with the package root in base_path. Neither package had the snippets extension enabled, so it is added with check_paths so an unresolved include fails the build. Assisted-by: ClaudeCode:claude-fable-5-1 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
1 parent 62ed076 commit 2231b6b

13 files changed

Lines changed: 58 additions & 9 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The docs now render the release notes as a page instead of linking to
2+
`CHANGELOG.md` on GitHub, so each docs version shows its own changelog.

‎packages/zarr-http-server/docs/index.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,5 @@ Reads are all that is enabled by default: `GET` and `HEAD` are served, and
6767
- [User guide](guide.md) — building apps, running them, byte ranges, CORS,
6868
writes, notebooks, and Uvicorn configuration
6969
- [API reference](api/index.md)
70-
- [Changelog](https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-http-server/CHANGELOG.md)
70+
- [Release notes](release-notes.md)
7171
- [License (MIT)](https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-http-server/LICENSE.txt)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!-- CHANGELOG.md at the package root is the single source of truth: towncrier
2+
writes releases into it, and PyPI and GitHub render it directly. This page
3+
includes it so each docs build shows the release notes for its own version.
4+
The page is not named changelog.md on purpose: on a case-insensitive
5+
filesystem that name shadows CHANGELOG.md and the include resolves to the
6+
page itself. -->
7+
8+
--8<-- "CHANGELOG.md"

‎packages/zarr-http-server/mkdocs.yml‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ nav:
1616
- guide.md
1717
- API Reference:
1818
- api/index.md
19-
- Changelog: https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-http-server/CHANGELOG.md
19+
- Release notes: release-notes.md
2020

2121
watch:
2222
- src
@@ -98,3 +98,11 @@ markdown_extensions:
9898
line_spans: __span
9999
pygments_lang_class: true
100100
- pymdownx.inlinehilite
101+
- pymdownx.snippets:
102+
# The package root lets docs/release-notes.md include the
103+
# towncrier-managed CHANGELOG.md without moving it out of the package
104+
# root, where PyPI and GitHub readers expect it.
105+
base_path: [docs, .]
106+
# Fail the build on an unresolvable include instead of silently
107+
# rendering nothing.
108+
check_paths: true
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The docs now render the release notes as a page instead of linking to
2+
`CHANGELOG.md` on GitHub, so each docs version shows its own changelog.

‎packages/zarr-indexing/docs/index.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@ the chain stays one description, and where the materialization boundary is.
4949
- [Design notes](design-notes.md) — TensorStore lineage, box vs query, and
5050
deliberate limits.
5151
- [API reference](api/index.md)
52-
- [Changelog](https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-indexing/CHANGELOG.md)
52+
- [Release notes](release-notes.md)
5353
· [License (MIT)](https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-indexing/LICENSE.txt)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!-- CHANGELOG.md at the package root is the single source of truth: towncrier
2+
writes releases into it, and PyPI and GitHub render it directly. This page
3+
includes it so each docs build shows the release notes for its own version.
4+
The page is not named changelog.md on purpose: on a case-insensitive
5+
filesystem that name shadows CHANGELOG.md and the include resolves to the
6+
page itself. -->
7+
8+
--8<-- "CHANGELOG.md"

‎packages/zarr-indexing/mkdocs.yml‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ validation:
2323
omitted_files: warn
2424

2525
# Top-level rank is consistent: collections (Guide, Examples, API Reference)
26-
# and standalone artifacts (landing, ndsel spec, design notes, changelog).
26+
# and standalone artifacts (landing, ndsel spec, design notes, release notes).
2727
# Guide mirrors the docs/guide/ directory — its three pages are one
2828
# collection (learn / look up / integrate), pydantic's Concepts pattern at
2929
# small scale; navigation.indexes makes the Guide entry itself land on the
@@ -56,7 +56,7 @@ nav:
5656
- '<code class="doc-symbol doc-symbol-toc doc-symbol-module"></code> <code>zarr_indexing.errors</code>': api/errors.md
5757
- '<code class="doc-symbol doc-symbol-toc doc-symbol-module"></code> <code>zarr_indexing.testing.stateful</code>': api/testing_stateful.md
5858
- '<code class="doc-symbol doc-symbol-toc doc-symbol-module"></code> <code>zarr_indexing.testing.strategies</code>': api/testing_strategies.md
59-
- Changelog: https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-indexing/CHANGELOG.md
59+
- Release notes: release-notes.md
6060
# This site is a Read the Docs subproject of zarr-python; give readers a way
6161
# back to the parent docs, which list every companion package.
6262
- 'zarr-python ↪': https://zarr.readthedocs.io/
@@ -148,7 +148,10 @@ markdown_extensions:
148148
- pymdownx.tabbed:
149149
alternate_style: true
150150
- pymdownx.snippets:
151-
base_path: [docs, examples]
151+
# The package root is last so docs/release-notes.md can include the
152+
# towncrier-managed CHANGELOG.md without moving it out of the package
153+
# root, where PyPI and GitHub readers expect it.
154+
base_path: [docs, examples, .]
152155
# Fail the build on an unresolvable include or missing region instead
153156
# of silently rendering nothing. tests/test_doc_examples.py mirrors
154157
# base_path when it verifies the include graph.

‎packages/zarr-indexing/tests/test_doc_examples.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
# Mirrors `pymdownx.snippets: base_path` in mkdocs.yml. If that list changes,
4646
# change this one in the same commit.
47-
SNIPPET_BASE_PATHS = (DOCS, STANDALONE_EXAMPLES)
47+
SNIPPET_BASE_PATHS = (DOCS, STANDALONE_EXAMPLES, PACKAGE_ROOT)
4848

4949
_INCLUDE = re.compile(r'--8<--\s+"(?P<target>[^":\n]+?)(?::(?P<region>[^"\n]+))?"')
5050

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The docs now render the release notes as a page instead of linking to
2+
`CHANGELOG.md` on GitHub, so each docs version shows its own changelog.

0 commit comments

Comments
 (0)