Jinja2 integration with MJML
Project description
Jinja2 MJML
Micro-package that integrates MJML with Jinja2.
Under the hood it uses mjml_python package, that is a wrapper around rust port of MJML.
Example
from jinja2_mjml import Environment
# MJMLEnvironment it's thin wrapper around jinja2.Environment,
# so you can use all the features of Jinja2 package.
environment = Environment()
template = environment.from_string('''
<mjml>
<mj-body>
<mj-section>
<mj-column>
<mj-text>Hello {{ name }}!</mj-text>
</mj-column>
</mj-section>
</mj-body>
</mjml>
''')
# Render MJML template to HTML
print(template.render(name='MJML'))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jinja2_mjml-0.1.0.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for jinja2_mjml-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdd8f40343e3c0856377f8fda058438b45065401f9ad99cc52387b2fda23ff3f |
|
MD5 | 549088798476ca3445238af2c2ce4d1a |
|
BLAKE2b-256 | 8f2b057fcf32a65a456a06e7f24addffd5a02f007092da9436eac8348ecca2ec |