Functions
init_kida
3
Environment
▼
Initialize Kida as the template engine for a Flask app.
Replaces Flask's defau…
init_kida
3
Environment
▼
def init_kida(app: Any, *, template_folder: str | None = None, **env_kwargs: Any) -> Environment
Initialize Kida as the template engine for a Flask app.
Replaces Flask's default Jinja2 environment with Kida. Templates are loaded from the app's template folder.
Parameters
| Name | Type | Description |
|---|---|---|
app |
Any |
Flask application instance. |
template_folder |
str | None |
Override for template directory. Defaults to None
|
**env_kwargs |
Any |
Returns
Environment
render_template
2
str
▼
Render a template using the current app's Kida environment.
Call this from a F…
render_template
2
str
▼
def render_template(template_name: str, **context: Any) -> str
Render a template using the current app's Kida environment.
Call this from a Flask request context. Requiresinit_kida()
to have been called on the app.
Parameters
| Name | Type | Description |
|---|---|---|
template_name |
str |
Name of the template to render. **context: Template context variables. |
**context |
Any |
Returns
str