pyfcstm.render.env
Jinja2 Environment Module
This module provides functionality for creating and configuring a Jinja2 environment for template rendering. It sets up global variables and adds custom settings to the environment to support state machine template rendering.
create_env
- pyfcstm.render.env.create_env()[source]
Create and configure a Jinja2 environment for template rendering.
This function initializes a Jinja2 Environment instance, adds custom settings through the add_settings_for_env utility, and sets up global variables for state machine templates including initial and exit states.
- Returns:
A configured Jinja2 Environment instance
- Return type:
jinja2.Environment
Example:
>>> env = create_env() >>> template = env.from_string("Initial state: {{ INIT_STATE }}") >>> rendered = template.render()