module documentation
Classes for managing templates and their runtime and compile time options.
Class |
|
The core component of Jinja is the `Environment`. It contains important shared variables like configuration, filters, tests, globals and others. Instances of this class may be modified if they are not shared and if no template was loaded so far... |
Class |
|
A compiled template that can be rendered. |
Class |
|
The :meth:`jinja2.Environment.compile_expression` method returns an instance of this object. It encapsulates the expression-like access to the template with an expression it wraps. |
Class |
|
Represents an imported template. All the exported names of the template are available as attributes on this object. Additionally converting it into a string renders the contents. |
Class |
|
A template stream works pretty much like an ordinary python generator but it can buffer multiple items to reduce the number of total iterations. Per default the output is unbuffered which means that for every unbuffered instruction in the template one string is yielded. |
Function | copy |
Create an empty copy of the given cache. |
Function | create |
Return the cache class for the given size. |
Function | get |
Return a new spontaneous environment. A spontaneous environment is used for templates created directly rather than through an existing environment. |
Function | load |
Load the extensions from the list and bind it to the environment. Returns a dict of instantiated extensions. |
Function | _environment |
Perform a sanity check on the environment. |
Variable | _env |
Undocumented |
Create an empty copy of the given cache.
Parameters | |
cache:t.Optional[ | Undocumented |
Returns | |
t.Optional[ | Undocumented |
Return the cache class for the given size.
Parameters | |
size:int | Undocumented |
Returns | |
t.Optional[ | Undocumented |
Return a new spontaneous environment. A spontaneous environment is used for templates created directly rather than through an existing environment. :param cls: Environment class to create. :param args: Positional arguments passed to environment.
Parameters | |
*args:t.Any | Undocumented |
Returns | |
_env_bound | Undocumented |
Load the extensions from the list and bind it to the environment. Returns a dict of instantiated extensions.
Parameters | |
environment:Environment | Undocumented |
extensions:t.Sequence[ | Undocumented |
Returns | |
t.Dict[ | Undocumented |
Perform a sanity check on the environment.
Parameters | |
environment:Environment | Undocumented |
Returns | |
Environment | Undocumented |