environment
Tools and classes for managing the Jinja2 rendering environment.
Classes¶
InheritanceLoader
¶
InheritanceLoader(inheritance_map: InheritanceMap)
InheritanceRef
dataclass
¶
InheritanceRef(name: str, index: int = 0)
A parsed reference to one rung of a template’s inheritance chain.
InheritanceLoader addresses a specific ancestor of a template with an
"{index}/{name}" string (e.g. "2/a.txt"); this is the value object for that string.
SuperUndefined
¶
Functions:¶
load_environment
¶
load_environment(
template_map: Optional[InheritanceMap] = None,
extensions: Optional[list] = None,
) -> Environment
Load the Jinja2 template environment.
| PARAMETER | DESCRIPTION |
|---|---|
template_map
|
The template inheritance used to load the templates
TYPE:
|
extensions
|
A list of Jinja extensions to load into the environment
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Environment
|
The Jinja environment |