This directory contains a lot of different examples that use the MiniJinja
engine. Each example is in one directory from where you can run them with
the cargo run
command. Alternatively you can do cargo run -p example-name
.
- autoreload: shows how to use auto reloading.
- build-script: Demonstrates how to generate Rust code with MiniJinja in build scripts.
- debug: contains an example showing the built-in
debug()
function. - dynamic: demonstrates how to use dynamic objects in templates.
- error: shows the built-in error reporting support.
- expr: demonstrates the expression evaluation support.
- filters: Shows how to write and use custom filters and global functions.
- generate-yaml: renders YAML files from Jinja templates.
- hello: minimal Hello World example.
- inheritance: demonstrates how to use template inheritance.
- loader: shows how to load templates dynamically at runtime.
- macros: Demonstrates how to use macros and imports.
- minimal: a Hello World example without default features.
- recursive-for: demonstrates the recursive for loop.
- render-macro: minimal Hello World example using the
render!
macro. - render-template: CLI app that renders templates from string.
- source: Demonstrates how to load templates from disk with the
source
feature.