Skip to main content

template

Macro template 

Source
macro_rules! template {
    (backend = $backend:literal, $path:literal) => { ... };
    ($path:literal) => { ... };
}
Expand description

Associate package-relative HTML with this ordinary Rust module.

The include path below is a contract with fusor-build, which writes the file and, in app::includes, exempts this shape from disabling development refresh. Change them together.

compile_app() compiles the default entry (web/index.html), reusable templates discovered under web/components/, and configured sources before macro expansion. HTML for this mode contains no Rust script. Generated impls stay in this lexical scope, including access to private state and imports. Call once per HTML file. Multiple component declarations in one file share this module. Use / separators and the exact configured package-relative path.