Skip to main content

A jinja2 markdown tag powered with PyMdown Extensions.

Project description



A jinja2 extension that adds a {% markdown %} tag powered with PyMdown Extensions.


pip install jinja_markdown


jinja_env = Environment(extensions=['jinja_markdown.MarkdownExtension'])


from jinja_markdown import MarkdownExtension


Then your templates can contain Markdown inside {% markdown %} / {% endmarkdown %} block tags.

{% markdown %}
# Heading
Regular text

    print("Hello world!")
{% endmarkdown %}

About indentation

To avoid issues is recommended that you don't indent the markdown code inside the tag. If you prefer do it anyway, make sure the first line has the baseline indentation level.

<!-- Supported but not recommended -->
    {% markdown %}
    # Baseline of identation
    Regular paragraph

        This will be interpreted as code

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

jinja_markdown-1.210911.tar.gz (3.6 kB view hashes)

Uploaded source

Built Distribution

jinja_markdown-1.210911-py3-none-any.whl (3.4 kB view hashes)

Uploaded py3

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