Skip to main content

render

Function render 

Source
pub fn render(view_path: &str, state: &Value) -> Result<String>
Expand description

Render a Spark component template with the given JSON state as context.

Uses the cached process-wide [SHARED_ENV] in production for zero per-call function-registration cost. In reload mode (SPARK_TEMPLATE_RELOAD=true or non-production APP_ENV), builds a fresh env each call so template edits land immediately.

@extends / @include references resolve via the MiniJinja loader, which calls back into [load_for_minijinja] for each name.