Skip to content

docs: show package tag instead of monorepo release in subpackage docs - #4229

Open
maxrjones wants to merge 4 commits into
zarr-developers:mainfrom
maxrjones:docs/subpackage-header-version
Open

docs: show package tag instead of monorepo release in subpackage docs#4229
maxrjones wants to merge 4 commits into
zarr-developers:mainfrom
maxrjones:docs/subpackage-header-version

Conversation

@maxrjones

Copy link
Copy Markdown
Member

Summary

This PR patches mkdocs to use the subpackage's tag instead of Zarr-Python core's in the docs header.

Before After
image image

For reviewers

Opinions on whether we should duplicate the patch on each sub-package (anti-DRY) or symlink (anti-windows).

Author attestation

  • I am a human, these are my changes, and I have reviewed and understood every change and can explain why each is correct.

TODO

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/user-guide/*.md
  • Changes documented as a new file in changes/
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

@github-actions github-actions Bot added the needs release notes Automatically applied to PRs which haven't added release notes label Aug 3, 2026
@d-v-b

d-v-b commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

this is awesome max! short term i'm leaning anti DRY (pro duplication) but longer term this is something our docs dep should handle without modifications. we should investigate upstreaming this fix

@maxrjones

Copy link
Copy Markdown
Member Author

this is awesome max! short term i'm leaning anti DRY (pro duplication) but longer term this is something our docs dep should handle without modifications. we should investigate upstreaming this fix

thanks for the prompt feedback. I consolidated both the patch script and the mkdocs configuration files.

Comment thread docs/contributing.md
Comment on lines +239 to +242
1. Create a new project on [readthedocs.org](https://app.readthedocs.org) importing the `zarr-python` repository, named after the package (e.g. `zarr-metadata`).
2. In the project's admin settings, set the configuration file path to `packages/<name>/.readthedocs.yaml`. That file also cancels pull request builds that don't touch the package.
3. Add an automation rule matching the package's release tags (custom match `^zarr_<name>-v`, note the underscore) with the action "Activate version". Automation rules only apply to versions detected after the rule is created, so activate any earlier release tags manually from the versions list.
4. When activating a version, edit its slug to the bare version number (`0.4.0`, not `v0.4.0`). RTD keeps a version record for every tag in the monorepo, including inactive ones not shown in the dashboard's versions list, and all of zarr-python's own release tags are `v`-prefixed — so a `v`-prefixed slug collides with zarr-python's release history ("A version with that slug already exists"), while bare version numbers cannot collide.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@d-v-b supposedly (according to Fable) this will address the issues discussed in #Zarr-Python > zarr-metadata docs. You're welcome to add me to RTD if you'd like any help with maintainence.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I did add that automation rule, but didn't get the expected results! Happy adding you to rtd so you can tinker

@@ -0,0 +1,698 @@
version = 1

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I committed uv.lock since the lockfile is committed for zarr-metadata

@maxrjones
maxrjones requested a review from d-v-b August 3, 2026 19:21
}

async function latestPackageTag() {
const response = await fetch(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this fires on every page load, and I think github has a rate limit on this endpoint, maybe we want to cache this internally?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

good catch, thanks! fixed in cb1f8b3

}

function patchCache(version) {
const facts = __md_get("__source", sessionStorage)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we probably need to watch this code carefully when / if we update material

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

we probably won't be updating material 🫠 squidfunk/mkdocs-material#8523

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

Labels

needs release notes Automatically applied to PRs which haven't added release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants