Render a mustache template.
Renders a mustache template with a data scope and inline partial capability.
render(
template: str | list[tuple[str, str]] = '',
data: Mapping[str, Any] = EMPTY_DICT,
partials_dict: Mapping[str, str] = EMPTY_DICT,
padding: str = '',
def_ldel: str = '{{',
def_rdel: str = '}}',
scopes: Scopes | None = None,
warn: bool = False,
keep: bool = False
) -> str| Name | Type | Description |
|---|---|---|
template | str | list[tuple[str, str]] | Default: ''A file-like object or a string containing the template. |
data | Mapping[str, Any] | Default: EMPTY_DICTA python dictionary with your data scope. |
partials_dict | Mapping[str, str] | Default: EMPTY_DICTA python dictionary which will be search for partials before the filesystem is.
|
padding | str | Default: ''This is for padding partials, and shouldn't be used (but can be if you really want to). |
def_ldel | str | Default: '{{'The default left delimiter ( |
def_rdel | str | Default: '}}'The default right delimiter ( |
scopes | Scopes | None | Default: NoneThe list of scopes that |
warn | bool | Default: FalseLog a warning when a template substitution isn't found in the data |
keep | bool | Default: FalseKeep unreplaced tags when a substitution isn't found in the data. |