include_json!Rust macro to parse a JSON file at compile time and compile it into the program
as a serde_json::Value.
Example — supplying a JSON file as context inside a MiniJinja template:
use include_json::include_json;
fn main() {
let pkg = include_json!(concat!(env!("CARGO_MANIFEST_DIR"), "/package.json"));
let mut env = minijinja::Environment::new();
env.add_template("example", include_str!("example.jinja")).unwrap();
let tmpl = env.get_template("example").unwrap();
println!("{}", tmpl.render(minijinja::context!(pkg)).unwrap());
}
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
$ claude mcp add include-json \
-- python -m otcore.mcp_server <graph>