Documentation Authoring Guide
Last Updated: 2025-11-17 Purpose: Establish clear documentation standards and prevent content driftDocumentation Philosophy
Single Source of Truth: Every piece of user-facing documentation should exist in exactly one canonical location. Discoverability First: If documentation isn’t linked from Mintlify navigation (docs.json), most users will never find it.
File Format Policy
✅ USE .mdx for All Documentation in docs/
Location:docs/**/*.mdx (registered in docs/docs.json)
Policy: The docs/ directory is exclusively for Mintlify .mdx files. No .md files allowed.
When to use:
- Getting started guides
- API documentation
- Deployment guides
- Architecture documentation
- Tutorials and examples
- Troubleshooting guides
- Security and compliance docs
- Contributor documentation (this guide!)
- Frontmatter (required):
seoTitle: Optimized for search engines (50-60 characters), typically{title} - MCP Server LangGraphseoDescription: Expanded version of description (150-160 characters) for search engine snippetskeywords: Array of 5-10 relevant keywords including domain keywords (mcp server, langgraph)
-
Navigation (required):
- Must be registered in
docs/docs.json - Place in appropriate tab and group
- Use logical ordering
- Must be registered in
-
Links (required):
- Use Mintlify-style paths:
/getting-started/introduction - NOT relative paths:
../getting-started/introduction.md - NOT file extensions:
/getting-started/introduction(not.mdx)
- Use Mintlify-style paths:
-
Special Characters (required):
- Escape
<as<in tables and text - Escape
>as>in tables and text - Escape
&as&if not part of HTML entity
- Escape
-
File Naming (required):
- Use lowercase kebab-case:
my-guide-name.mdx - NOT UPPERCASE:
MY_GUIDE_NAME.mdx - NOT snake_case:
my_guide_name.mdx - NOT camelCase:
myGuideName.mdx
- Use lowercase kebab-case:
⚠️ .md Files Allowed ONLY Outside docs/
Allowed .md files (outsidedocs/ directory):
- Root-level files:
README.md,CHANGELOG.md,SECURITY.md,CONTRIBUTING.md docs-internal/*.md- Internal contributor documentation- Development notes, research, scratch files
- Any .md files in
docs/directory - User-facing guides in .md format
- Duplicates of .mdx files
Directory Structure
Common Mistakes to Avoid
❌ DON’T: Create Duplicate Documentation
❌ DON’T: Forget Frontmatter
❌ DON’T: Use UPPERCASE File Names
❌ DON’T: Use File Extensions in Links
❌ DON’T: Forget to Register in docs.json
Even if the file exists, it won’t be accessible unless it’s indocs.json:
❌ DON’T: Use < or > Unescaped
< as start of JSX tag
Fix: Use HTML entities
Creating New Documentation
Step 1: Choose the Right Location
Step 2: Use a Template
docs-templates-mintlify/):
adr-template.mdx- Architecture Decision Recordsguide-template.mdx- How-to guidesdeployment-template.mdx- Deployment guidesreference-template.mdx- API reference
Step 3: Add Frontmatter
Step 4: Write Content
- Start with context: Why does this page exist?
- Use headings: Organize with ##, ###, ####
- Add examples: Code blocks with syntax highlighting
- Link related docs: Help users navigate
- Test locally: Run
mintlify devto preview
Step 5: Register in docs.json
Step 6: Validate
Migration Policy
When converting .md to .mdx:- ✅ Read the original
.mdfile - ✅ Add frontmatter with appropriate metadata
- ✅ Preserve all content exactly as-is
- ✅ Fix any
</>escaping issues in tables - ✅ Update internal links to Mintlify format
- ✅ Use lowercase kebab-case for filename
- ✅ Register in docs.json at appropriate location
- ✅ Delete the original
.mdfile - ✅ Run validation:
mintlify broken-links
Link Formatting
Internal Links (Within Docs)
External Links
Anchor Links
Icon Selection
See Icon Selection Guide for comprehensive icon reference. Common icons:rocket- Getting started, quickstartbook- Guides, tutorialscode- API, SDKserver- Deployment, infrastructureshield- Securitychart-line- Metrics, observabilityinfinity- CI/CDcloud- Cloud providersbook-open- Documentation, authoring
Content Quality Standards
Writing Style
- Be concise: Respect reader’s time
- Be specific: “Run
make test” not “Run tests” - Be actionable: Focus on “how” more than “what”
- Be consistent: Use same terminology throughout
Code Examples
Screenshots/Diagrams
- Prefer Mermaid for diagrams (see Mermaid Guide)
- Optimize images: Compress before committing
- Add alt text: For accessibility
Pre-Commit Checklist
Before committing documentation changes:- Frontmatter complete and accurate (including contentType)
- File name is lowercase kebab-case
- Added to
docs.jsonnavigation - All
<and>escaped in tables - Internal links use Mintlify format (
/path/to/page) - No duplicate .md version exists
- Ran
mintlify broken-links(no errors) - Tested with
mintlify dev(renders correctly) - Spell-checked and grammar-checked
Validation
Pre-commit Hooks
The following validations run automatically: Pre-commit stage (local):- Frontmatter quote style check
- File naming conventions (lowercase)
- ADR synchronization
mintlify broken-links- PRIMARY validator- Checks: frontmatter, links, navigation, syntax, images
- Duration: ~8-12 seconds
- This is the single source of truth for docs validation
Manual Validation
Troubleshooting
”Syntax error - Unable to parse”
Cause: Unescaped< or > characters, or code blocks missing language tags
Fix:
- Replace
<with<and>with> - Add language tags to code blocks:
```pythoninstead of```
”Page not found” in Mintlify
Cause: Not registered indocs.json
Fix: Add page path to appropriate group in docs.json
”Broken link” warning
Cause: Link uses wrong format or points to non-existent page Fix:- Use
/path/to/pageformat (no extension) - Verify target page exists and is in
docs.json
”Could not parse import/exports with acorn”
Cause: Code block containingimport statement doesn’t have language tag
Fix: Add python, javascript, or appropriate language tag to code block
Maintenance
Weekly
- Review new documentation PRs for compliance
- Check
mintlify broken-linksoutput
Monthly
- Audit for orphaned .md files (should be ZERO in
docs/) - Review docs.json for logical organization
- Update this guide as patterns emerge
Getting Help
- Icon reference: Icon Selection Guide
- Mermaid diagrams: Mermaid Guide
- Templates:
docs-templates-mintlify/directory - Mintlify docs: https://mintlify.com/docs
- Questions?: Open issue with label
documentation
Remember: All user-facing documentation belongs in .mdx files registered in docs.json. The
docs/ directory is exclusively for Mintlify .mdx files - no exceptions.