This project is a reimplementation of the nice MJML
markup language in Rust.
```bash
cargo install mrml-cli
mrml-cli path/to/template.mjml validate mrml-cli path/to/template.mjml render mrml-cli path/to/template.mjml format-json --pretty mrml-cli path/to/template.json format-mjml --pretty
mrml-cli --help ```
Update your cargo.toml
.
toml
[dependencies]
mrml = "1.2"
serde = { version = "1.0", features = ["derive"] }
Create your main.rs
```rust use mrml;
fn main() {
let root = mrml::parse("
Node
server rendering a mjml template takes around 20Mo of RAM at startup and 130Mo under stress test. In Rust
, less than 1.7Mo at startup and a bit less that 3Mo under stress test. The Rust
version can also handle 2 times more requests per seconds. You can run the bench by doing bash script/run-bench.sh
.JS
implementation cannot be run in the browser. In Rust
(and Wasm
), you can.Feel free to read our contributing section and the code of conduct.
With the same linux amd64 machine, to render the amario template
To reproduce those results, you can follow the configuration in the gitlab-ci.yml or look on codebench.cloud
mj-style[inline]
: not yet implemented. It requires parsing the generated html to apply the inline styles afterward (that's how it's done in mjml) which would kill the performances. Applying it at render time would improve the performance but it would still require to parse the css.mj-include
: not yet implemented. It requires to handle loading remote templates when using mrml in a wasm (browser or server side) format, which implies being able to load from a different location (file://
, https://
, relative
, etc).If you are using MRML and want to be added to this list, don't hesitate to create an issue or open a pull request.
mjml_nif - Elixir library
If you are using MRML and want to be added to this list, don't hesitate to create an issue or open a pull request.
Thanks to zachzurn.