-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jérémie Drouet <[email protected]>
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,22 @@ | ||
# mrml-python | ||
|
||
This project is a reimplementation of the nice `MJML` markup language in Rust, built for python. | ||
|
||
To have more information, take a look at [the repository](https://github.com/jdrouet/mrml). | ||
|
||
## Usage in python | ||
|
||
```python | ||
import mrml | ||
|
||
# without options | ||
result = mrml.to_html("<mjml></mjml>") | ||
assert result.startswith("<!doctype html>") | ||
|
||
# with options | ||
parser_options = mrml.ParserOptions(include_loader = mrml.memory_loader({ | ||
'hello-world.mjml': '<mj-text>Hello World!</mj-text>', | ||
})) | ||
result = mrml.to_html("<mjml><mj-body><mj-include path=\"hello-world.mjml\" /></mj-body></mjml>", parser_options = parser_options) | ||
assert result.startswith("<!doctype html>") | ||
``` |