THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
Jinja2-based implementation of IViewEngine.
Converts dot-notation template names to filesystem paths and delegates all rendering to Jinja2's async rendering pipeline (render_async). The synchronous render method of Jinja2 is never called from this class.
| Static Method | _normalise |
Convert a template identifier to a Jinja2-loader-compatible path. |
| Method | __init__ |
Initialise the engine with the configured view environment. |
| Async Method | render |
Render a template asynchronously using Jinja2. |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | _environment |
Undocumented |
| Instance Variable | _jinja |
Undocumented |
Convert a template identifier to a Jinja2-loader-compatible path.
Rules applied in order
- If the identifier already contains / it is treated as a direct path and returned unchanged (except for extension injection).
- Otherwise dot separators are converted to slashes.
- A '.html' extension is appended when no file extension is present.
| Parameters | |
template:str | Raw template identifier supplied by the caller. |
| Returns | |
str | Normalised template path suitable for
jinja2.Environment.get_template. |
Initialise the engine with the configured view environment.
| Parameters | |
environment:IViewEnvironment | View environment providing the configured Jinja2
Environment instance. |
| Returns | |
None | Undocumented |
Render a template asynchronously using Jinja2.
Dot-notation identifiers are converted to slash-delimited paths with a .html suffix automatically appended when the name carries no extension (e.g. 'users.index' → 'users/index.html').
| Parameters | |
template:str | Template identifier using dot notation or a direct relative path. A .html suffix is appended when absent. |
context:dict[str, Any] | Variables made available inside the template during rendering. |
| Returns | |
str | Rendered HTML string. |
| Raises | |
ViewTemplateNotFoundException | When the template file cannot be located by the configured loaders. |
ViewRenderException | When Jinja2 raises any error during rendering. |