Docs Site README
Fumadocs site commands, structure, and maintenance notes.
This directory contains the Fumadocs + Next.js documentation site. It is isolated from the Python package so Node dependencies and generated files do not affect framework installs.
Commands
npm install
npm run sync:readmes
npm run dev
npm run build
npm run typechecknpm run sync:readmes regenerates the embedded package pages from the
repository README files, writing one page per README into its owning docs
section (under both en and zh). It also runs automatically before dev,
build, and typecheck.
npm run build statically exports the site to out/. The build also generates .source/, which backs the collections/server import used by Fumadocs MDX.
Structure
| Path | Purpose |
|---|---|
app/ | Next.js App Router pages and static route handlers |
content/docs/ | MDX source pages and meta.json sidebar ordering |
lib/source.ts | Fumadocs loader source |
lib/get-llm-text.ts | Markdown conversion for agent endpoints |
components/mdx.tsx | MDX component mapping |
source.config.ts | Fumadocs MDX collection config |
scripts/sync-readme-reference.mjs | Generates embedded package pages from near-code README files |
Agent Endpoints
Static builds expose:
/llms.txtfor a compact documentation index./llms-full.txtfor the full Markdown corpus./md/<slug>/index.mdfor one page as Markdown, for example/md/configuration/hydra/index.md./api/search.jsonfor the static search index consumed by Fumadocs UI.
Generated package pages are included in these outputs after
npm run sync:readmes.
Keep these routes extension-safe so static hosts can infer MIME types without custom server configuration.
Agent endpoints intentionally read only the English source (content/docs/en). Chinese pages are for human reading and are not included in /llms-full.txt or /md/<slug>/index.md.
Do not add llms.txt as a docs sidebar category. The rendered Agents section explains how agents should navigate the docs; /llms.txt and related routes stay as root-level machine-readable endpoints.
Human Languages
Human documentation is language-prefixed:
/en/docsfor English./zh/docsfor Chinese.
Content is organized by directory:
content/docs/en/...
content/docs/zh/...English is the source of truth and fallback language. If a Chinese page is missing, Fumadocs falls back to the English source.
Adding Pages
- Add the English
.mdxfile undercontent/docs/en/. - Add the Chinese
.mdxfile undercontent/docs/zh/when the page is intended for human Chinese readers. - Add or update the nearest
meta.jsonpageslist to control sidebar order. - Prefer paths and command examples that match the current repository state.
- Run
npm run buildbefore submitting changes.
Maintenance Notes
- Node
>=20.19.0is declared because current transitive file-watcher dependencies require it. Older Node versions may still build but will warn during install. includeProcessedMarkdownis enabled insource.config.ts; do not remove it unless/llms-full.txtand/md/<slug>/index.mdare replaced with another Markdown source.- Generated directories
.next/,.source/,out/, andnode_modules/are ignored by the repository. - Generated package pages
content/docs/{en,zh}/<section>/readme-*.mdxcome fromnpm run sync:readmesand are git-ignored; edit the source README, not these files.
Source:
docs/README.md— edit the README next to the code, then runnpm run sync:readmesfromdocs/.