Repository navigation
Conversation
Clone zarr-developers/zarr-extensions at build time and render each README.md as a page, e.g. /extensions/codecs/jpeg/. Other registry files (schema.json, sample data, examples) are served verbatim alongside. The registry stays the normative source; edit links point there. The deploy workflow now also runs daily and on a `zarr-extensions-updated` repository_dispatch event. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I wonder if we should also render the core specs like this. It would be nice for visual consistency. We would need to be careful to keep all the URLs intact. |
maxrjones
left a comment
There was a problem hiding this comment.
Thanks for contributing this, @normanrz! I'd prefer a shared VitePress config used by zarr.dev, specs.zarr.dev and extensions.zarr.dev, with each site deployed from its own repo. I think that's a better solution because:
- it works under the existing governance model where zarr.dev is controlled by ZSC review versus specs.zarr.dev and extensions.zarr.dev being controlled by ZFWG review
- content from another repo cannot break deploys here
- this site's build never renders unsanitized Markdown
- errors in zarr-extensions are caught in that repo's own PR process, using test builds on PRs
- we don't rely on a cron job to publish extension updates. this setup is fragile because GitHub disables scheduled workflows after 60 days without commits to the repo
That said, having a deployed version of zarr-extensions matters more than the mechanism. I could help (via Claude) with the approach above if others agree, but I'd rather this be merged than have progress stall if my preference is contentious.
|
@maxrjones Sounds good. Should we put the VitePress config in a new |
Publishes the zarr-extensions registry on zarr.dev, e.g.
https://zarr.dev/extensions/codecs/jpeg/. zarr-extensions stays the normative source. This site clones it at build time and renders it.How it works
scripts/fetch-extensions.mjsruns beforedocs:devanddocs:build. It shallow-clones the registry and:README.mdasextensions/<path>/index.md, socodecs/jpeg/README.mdbecomes/extensions/codecs/jpeg/<div v-pre>, because the registry is GitHub markdown, not a Vue template (chunk-key-encodings/templatecontains{{)README.mdlinks and links to directories that have a README become page links; directories without a README (e.g.codecs/zfp/examples/) and missing targets point to GitHub at the imported commitpublic/extensions/, soschema.json,examples.tsvand thesample_data/*.zarrarrays are served verbatim (e.g./extensions/codecs/jpeg/schema.json)editUrl(pointing at the registry repo) in frontmatter, and adds a "Rendered from … at<sha>" note to each pageOutput goes to
extensions/andpublic/extensions/, which are both gitignored. UseZARR_EXTENSIONS_DIRto preview a local checkout, orZARR_EXTENSIONS_REFto build from another branch or tag..vitepress/extensions.tsbuilds the/extensions/sidebar from the generated files: one collapsible group per extension point, with items labelled by registered name.Nav: "Extensions" is added under Resources.
editLink.patternusesfrontmatter.editUrlwhen it is set.deploy.ymlnow also runs daily and onrepository_dispatchwith typezarr-extensions-updated.RTD previews pick this up automatically, since they run
npm run docs:build.Follow-up in zarr-extensions (not part of this PR)
For immediate rebuilds on merge, zarr-extensions needs a small workflow that sends the dispatch event. It needs a token with access to this repo, such as a fine-grained PAT or GitHub App token stored as a secret:
Until that exists, the daily scheduled build picks up changes.
Testing
npm run verifypasses: 82 pages and 63 files imported, the redirect check passes, and the internal-link check passes across all pages, including the imported ones. I spot-checked the rendered output for:/extensions/codecs/jpeg/{{on the template chunk-key-encoding page./sample_data/and./examples.tsvlinks, and cross-extension links (e.g. data-types/string → codecs/vlen-utf8)🤖 Generated with Claude Code