oscgonfer / mkdocs-mktemplate-plugin

Insert jinja templates in mkdocs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mktemplate

This is a plugin for mkdocs to render jinja templates in markdown documents.

Usage

Template files must be in templates/ in the root directory of your mkdocs project.

An example template file might look like this:

<ul>
{% for item in items %}
    <li>{{ item }}</li>
{% endfor %}
</ul>

Then in any of the pages of your mkdocs project use the following syntax to include a template and provide the variables.

{%
template "template.html" # filename of the template in templates/ directory
items:
    - item 1
    - item 2
    - item 3
%}

This will generate the following result:

<ul>
    <li>item 1</li>
    <li>item 2</li>
    <li>item 3</li>
</ul>

Packages used

About

Insert jinja templates in mkdocs

License:MIT License


Languages

Language:Python 100.0%