Cheatsheet for mkdocs & mkdocs-material
Estimated time to read: 2 minutes
Material theme
In mkdocs.yml
Features
In mkdocs.yml, enable admonitions, annotations, code highlightnings
markdown_extensions:
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
- attr_list
- md_in_html
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
- admonition
- pymdownx.details
also for ease code snippet usage, add features in theme part
Usage
Annotations
Lorem ipsum dolor sit amet, (1) consectetur adipiscing elit.
{ .annotate }
1. 😝 I'm an annotation! (1)
{ .annotate }
1. 🤯 I'm an annotation in an annotation
Admonitions
Available keywords are : note, abstract, info, tip, success, question, warning, failure, danger, bug, example, quote.
Admonition are displayed by default, but can be replace by collapsible block switching from !!! to ???
It supports annotation:
Code blocks
Code blocks are of course supported, but you can also add either a title or annotation.
ℹ️ The comment is mandatory for the annotation to be processed. Here # in a yaml file.
\`\`\`yaml
annotations: # (1)
downscaler/uptime: Mon 07:30-18:00 CET
downscaler/force-downtime: "true"
\`\`\`
1. 🥶 Incredible annotation
Snippets
We can include files as snippets, with an optional title:
Build
Pour installer mkdocs et les extensions:
Avec un virtualenv
Pour lancer le serveur de dev:
Pour lancer un build et générer le pdf