Skip to main content

Module compiler

Module compiler 

Source
Expand description

Compile Forge templates to Askama (compile-time, build.rs path) or to a MiniJinja-compatible runtime form used by Spark.

Functions§

compile_dir
Walk input_dir for *.forge.html and write Askama-compatible *.html files into output_dir, preserving the relative layout.
compile_file
compile_source
compile_source_runtime
Lower a Forge source string into MiniJinja-compatible syntax. Spark directives (@spark, @sparkScripts) emit function calls bound to MiniJinja’s global function table; other directives behave the same as the Askama path for now.
emit_embedded_registry
Walk input_dir for *.forge.html and emit a Rust source file that registers each template’s raw source via inventory::submit! as a spark::template::EmbeddedTemplate. The user includes this from their crate root with: