Functions
init_kida
3
Environment
▼
Initialize Kida rendering for a Flask app without replacing Jinja.
Registers a…
init_kida
3
Environment
▼
def init_kida(app: Any, *, template_folder: str | None = None, **env_kwargs: Any) -> Environment
Initialize Kida rendering for a Flask app without replacing Jinja.
Registers a Kida environment and render helper on the app. Templates are loaded from the app's template folder; Flask's Jinja environment is not replaced.
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