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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: jinja_markdown-1.210911.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.0

File hashes

Hashes for jinja_markdown-1.210911.tar.gz
Algorithm Hash digest
SHA256 f598a58da9b9ced4956c6e113ba4369e9683bac5065bfdef2566bd6de9983eb0
MD5 79bdcb54fa2e25f88451dc6df9bb2c78
BLAKE2b-256 a90a04036727c369c5013f6780ef8c9207b064ee2f183384893ad54ce93ab27c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jinja_markdown-1.210911-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.0

File hashes

Hashes for jinja_markdown-1.210911-py3-none-any.whl
Algorithm Hash digest
SHA256 cce8e2be016227c925a8c82a7f3499099319d239fedc481b7728a7c9e9e3cfcc
MD5 fda496e999bc71d72beb0efe39fc84a6
BLAKE2b-256 10a49d42465c2e6dc24a4d13dede260f13f78d96b7982020491e91272798dffb

See more details on using hashes here.

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