Skip to main content

A Jinja2 extension for rendering Markdown with markdown2.

Project description

jinja-markdown2

Inspired by the original jinja-markdown.

Uses jinja2 + markdown2 to render markdown code after jinja's templating magic (variable interpolation, etc.) is done. Critical difference between the naive:

Markdown ->  HTML -> Jinja

Notice, the above processes the markdown first and jinja templating last. Whilst this approach technically works, it results in a myriad of problems with the resultant HTML that markdown2 formulates.

The flow is then:

HTML -> Jinja -> Markdown

Usage

Python:

...
from jinja_markdown2 import MarkdownExtension

jinja_env = ...
jinja_env.add_extension(MarkdownExtension)
...

Markdown:

{% markdown %}

## Hello {{ world_name }}

{% endmarkdown %}

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_markdown2-0.3.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

jinja_markdown2-0.3.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file jinja_markdown2-0.3.0.tar.gz.

File metadata

  • Download URL: jinja_markdown2-0.3.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.11.2 Darwin/22.4.0

File hashes

Hashes for jinja_markdown2-0.3.0.tar.gz
Algorithm Hash digest
SHA256 270ffd5b45dce48cb0a51c679e3f9269ae8bbdd4ac2a07022b457386ba776543
MD5 df36a6693501fb2ddd1d1761f08d2ab7
BLAKE2b-256 4d165fae339f7b1238f035dfacdf6cfb941579b4ee044fe16c10513218ac36f7

See more details on using hashes here.

File details

Details for the file jinja_markdown2-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: jinja_markdown2-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.11.2 Darwin/22.4.0

File hashes

Hashes for jinja_markdown2-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4804c9b524c161625449a8f9d01c2b241f860ad7428f42dd79212bf358cce891
MD5 3a5e98359768ff29d85fcdb8cb5b4486
BLAKE2b-256 cfa4e4925f00dd0c189d8dae7f0a5222286f21295078199d6866f9134031843c

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