/doc/CLAUDE.md
CLAUDE.md at /doc/CLAUDE.md
Path: doc/
mdx-formatter Documentation Site
Documentation site built with zudo-doc 5.2.1 — a zfb-based documentation framework with MDX, Tailwind CSS v4, and Preact islands. This project is intentionally minimal: one config file (zfb.config.ts) plus markdown content — layout, chrome, and islands all ship from @takazudo/zudo-doc in node_modules. Node.js >= 22 is required.
Tech Stack
zfb — documentation build framework
MDX — content format, authored under
src/content/Tailwind CSS v4 — compiled by zfb's embedded Tailwind engine (no
@tailwindcss/viteplugin, notailwindcssdependency);src/importsstyles/ global. css tailwindcss/preflight+tailwindcss/utilitiesand zfb's internal resolver serves bothPreact — for interactive islands only (with compat mode for React API)
zfb semantic highlighting — native build-time fenced-code rendering plus lazy
@takazudo/zfb-md-wasmfor HtmlPreview; both emithi-*classes resolved through--zd-syntax-*design tokens@takazudo/zudo-doc — the package that owns everything: layout, chrome, islands, default
@themedesign tokens, and (viapackageOwnedRoutes, on by default) the doc routes themselves
Commands
pnpm dev— runs the zfb dev server (port 4321) and the doc-history API server (port 4322) concurrently viarun-p(pnpm dev:zfb/pnpm dev:historyindividually)pnpm dev:network— same, but zfb binds--host 0.0.0.0for LAN access (pnpm dev:zfb:networkindividually); the doc-history server stays loopback-only and LAN clients reach it through zfb's/dev proxydoc- history/ * Trusted networks only: this also serves your git doc-history — including UNPUBLISHED local commits — to anyone on the LAN via the
/proxydoc- history/ * run-pswallows trailing args, so other zfb flags don't forward throughpnpm dev— pass them directly instead:pnpm run dev:zfb -- <flags>pnpm build— runszfb buildfor a static HTML export todist/pnpm check— runszfb checkfor type and content checkingpnpm preview— runszfb previewto serve the builtdist/
The formatter playground loads project-owned WASM files from public/wasm/. From the repository root, run pnpm build:wasm:doc before using the playground locally. The docs CI action performs this step before zfb build.
Key Directories
zfb.config.ts # THE one config file — zudoDoc({ ...only fields you chose })
pages/
├── index.tsx # 1-line re-export of the package home route
└── docs/[[...slug]].tsx # self-contained doc-route stub (required for `pnpm dev`)
[locale]/docs/[[...slug]].tsx # same, for non-default locales
src/
├── chrome-bindings.tsx # optional typed primary chrome / named header / MDX bindings
├── content/
│ ├── docs/ # mdx-formatter's default-locale MDX content
│ ├── docs-ja/ # Japanese MDX content (partial; EN fallback fills gaps)
│ └── docs-v-0x/ # archived TypeScript-engine documentation
└── styles/
└── global.css # @import chain + a token-override slot — that's it Everything else — layout, header, sidebar, footer, doc chrome, islands, and the default design tokens — lives in node_modules/@takazudo/zudo-doc. For supported markup replacement, create src/ with defineChromeBindings, set chromeBindingsModule, and use the primary Header / Footer / Sidebar / Toc / Breadcrumb / DocPager slots or the named headerRightComponents registry. The generated default, locale, and doc-history route shapes already consume the same binding object; do not fork a route stub for presentational customization. npx zudo-doc eject <component> only copies source: heed its primary, nested-chrome, or content-layer remediation before expecting the copy to render. Settings you didn't set explicitly in zfb.config.ts use the package's documented defaults — hover zudoDoc's ZudoDocConfig argument in your editor to see every field and its @default.
Content Conventions
Frontmatter
Required:
title(string)Optional:
description,sidebar_position(number),categorySidebar order is driven by
sidebar_position
Admonitions
Available in all MDX files without imports, via directive syntax: :::note, :::tip, :::info, :::warning, :::danger, :::caution, :::details. Each accepts an optional bracketed title: :::note[Custom Title].
Docusaurus-style {title="..."} is NOT supported. MDX parses the braces as a JS expression, so it either fails the build with ReferenceError: title is not defined or is silently ignored. Always use the bracketed form.
Headings
Do NOT use h1 (#) in doc content — the page title from frontmatter is rendered as h1. Start content headings from h2 (##).
Built-in MDX components
@takazudo/zudo-doc ships a few globally-available MDX components — usable in any .mdx file with no import. The Japanese overview index uses one:
<CategoryNav category="..." />— a card-grid list of the pages in a docs category (used bysrc/).content/ docs- ja/ overview/ index. mdx <CategoryTreeNav category="..." />— the same listing as a compact nested tree, better for deeper hierarchies.<SiteTreeNavDemo />— a full-site documentation tree (the MDX-available wrapper of theSiteTreeNavisland).
Admonitions (above), tabbed content (<Tabs> / <TabItem>, <CodeGroup>), and block math (<MathBlock>) work the same way — no import. Full reference: https://zudo-doc.takazudomodular.com/docs/components/
i18n
English (default):
/— content indocs/ . . . src/content/ docs/ Japanese:
/— content inja/ docs/ . . . src/content/ docs- ja/ Japanese docs should mirror the English directory structure
Both
pages/docs/[[...slug]].tsxandpages/[locale]/docs/[[...slug]].tsxare self-contained doc-route stubs shipped by the generator — required sopnpm devdoesn't 404 on doc pages (a zfb dev-mode limitation on package-injected dynamic routes). Don't delete them.
Enabled Features
claudeResources — Auto-generated docs for Claude Code resources
sidebarResizer — Draggable sidebar width
sidebarToggle — Show/hide desktop sidebar
versioning — Multi-version documentation support
docHistory — Document edit history
llmsTxt — Generates llms.txt for LLM consumption
changelog — Changelog page at
/docs/ changelog