12 releases (breaking)
new 0.30.2 | Jan 28, 2023 |
---|---|
0.29.0 | Jan 14, 2023 |
0.27.0 | Dec 11, 2022 |
0.26.0 | Nov 11, 2022 |
#49 in Template engine
522 downloads per month
510KB
10K
SLoC
MiniJinja-Autoreload
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.
use minijinja_autoreload::AutoReloader;
use minijinja::{Source, Environment};
let reloader = AutoReloader::new(|notifier| {
let mut env = Environment::new();
let template_path = "path/to/templates";
notifier.watch_path(template_path, true);
env.set_source(Source::from_path(template_path));
Ok(env)
});
let env = reloader.acquire_env()?;
let tmpl = env.get_template("index.html")?;
For an example have a look at the autoreload example.
Sponsor
If you like the project and find it useful you can become a sponsor.
License and Links
- Documentation
- Issue Tracker
- License: Apache-2.0
Dependencies
~0.1–4MB
~62K SLoC