Templating#
- class fitrequest.templating.KeepPlaceholderUndefined(hint: str | None = None, obj: ~typing.Any = missing, name: str | None = None, exc: ~typing.Type[~jinja2.exceptions.TemplateRuntimeError] = <class 'jinja2.exceptions.UndefinedError'>)[source]#
Bases:
UndefinedCustom Jinja2 Undefined class that preserves undefined variables in the rendered output using placeholder syntax.
Instead of replacing undefined variables with an empty string or raising an error, this class returns the variable name wrapped in delimiters, matching the environment’s variable start and end strings.
- This is useful for:
Debugging template output with missing variables.
Partial rendering where some variables are intentionally left unresolved.
- fitrequest.templating.jinja_env: Environment#
Custom Jinja2 environment tailored for safe and partial rendering of docstring templates.