60 releases (32 stable)

2.5.0 Nov 10, 2024
2.2.0 Aug 26, 2024
2.1.1 Jul 31, 2024
1.0.21 Apr 24, 2024
0.26.0 Nov 11, 2022

#560 in Template engine

Download history 458/week @ 2024-08-17 595/week @ 2024-08-24 327/week @ 2024-08-31 566/week @ 2024-09-07 682/week @ 2024-09-14 594/week @ 2024-09-21 607/week @ 2024-09-28 355/week @ 2024-10-05 301/week @ 2024-10-12 456/week @ 2024-10-19 428/week @ 2024-10-26 448/week @ 2024-11-02 545/week @ 2024-11-09 557/week @ 2024-11-16 253/week @ 2024-11-23 887/week @ 2024-11-30

2,315 downloads per month
Used in 2 crates

Apache-2.0

715KB
14K SLoC

MiniJinja-Autoreload

Build Status License Crates.io rustc 1.63.0 Documentation

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.

Dependencies

~0.1–7MB
~48K SLoC