1 min read
Quickstart
document0 is framework-agnostic. The core packages (@document0/core and @document0/mdx) work anywhere Node.js runs. Pick your framework to get started:
Framework guides
adding a test here for HMR
| Framework | Status |
|---|---|
| Next.js | Available |
| React (Vite) | Coming soon |
| Vue | Coming soon |
| Svelte | Coming soon |
| Astro | Coming soon |
| Angular | Coming soon |
Scaffold with create-document0
The fastest way to get started with Next.js:
npx create-document0 my-docs
cd my-docs
npm run devThis scaffolds a complete working docs site. See create-document0 for details.
The basics (any framework)
Regardless of framework, the core workflow is the same:
1. Install
npm install @document0/core @document0/mdx shiki @mdx-js/mdx2. Create a source
import { DocsSource } from "@document0/core";
const source = new DocsSource({
rootDir: "./content/docs",
baseUrl: "/docs",
});3. Get pages and render
import { processMdx } from "@document0/mdx";
const page = await source.getPage("installation");
const { code, frontmatter, toc } = await processMdx(page.content, options);4. Build navigation
const tree = await source.getPageTree(); // sidebar tree
const crumbs = getBreadcrumbs(tree, url); // breadcrumbs
const { previous, next } = getPageNeighbours(tree, url);5. Add search
import { createSearchRoute } from "@document0/core/search";
export const { GET } = createSearchRoute(source);Each framework guide covers how to wire these pieces into your specific routing and rendering layer.
Next steps
- Core package reference: all APIs for source scanning, navigation, search, and llms.txt
- MDX package reference: MDX processing and Shiki options
- CLI: install plugins and components from the registry
- Search: add full-text search to your docs
- llms.txt: serve AI-ingestible documentation