mjdi docsv0.10.0latest
Documentation website
The mjdi repository ships a documentation website (website/, a Next.js
Source: mjdi/docs/docs-website.md
The mjdi repository ships a documentation website (website/, a Next.js
application). It publishes this documentation set at versioned URLs, so
every page you read is pinned to a release — and every page is copyable as
markdown: one click for humans, plain HTTP for agents.
- Implementation:
website/src/app/docs/[version]/(this page's own home) - URL layout:
/docs/<version>/<page>— for example/docs/0.5.0/getting-started - Current release: 0.5.0 (latest); 0.4.0 is served as an archived snapshot
1. Versioned URLs
Documentation URLs always name the release they describe:
| URL | What it serves |
|---|---|
/docs | Redirects to the latest version (/docs/0.5.0). |
/docs/latest/... | Alias that redirects to the latest version's canonical URL. |
/docs/0.5.0/<page> | The current release, rendered live from mjdi/docs/. |
/docs/0.4.0/<page> | The archived 0.4.0 release, rendered from a frozen snapshot. |
/docs/<page> (legacy) | Unversioned links keep working: they redirect to the same page in the latest version. |
The sidebar carries a version switcher. Switching versions keeps the
page you are reading when the target release ships it, and lands on that
version's documentation map otherwise. Pages of an archived release show a
notice that links to their latest-version counterpart. A page that a release
did not ship (for example mcp-server.md in 0.4.0) correctly 404s under that
version's URL.
2. Where each version's content comes from
- The latest version is rendered straight from
mjdi/docs/*.mdat request time. There is no copied content: editing a file inmjdi/docs/changes the website on the next request, so the published docs can never drift from the repository. - Archived versions are frozen snapshots extracted from the release zip
(
download/mjdi-<version>.zip) intowebsite/content/docs/<version>/byscripts/snapshot_archived_docs.py. They describe exactly what that release shipped and never change — including that release's own changelog and API reference. - Each version has its own navigation map, so archived releases show the section layout of their time (0.4.0 has no MCP server or website pages, because those did not exist yet).
3. Copy as markdown
Every documentation page is copyable as markdown, in three ways:
-
Copy page button — on every page, next to the title. The primary action copies the page's raw markdown source; the menu also offers the page URL, the raw view and a
.mddownload. Code blocks carry their own copy buttons. -
Raw markdown endpoints — the exact file content backing each page, served as
text/markdown:curl -O https://<host>/api/docs/0.5.0/getting-started.md curl -O https://<host>/api/docs/0.4.0/api-reference.md # archivedThe
.mdsuffix is optional;?download=1forces a file download. The response carries anX-Mjdi-Docs-Versionheader naming the release. -
Full bundle — every page of one version concatenated in reading order, for agents that want the whole set at once:
curl -O https://<host>/api/docs/0.5.0/bundle.md
The raw endpoints serve the same bytes that back the rendered page — no
HTML, no rewriting — so what you copy is what ships in the repository. The
/llms.txt manifest, generated at request time, lists every page, the raw
endpoints, the archived versions and the MCP endpoint for LLM discovery.
4. Search and navigation
Ctrl-Kopens full-text search over titles, descriptions and section headings — scoped to the version you are browsing.- Every page has a "On this page" table of contents with GitHub-compatible anchors, plus previous/next navigation that follows the version's documentation map.
- Internal cross-references in the markdown (for example
[Providers](/docs/0.10.0/providers)) are rewritten to the versioned URL of the page you are reading.
5. For agents
/llms.txt— discovery manifest (page list, raw endpoints, versions)./api/mcp— the MCP server exposing the same content as tools and resources, version-aware; documented inmcp-server.md.list_doc_versionsreports the served releases, and resources are addressed asmjdi://docs/<version>/<slug>.
6. Website development
cd website
bun install # install dependencies (also installs husky hooks)
bun run dev # dev server on http://localhost:3000
bun run lint # ESLint
bun run format # Prettier
The stack: Next.js 16 (App Router), TypeScript, Tailwind CSS 4 with
shadcn/ui, TanStack Query for server state (search metadata, raw-markdown
fetches, MCP playground), and Husky with a lint-staged pre-commit hook.
Version constants live in website/src/lib/docs-versions.ts (DOC_VERSIONS);
adding a release means: cut the zip, run the snapshot script for the old
version, and add the new version to DOC_VERSIONS and the navigation map in
docs-server.ts.