-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmjml.pyi
27 lines (21 loc) · 799 Bytes
/
mjml.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from typing import Optional, Dict, Protocol
class IncludeLoader(Protocol):
def __call__(self, path: str) -> str: ...
def mjml2html(
input: str,
*,
disable_comments: bool = False,
social_icon_origin: Optional[str] = None,
fonts: Optional[Dict[str, str]] = None,
include_loader: Optional[IncludeLoader] = None,
) -> str:
"""Convert MJML string to HTML string.
Params:
- input: The input MJML string
- disable_comments: Strip comments out of rendered HTML
- social_icon_origin: Custom URL origin for social icons. Icon name is appended
(e.g. `facebook.png`).
- fonts: Fonts imported in the HTML rendered by MJML.
- include_loader: Fetch the included template using the path attribute.
Returns: the rendered HTML string.
"""