MkDocs
MkDocs generates a static documentation site from a folder of markdown files. It’s the fastest way to turn a collection of notes into a searchable, navigable site.
pip install -r requirements.txt # Install dependencies
mkdocs serve -f mkdocs.yml # Local preview at localhost:8000
mkdocs serve -f mkdocs.yml --dev-addr 0.0.0.0:80 # Serve on local network
mkdocs build -f mkdocs.yml # Build static site to /site
Plugins Worth Using
- mknotebooks - renders Jupyter notebooks as MkDocs pages. Requires a CSS fix for pandas DataFrames (they overflow the page width by default):
table {
display: block;
max-width: fit-content;
margin: 0 auto;
overflow-x: auto;
white-space: nowrap;
}
- mkdocs-awesome-pages-plugin - lets you control page ordering with
.pagesfiles instead of the YAML nav config. Cleaner for large vaults. - mkdocs-jupyter - alternative Jupyter integration with better nbformat support.
- pymdown-extensions - extended markdown syntax including tabbed content, smart slugs, and formula support.
More plugins: MkDocs Plugins Wiki
Jupyter Book
Jupyter Book builds documentation sites from Jupyter notebooks and markdown files, with native support for executable code, math, and interactive outputs.
Key libraries used alongside Jupyter Book:
- jupytext - converts notebooks to plain Python or markdown scripts (enables version control of notebooks without the JSON noise)
- mkdocs-jupyter - when you want Jupyter content inside an MkDocs site instead
Reference: Jupyter Book Documentation
MkDocs Material Admonitions
Admonitions are styled callout boxes for highlighting important content:
!!! warning "Title"
Warning text here.
!!! note
A note without a custom title.
!!! info
Informational callout.
!!! question
A question callout.
Available types: warning, note, info, error, question, example.
Collapsible admonition (starts collapsed):
??? note "Click to expand"
### Heading inside
- **Key**: Value
Tabbed Content
Useful for showing the same concept in multiple languages or configurations:
=== "Python"
```python
print("hello")
```
=== "R"
```r
print("hello")
```
Mixed Admonition and Tabs
!!! warning "Auto-generated files"
=== "Unordered List"
```markdown
* Sed sagittis eleifend rutrum
```
=== "Ordered List"
```markdown
1. Sed sagittis eleifend rutrum
```
Badges and Icons
Markdown badges (shields.io style) for README files and documentation: Reference: Markdown Badges Repository
Font Awesome icons in MkDocs Material:
[:fontawesome-solid-globe: Live Demo][demo]
[Github Repo][repository]
[repository]: https://github.com/user/repo "GitHub Repository"
[demo]: https://demo.example.com "Live Demo"
Quote Block Pattern
For attributed quotes in documentation:
!!! quote
The text of the quote.
-- <cite>Author Name ([source](https://source-url.com))</cite>