Skip to main content

A jinja2 markdown tag powered with PyMdown Extensions.

Project description

Jinja-Markdown

Tests

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

Installation

pip install jinja_markdown

Usage

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

or

from jinja_markdown import MarkdownExtension

jinja_env.add_extension(MarkdownExtension)

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

<article>
{% markdown %}
# Heading
Regular text

    print("Hello world!")
{% endmarkdown %}
</article>

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 -->
<article>
    {% markdown %}
    # Baseline of identation
    Regular paragraph

        This will be interpreted as code
</article>

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.200630.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jinja_markdown-1.200630-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file jinja_markdown-1.200630.tar.gz.

File metadata

  • Download URL: jinja_markdown-1.200630.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.0

File hashes

Hashes for jinja_markdown-1.200630.tar.gz
Algorithm Hash digest
SHA256 5d5c3b78dd31fed8cca518a742a9e69564cdc412ac0d708e23f7c0105a15d8c1
MD5 371a6e8bd0913fca037b9df9cba5817f
BLAKE2b-256 5ba8ee1e85737f17bfa8a4d3d5b7f4ba690074ddba0b862869a4af2a18b1ca7f

See more details on using hashes here.

File details

Details for the file jinja_markdown-1.200630-py3-none-any.whl.

File metadata

  • Download URL: jinja_markdown-1.200630-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.0

File hashes

Hashes for jinja_markdown-1.200630-py3-none-any.whl
Algorithm Hash digest
SHA256 a43c14f2f88e54d342d7c31fcb7f9f469e2eabe54e813e155f93610cd770c256
MD5 995eadb408ef294efa46c72cd40f2efc
BLAKE2b-256 c9d86b51afba910b3bc89bdd6556644f863d34b0a25085404030db9d52e29c4d

See more details on using hashes here.

Supported by

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