11# metbit documentation site
22
3- This is the Next.js documentation app for ` metbit ` . It uses the App Router and MDX pages for guides and API reference content.
3+ This is the Next.js documentation app for ` metbit ` . It provides release-specific
4+ guides and API reference pages generated from each published GitHub release.
45
56## Structure
67
7- - ` app/ ` — App Router
8- - ` page.tsx ` — Landing page
9- - ` docs/ ` — Docs section with a sidebar layout
10- - ` overview/page.mdx `
11- - ` getting-started/page.mdx `
12- - ` api/ ` — API reference pages
8+ - ` app/docs/[version]/ ` — version-aware documentation routes
9+ - ` content/generated/releases.json ` — published release manifest
10+ - ` content/generated/snapshots/ ` — deduplicated API snapshots parsed from Git tags
11+ - ` scripts/sync_version_docs.py ` — release and API documentation generator
1312- ` globals.css ` — global and docs layout styles
1413- ` next.config.js ` — MDX-enabled config
1514- ` package.json ` — scripts and dependencies
@@ -21,18 +20,29 @@ This is the Next.js documentation app for `metbit`. It uses the App Router and M
21203 . Dev server: ` npm run dev `
22214 . Open: http://localhost:3000
2322
23+ ## Refresh versioned documentation
24+
25+ The sync script reads GitHub Releases and the corresponding local Git tags:
26+
27+ ``` bash
28+ npm run docs:sync
29+ ```
30+
31+ Run ` git fetch --tags ` first when new releases have been published. The
32+ generator stores identical parsed APIs once and maps every release to its
33+ matching snapshot, keeping the Vercel deployment compact.
34+
2435## Authoring notes
2536
26- - Add new docs by creating folders under ` app/docs/<slug>/page.mdx ` .
27- - API pages live under ` app/docs/api/<slug>/page.mdx ` .
28- - Prefer root imports in examples, for example ` from metbit import pca, opls_da ` .
29- - Use subpackage imports only when documenting advanced internals, for example ` from metbit.nmr.alignment import PeakAligner ` .
30- - Keep code examples runnable with current package exports.
31- - MDX allows mixing Markdown with React components.
37+ - New releases require a GitHub Release and a matching local Git tag.
38+ - API pages are generated from source signatures and docstrings; improve the
39+ Python docstring when generated documentation is incomplete.
40+ - Historical releases may not support current Python versions or dependencies.
3241- Icons come from ` react-icons ` .
3342
3443## Maintenance checklist
3544
36- - Update quick-start examples when public imports change in ` metbit/__init__.py ` .
37- - Keep the API index aligned with public exports and important subpackage utilities.
45+ - Run ` npm run docs:sync ` after publishing a release.
46+ - Review the generated manifest and release count.
47+ - Check one current and one historical version.
3848- Run ` npm run build ` before publishing the docs site.
0 commit comments