Skip to main content

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


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 details)

Uploaded Source

Built Distribution

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

jinja2_mjml-0.1.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file jinja2_mjml-0.1.0.tar.gz.

File metadata

  • Download URL: jinja2_mjml-0.1.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.10.1 Darwin/22.1.0

File hashes

Hashes for jinja2_mjml-0.1.0.tar.gz
Algorithm Hash digest
SHA256 400535fd22efc593c211b6d0ffbab6463eb70b0d6a03bbc1fabdb33a10db1c61
MD5 a567236e31971434e8d5eda22ef8e26c
BLAKE2b-256 0225816e3caa703a63cd71e30b1cc0e89d1e7a6d74f86450fd31064eec20d9f1

See more details on using hashes here.

File details

Details for the file jinja2_mjml-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: jinja2_mjml-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.10.1 Darwin/22.1.0

File hashes

Hashes for jinja2_mjml-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fdd8f40343e3c0856377f8fda058438b45065401f9ad99cc52387b2fda23ff3f
MD5 549088798476ca3445238af2c2ce4d1a
BLAKE2b-256 8f2b057fcf32a65a456a06e7f24addffd5a02f007092da9436eac8348ecca2ec

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