content/installation/docs.mdx
Host Plate's documentation locally to integrate it directly with your project. This setup ensures your team works with documentation that matches your Plate version while enabling AI tools to better understand and assist with your codebase.
Local documentation provides distinct advantages over external sites:
llms.txt: While dumping docs into a single text file is common for LLM context, this breaks down with large documentation (exceeding typical 100k token limits). Our structured, local setup lets AI tools access exactly what they need.There are two ways to set up local documentation:
This option sets up a complete documentation site using Fumadocs, providing a searchable, navigable interface.
<Steps>Set up a Fumadocs app which provides the Next.js-based framework for your documentation site:
pnpm create fumadocs-app
During setup:
docs when prompteddocs directory with all necessary filesNavigate to your newly created docs directory:
cd docs
For detailed Fumadocs setup, see the Fumadocs UI documentation.
components.jsonIn your docs directory, create a components.json file. You have two options:
Option A: Command line
echo '{\n "$schema": "https://ui.shadcn.com/schema.json",\n "style": "new-york",\n "rsc": true,\n "tsx": true,\n "tailwind": {\n "config": "",\n "css": "app/global.css",\n "baseColor": "neutral",\n "cssVariables": true,\n "prefix": ""\n },\n "aliases": {\n "components": "@/components",\n "utils": "@/lib/utils",\n "ui": "@/components/ui",\n "lib": "@/lib",\n "hooks": "@/hooks"\n },\n "iconLibrary": "lucide"\n}' > components.json
Option B: Copy and paste
Create a new file called components.json in your docs directory with this content:
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "",
"css": "app/global.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}
Now, fetch the Plate documentation files and necessary MDX components.
npx shadcn@latest add @plate/fumadocs
https://platejs.org/r/ in the shadcn command with this URL.
</Callout>
Start the development server:
pnpm run dev
Your documentation site will be available at:
http://localhost:3000/docs/plateEnhance your docs with Fumadocs features.
</Steps>If you just want the documentation files without setting up a full site, you can add them directly to your existing project:
# Run from your project root (wherever you want the docs)
npx shadcn@latest add @plate/docs
This will:
docs/ or similar directory)Use cases:
Enable AI tools to work with your local documentation by adding the Plate server to your .cursor/mcp.json (or equivalent).
{
"mcpServers": {
"shadcn": {
"description": "Shadcn and Plate MCP",
"command": "npx",
"args": [
"shadcn@latest",
"mcp"
]
}
}
}
Your AI tools can then:
See the MCP Guide for more details.
<Callout> Once configured, try asking your AI: ```bash "Help me understand how the Plate AI plugin works" "How to create a custom plugin?" "What's new in the latest Plate version?" ``` </Callout>Your content/docs/ directory can host documentation for multiple libraries. Replicate the process for Plate to add docs for other internal or external tools:
content/
└── docs/
├── plate/ # Plate documentation
│ └── ...
├── other-library/ # Documentation for another library
│ └── ...
└── index.mdx # Main landing page for all docs
This creates a unified, version-controlled knowledge base for your project stack.