Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hyzyla/jinja2_mjml

Jinja2 integration with MJML
https://github.com/hyzyla/jinja2_mjml

Last synced: 14 days ago
JSON representation

Jinja2 integration with MJML

Awesome Lists containing this project

README

        

# Jinja2 MJML

Micro-package that integrates [MJML](https://mjml.io/)
with [Jinja2](https://jinja.palletsprojects.com/en/2.11.x/).

Under the hood it uses [mjml_python](https://pypi.org/project/mjml-python/)
package, that is a wrapper around [rust port](https://github.com/jolimail/mrml-core)
of MJML.

## Example

```python
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('''




Hello {{ name }}!




''')

# Render MJML template to HTML
print(template.render(name='MJML'))
```