Contributing to Documentation
How to add and edit documentation using Fumadocs
Contributing to Documentation
This project uses Fumadocs for documentation. The docs are integrated into the main application and served at /docs.
Documentation Structure
packages/docs/
├── content/
│ └── docs/ # MDX documentation files
│ ├── index.mdx
│ ├── architecture.mdx
│ ├── design-choices.mdx
│ ├── future-plans.mdx
│ └── contributing.mdx
├── source.config.ts # Fumadocs configuration
└── package.jsonAdding New Documentation
1. Create a New MDX File
Create a new .mdx file in packages/docs/content/docs/:
touch packages/docs/content/docs/your-topic.mdx2. Add Frontmatter
Every documentation page needs frontmatter with title and description:
---
title: Your Topic Title
description: A brief description of what this page covers
---
# Your Topic Title
Your content here...3. Write Content
Use standard Markdown with MDX enhancements:
Code Blocks
// Code blocks support syntax highlighting
export function example() {
return "Hello, world!";
}Callouts
Use blockquotes for callouts:
Note: This is an informational callout.
Links
- Internal:
[Architecture](/docs/architecture) - External:
[Fumadocs](https://fumadocs.vercel.app)
Lists and Tables
Standard Markdown lists and tables are supported.
4. Regenerate Docs
After adding or editing docs, regenerate the source files:
# From root
bun run docs:generate
# Or from web app
cd apps/web
bun run fumadocs-mdxThe dev server will automatically regenerate docs when you save changes.
Editing Existing Documentation
- Navigate to
packages/docs/content/docs/ - Edit the
.mdxfile you want to change - Save the file
- The dev server will hot-reload the changes
Documentation Best Practices
Writing Style
- Be concise: Get to the point quickly
- Use examples: Show code examples where relevant
- Be consistent: Follow the existing documentation style
- Update regularly: Keep docs in sync with code changes
File Naming
- Use kebab-case:
my-topic.mdx - Be descriptive:
database-migrations.mdxnotdb.mdx - Group related topics in subdirectories if needed
Frontmatter Guidelines
---
title: Clear, Descriptive Title
description: One sentence summary (50-160 characters)
---Fumadocs Features
Syntax Highlighting
Code blocks automatically get syntax highlighting with light/dark theme support:
bun install
bun run devimport { auth } from '@info-ppaai-app/auth';
export async function getUser() {
const session = await auth.api.getSession();
return session?.user;
}Table of Contents
Fumadocs automatically generates a table of contents from your headings. Use proper heading hierarchy:
#for page title (h1)##for main sections (h2)###for subsections (h3)
Search
The documentation includes built-in search functionality. All content is automatically indexed.
Local Development
Start Dev Server
bun run devVisit http://localhost:3000/docs to see your changes.
Build for Production
bun run buildThis validates all documentation and generates static pages.
Troubleshooting
Docs Not Updating
If your changes aren't showing:
- Regenerate docs:
bun run docs:generate - Restart dev server:
Ctrl+Cthenbun run dev - Clear
.sourcecache:rm -rf apps/web/.source packages/docs/.source
Syntax Errors
If you see build errors:
- Check frontmatter is valid YAML
- Ensure all code blocks are properly closed with
``` - Validate MDX syntax at MDX Playground
Styling Issues
If styling looks broken:
- Ensure you're using standard Markdown syntax
- Check that code blocks specify a language
- Verify heading hierarchy is correct