-
Start a new mkdocs site
mkdocs new my-docs cd my-docs
-
Add the plugin to the
requirements.txt
git+https://github.com/pivotal/mkdocs-plugins.git#egg=mkdocs-jinja2&subdirectory=mkdocs-jinja2 git+https://github.com/pivotal/mkdocs-plugins.git#egg=markdown-code-excerpt&subdirectory=markdown-code-excerpt
-
Add to the list of plugins and markdown extensions in
mkdocs.yml
plugins: - jinja2: {} markdown_extensions: - markdown-code-excerpt: sections: namespace: directory-to-look-for-code-snippets
-
Enjoy with
mkdocs serve
.
This enables Jinja2 as a templating language for the markdown files. It adds functionality to have logic.