Skip to main content

mkdocs plugin to insert jinja templates on any page

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs-mktemplate-plugin-1.0.1.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

mkdocs_mktemplate_plugin-1.0.1-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page