Skip to main content

template_function

Attribute Macro template_function 

Source
#[template_function]
Expand description

Registers a function as a named MiniJinja template function.

ยงSyntax

#[template_function]               // uses the Rust function name
#[template_function(name = "fn_name")]  // explicit template name

The function is submitted via inventory and registered into the MiniJinja environment when the TemplateEngine service starts.

Requires the templates feature on modo.