This is a Next.js application generated with Create Fumadocs.
Run development server:
npm run dev
# or
pnpm dev
# or
yarn devOpen http://localhost:3000 with your browser to see the result.
In the project, you can see:
lib/source.ts: Code for content source adapter,loader()provides the interface to access your content.lib/layout.shared.tsx: Shared options for layouts, optional but preferred to keep.
| Route | Description |
|---|---|
app/(home) |
The route group for your landing page and other pages. |
app/docs |
The documentation layout and pages. |
app/api/search/route.ts |
The Route Handler for search. |
A source.config.ts config file has been included, you can customise different options like frontmatter schema.
Read the Introduction for further details.
To learn more about Next.js and Fumadocs, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
- Fumadocs - learn about Fumadocs
This repo can ingest docs content from other statelyai/* repos and mount it
under stately.ai/docs/packages/....
The external docs manifest lives in docs-sources.json:
[
{ "name": "Graph", "package": "graph", "source": "graph" }
]Each entry means:
name: display name in the docs sidebarpackage: public route segment under/docs/packages/<package>source: repo root or repo subpath to scan for docs content
The sync pipeline is implemented in scripts/docs-sync.mjs.
For each manifest entry, it:
- Resolves the source repo locally from
../<repo>when available. - Falls back to a cached remote checkout in
.cache/docs-repos/<repo>when the local repo is missing. - Scans the configured
sourceroot for:- root
README.md/readme.md - nested
**/README.md(x) docs/**/*.{md,mdx}
- root
- Flattens those pages into
.cache/docs-workspaces/<package>/docs. - Generates Fumadocs frontmatter when it is missing.
The generated workspace is what source.config.ts points Fumadocs at. The app
never copies external docs into content/docs.
- Root
README.mdbecomesindex.mdand maps to/docs/packages/<package>. - Nested
**/README.md(x)are treated as index-like and flatten to their parent path:src/formats/adjacency-list/README.md->src-formats-adjacency-list.md
docs/**/*.{md,mdx}also flatten into the same package namespace.- Optional frontmatter
slugoverrides the flattened route segment. - Duplicate flattened slugs fail the sync.
For synced external docs, the pipeline also derives:
titleif frontmatter is missingdescriptionif frontmatter is missingsourcePathandsourceUrlpointing to the original file in GitHub
The first H1 in synced pages is stripped so the page title only renders once.
Sources can overlap inside the same repo. More specific sources win.
Example:
{ "name": "SDK", "package": "sdk", "source": "viz/packages/sdk" }{ "name": "Viz", "package": "viz", "source": "viz" }
In that case, viz automatically skips the packages/sdk subtree so the SDK
docs are not indexed twice.
pnpm docs:sync: refresh external workspaces onlypnpm docs:generate: sync external workspaces and regenerate Fumadocs outputpnpm docs:watch: watch local source repos and regenerate on changespnpm dev: run the app after a sync passpnpm build: run sync and then a production build