Functions
_ensure_chirp_ui_filters
1
None
▼
Ensure chirp-ui required filters exist when chirp-ui templates are loadable.
W…
_ensure_chirp_ui_filters
1
None
▼
def _ensure_chirp_ui_filters(env: Environment) -> None
Ensure chirp-ui required filters exist when chirp-ui templates are loadable.
When chirp adds chirp-ui's PackageLoader, those templates require bem, field_errors, html_attrs, validate_variant, validate_variant_block, validate_size, icon. This fallback adds any missing filters so the env is self-consistent. See docs/rfcs/001-component-filter-contract.md.
Parameters
| Name | Type | Description |
|---|---|---|
env |
Environment |
create_environment
4
Environment
▼
Create a kida Environment from app configuration.
Called once during ``App._fr…
create_environment
4
Environment
▼
def create_environment(config: AppConfig, filters: dict[str, Callable[..., Any]], globals_: dict[str, Any], plugin_loaders: list | None = None) -> Environment
Create a kida Environment from app configuration.
Called once duringApp._freeze(). The returned environment
is immutable for the lifetime of the app.
Supports multiple template directories viaconfig.component_dirs
for component libraries, partials, and shared templates.
Extra loaders (CMS, DB, state) are tried first when configured.
Parameters
| Name | Type | Description |
|---|---|---|
config |
AppConfig |
|
filters |
dict[str, Callable[..., Any]] |
|
globals_ |
dict[str, Any] |
|
plugin_loaders |
list | None |
Default:None
|
Returns
Environment
render_template
2
str
▼
Render a full template to string.
render_template
2
str
▼
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.
render_fragment
2
str
▼
def render_fragment(env: Environment, frag: Fragment) -> str
Parameters
| Name | Type | Description |
|---|---|---|
env |
Environment |
|
frag |
Fragment |
Returns
str