Documentation Site Template
Welcome to your MkDocs-powered documentation site! This is the homepage of your documentation built using MkDocs with the Material theme.
Getting Started
Prerequisites
Before you begin, make sure you have:
- Python 3.8 or higher installed
- Git configured with your repository
- Basic knowledge of Markdown
Quick Setup
- Clone or download this template
- Navigate to your project directory
- Run the setup script:
./init_site.sh
That’s it! Your documentation site will be built and served locally at http://127.0.0.1:8000.
Manual Setup (Alternative)
If you prefer to set things up manually:
1. Create Virtual Environment
2. Install Dependencies
3. Configure Your Site
Edit the configuration files in the mkdocs/ directory:
| Configuration File | Description |
|---|---|
| 01-mkdocs-site.yml | Basic site information |
| 02-mkdocs-theme.yml | Theme and appearance settings |
| 03-mkdocs-extra.yml | Social links and extras |
| 04-mkdocs-plugins.yml | Plugin configurations |
| 05-mkdocs-extensions.yml | Markdown extensions |
| 06-mkdocs-nav.yml | Navigation structure |
4. Build Configuration
5. Start Development Server
Adding and Organizing Content
Creating New Pages
To add content to your documentation:
- Create new Markdown files in this
Labs/directory - Add them to the navigation in
mkdocs/06-mkdocs-nav.yml
Example navigation entry:
Content Organization Structure
Here’s how you might organize your documentation:
Labs/
├── README.md # This homepage
├── tutorials/ # Tutorial section
│ ├── README.md # Tutorial overview
│ ├── basic-tutorial.md
│ └── advanced-tutorial.md
├── guides/ # How-to guides
│ ├── README.md # Guides overview
│ └── installation-guide.md
├── reference/ # Reference documentation
│ ├── README.md # Reference overview
│ ├── api-reference.md
│ └── configuration.md
└── assets/ # Images and other assets
├── images/
│ ├── logo.png
│ └── screenshots/
└── stylesheets/
Adding Images and Assets
- Place images in
Labs/assets/images/ - Reference them in your Markdown:
- Add custom stylesheets to the
Labs/assets/stylesheets/directory
Customization
Changing Theme Colors
Edit mkdocs/02-mkdocs-theme.yml to customize the appearance:
Available colors: red, pink, purple, deep purple, indigo, blue, light blue, cyan, teal, green, light green, lime, yellow, amber, orange, deep orange, brown, grey, blue grey
Adding Custom CSS
- Create CSS files in
Labs/assets/stylesheets/ - Reference them in
mkdocs/03-mkdocs-extra.yml:
Template Features
This documentation template includes many powerful features:
Markdown Extensions
- Admonitions: Create beautiful callout boxes
- Code highlighting: Syntax highlighting for code blocks
- Tables: Enhanced table formatting
- Mermaid diagrams: Create flowcharts and diagrams
- Math notation: LaTeX-style mathematical expressions
Navigation Features
- Tabs: Top-level navigation tabs
- Search: Fast client-side search
- Table of contents: Automatic TOC generation
- Navigation sections: Collapsible navigation sections
Code Examples
Here’s a code block with syntax highlighting:
def hello_world():
"""A simple hello world function."""
print("Hello, World!")
return "Hello, World!"
# Call the function
hello_world()
Admonitions
MkDocs Material supports many different types of admonitions. Here are all the available types:
Note
This is a note admonition. Use it to highlight important information.
Abstract/Summary/TL;DR
This is an abstract admonition. Great for summaries or TL;DR sections.
Info/Todo
This is an info admonition. Use it for informational content.
Tip/Hint
This is a tip admonition. Perfect for sharing helpful hints and best practices!
Success/Check/Done
This is a success admonition. Use it to highlight successful outcomes or completed tasks.
Question/Help/FAQ
This is a question admonition. Great for FAQs or help sections.
Warning/Caution/Attention
This is a warning admonition. Use it to call attention to potential issues.
Failure/Fail/Missing
This is a failure admonition. Use it to highlight failures or missing items.
Danger/Error
This is a danger admonition. Reserve for critical warnings and errors.
Bug
This is a bug admonition. Perfect for documenting known issues.
Example
This is an example admonition. Use it to provide code examples or demonstrations.
Quote/Cite
This is a quote admonition. Use it for citations or important quotes.
Collapsible Admonitions
You can make admonitions collapsible by using ??? instead of !!!:
Collapsible Note (Click to expand)
This admonition starts collapsed. Users can click to expand it.
Collapsible but Open by Default
This admonition is collapsible but starts expanded. Use ???+ for this behavior.
Inline Admonitions
You can also create inline admonitions that flow with the text:
Inline Info
This is an inline admonition that takes up less space.
Inline at End
This inline admonition is positioned at the end of the line.
Regular text continues here, flowing around the inline admonitions above.
!!! info inline "Inline Info"
Inline admonition content
!!! tip inline end "Inline at End"
End-positioned inline content
Custom Titles
You can customize the title or remove it entirely:
This admonition has no title - just leave the quotes empty.
🎉 Custom Title with Emoji
You can use emojis and custom text for titles.
Mermaid Diagram Example
mermaid graph LR A[Start] --> B{Decision} B -->|Yes| C[Action 1] B -->|No| D[Action 2] C --> E[End] D --> E
Deployment
GitHub Pages (Recommended)
- Push your repository to GitHub
- Enable GitHub Pages in repository settings
- Use GitHub Actions for automatic deployment
Manual Deployment
Deploy your site manually using:
This will build and deploy your site to GitHub Pages automatically.
Next Steps and Resources
- Customize the site configuration in the
mkdocs/directory - Add your own content by creating new Markdown files
- Update the navigation to reflect your content structure
- Deploy your site to GitHub Pages or your preferred hosting platform
Learning Resources
- Explore the Material theme documentation
- Learn about MkDocs plugins
- Check out Markdown extensions
Happy documenting! 📚✨