Documentation Sites¶
Version: 1.0.0 Extends: General / Core Template: template-mkdocs
Standards for building documentation sites using MkDocs with Material theme. Includes structure, configuration, and deployment best practices.
When to Use¶
- Project documentation that needs a professional web interface
- API documentation with code examples
- Technical guides and tutorials
- Internal knowledge bases
- Documentation that benefits from diagrams and visual aids
- Technical blogs or combined documentation + blog sites
When Not to Use¶
- Simple READMEs that don't need a full site
- Documentation that will only live in a repository
- Non-technical content better suited for wikis or CMS platforms
Choosing the Right Tool¶
MkDocs + Material is the recommended choice for Python teams. For other scenarios, consider these alternatives:
| Use Case | Recommendation |
|---|---|
| Technical docs for Python teams | MkDocs + Material (this standard) |
| Docs + marketing landing pages | Docusaurus |
| Public SaaS product docs | Mintlify or GitBook |
| Internal company knowledge base | Notion or Confluence |
| Large open source projects | Docusaurus or Starlight |
| Auto-generated Python API docs | Sphinx + autodoc |
Future: Zensical
Zensical is the next-generation static site generator from the Material for MkDocs team. Built with Rust and Python for superior performance, it reads mkdocs.yml natively, making migration seamless. Consider it for new projects once it reaches stable release.
Core Stack¶
| Technology | Version | Purpose | Documentation |
|---|---|---|---|
| MkDocs | - | Static site generator for Markdown | Getting Started |
| Material for MkDocs | >=9.7.0 | Theme, components, and extensions | Setup Guide |
| PyMdown Extensions | >=10.18 | Extended Markdown syntax | Reference |
Plugins¶
| Plugin | Version | Purpose | Documentation |
|---|---|---|---|
| mkdocs-minify-plugin | >=0.8.0 | Minifies HTML, CSS, and JS for production | GitHub |
| mkdocs-redirects | >=1.2.2 | Handles URL redirects when restructuring docs | GitHub |
| mkdocs-git-revision-date-localized | >=1.5.0 | Displays last updated date from git history | GitHub |
| mkdocs-awesome-pages | >=2.10.1 | Simplifies navigation configuration | GitHub |
| mkdocs-glightbox | >=0.5.2 | Lightbox functionality for images and diagrams | GitHub |
Blog Plugin¶
For sites that combine documentation with a blog, Material for MkDocs includes a built-in blog plugin. This enables publishing articles with categories, tags, and archive pages alongside technical documentation.
Diagrams¶
Mermaid enables creating diagrams directly in Markdown. Supported types include flowcharts, sequence diagrams, class diagrams, ERDs, state diagrams, and Gantt charts. See the Mermaid documentation for syntax and examples.
Material for MkDocs has built-in Mermaid support that requires no additional plugins.
Icons¶
Material for MkDocs includes several icon sets that can be used inline or in components:
| Icon Set | Prefix | Browse Icons |
|---|---|---|
| Material Design Icons | :material-*: | Pictogrammers |
| FontAwesome | :fontawesome-*: | FontAwesome |
| Octicons | :octicons-*: | Primer Octicons |
| Simple Icons | :simple-*: | Simple Icons |
See the Material Icons Reference for usage details.
Best Practices¶
- Navigation: Use
mkdocs-awesome-pageswith.pagesfiles for flexible navigation instead of hardcoding everything inmkdocs.yml - Assets: Store images in
docs/assets/images/and reference them with relative paths - Admonitions: Use sparingly for genuinely important callouts; overuse reduces their effectiveness
- Code blocks: Always specify the language for proper syntax highlighting
- Links: Prefer relative links between docs to avoid broken links when URLs change
- Redirects: When renaming or moving pages, always add redirects to preserve existing links
Hosting¶
Common deployment options for MkDocs sites:
| Platform | Best For | Documentation |
|---|---|---|
| GitHub Pages | Open source projects | Guide |
| GitLab Pages | GitLab-hosted projects | Guide |
| Google Cloud Storage | Production sites with CDN | Guide |
| Cloud Run | Sites requiring authentication | Guide |
Advanced Features¶
| Feature | Purpose | Documentation |
|---|---|---|
| mike | Documentation versioning (v1, v2, etc.) | Setup Guide |
| Algolia DocSearch | Enhanced search for large documentation sites | Integration Guide |
| i18n | Multi-language documentation support | Setup Guide |
| Social Cards | Auto-generated preview cards for social sharing | Setup Guide |