Skip to content

Simple Jinja extension that allows for markdown processing after templating.

License

Notifications You must be signed in to change notification settings

mkbabb/jinja-markdown2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 %}

About

Simple Jinja extension that allows for markdown processing after templating.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published