Documentation Quick Reference¶
Building Documentation¶
Local Development Server¶
Build Static Site¶
Deploy to GitHub Pages (Optional)¶
Documentation Structure¶
Following the Diátaxis framework:
Tutorials (Learning-Oriented)¶
docs/tutorials/getting-started.md- First-time setup guide
How-To Guides (Task-Oriented)¶
docs/how-to/local-development.md- Daily development workflowdocs/how-to/database-migrations.md- Managing Alembic migrationsdocs/how-to/testing.md- Running and writing tests
Reference (Information-Oriented)¶
docs/reference/api.md- Complete API endpoint referencedocs/reference/configuration.md- All environment variablesdocs/reference/database-schema.md- Database model reference
Explanation (Understanding-Oriented)¶
docs/explanation/architecture.md- System design and patternsdocs/explanation/authentication.md- Auth/security deep dive
Adding New Documentation¶
1. Create Markdown File¶
2. Update mkdocs.yml¶
3. Write Content¶
Use Markdown with Material for MkDocs extensions:
# Title
## Section
Content here.
!!! note "Note Box"
Important information
!!! warning "Warning"
Be careful with this
```python
# Code blocks with syntax highlighting
def example():
pass
\```
Material for MkDocs Features¶
Admonitions¶
!!! note
General note
!!! tip
Helpful suggestion
!!! warning
Caution required
!!! danger
Critical warning
Tabs¶
Code Annotations¶
Tables¶
Mermaid Diagrams¶
Configuration (mkdocs.yml)¶
Key sections:
site_name: Project Name
theme:
name: material
features:
- navigation.tabs
- search.suggest
plugins:
- search
- mkdocstrings # For auto-generating API docs from docstrings
markdown_extensions:
- admonition
- pymdownx.highlight
- pymdownx.superfences
Updating Documentation¶
After Code Changes¶
- Update relevant docs if API or behavior changes
- Add new docs for new features
- Update examples if needed
- Rebuild docs to verify
Review Checklist¶
- Accurate information
- Working code examples
- Proper formatting
- Links work
- Builds without errors
Troubleshooting¶
Build Errors¶
Broken Links¶
MkDocs warns about broken internal links during build. Fix them before deploying.
Missing Pages¶
Ensure all pages listed in nav: section of mkdocs.yml exist.
Best Practices¶
- Keep docs close to code - Update docs with code changes
- Use clear examples - Show, don't just tell
- Test code samples - Ensure examples actually work
- Link between docs - Help readers navigate
- Update regularly - Docs should reflect current state
- Follow Diátaxis - Put content in the right category
Next Steps¶
- Read the MkDocs Material documentation
- Explore Diátaxis framework
- Review existing docs for examples