MiniJinja-Autoreload is a utility crate for MiniJinja that adds an abstraction layer that provides auto reloading functionality of environments.
This simplifies fast development cycles without writing custom code.
```rust use minijinja_autoreload::AutoReloader; use minijinja::{Source, Environment};
let reloader = AutoReloader::new(|notifier| { let mut env = Environment::new(); let templatepath = "path/to/templates"; notifier.trackpath(templatepath, true); env.setsource(Source::frompath(templatepath)); Ok(env) });
let env = reloader.acquireenv()?; let tmpl = env.gettemplate("index.html")?; ```
For an example have a look at the autoreload example.
If you like the project and find it useful you can become a sponsor.