MkDocs Basics¶
MkDocs is a fast, simple, and downright gorgeous static site generator that's geared towards building project documentation. Documentation source files are written in Markdown, and configured with a single YAML configuration file.
This website is generated by mkdocs.org and the Material Theme.
Basic MkDocs Commands¶
just uv run mkdocs servestarts the live-reloading docs server.just uv run mkdocs buildbuilds this documentation site.just uv run mkdocs --helpprints the help message.
Install and documentation generation¶
In this repository, sync the locked MkDocs tools before creating or serving the site:
To build the documentation site:
To start the live-reloading docs server - https://localhost:8000/
MkDocs can use the ghp-import tool to commit to the gh-pages branch and push the gh-pages branch to GitHub Pages:
MkDocs project layout¶
mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.
Material for MkDocs Best Practices¶
Use the mkdocs.yml to leverage the Material theme extensively:
theme:
name: material
features:
- navigation.tabs
- navigation.sections
- navigation.top
- search.suggest
- search.highlight
- content.code.copy
palette:
- scheme: default
primary: indigo
toggle:
icon: material/brightness-7
name: Switch to dark mode
- scheme: slate
primary: indigo
toggle:
icon: material/brightness-4
name: Switch to light mode