Module

templating.integration

Kida environment setup and app binding.

Creates a kida Environment from chirp's AppConfig and binds user-registered filters and globals. The environment is created once during App._freeze() and passed through the request pipeline.

Functions

create_environment 3 Environment
Create a kida Environment from app configuration. Called once during ``App._fr…
def create_environment(config: AppConfig, filters: dict[str, Callable[..., Any]], globals_: dict[str, Any]) -> Environment

Create a kida Environment from app configuration.

Called once duringApp._freeze(). The returned environment is immutable for the lifetime of the app.

Parameters
Name Type Description
config AppConfig
filters dict[str, Callable[..., Any]]
globals_ dict[str, Any]
Returns
Environment
render_template 2 str
Render a full template to string.
def render_template(env: Environment, tpl: Template) -> str
Parameters
Name Type Description
env Environment
tpl Template
Returns
str
render_fragment 2 str
Render a named block from a template to string.
def render_fragment(env: Environment, frag: Fragment) -> str
Parameters
Name Type Description
env Environment
frag Fragment
Returns
str