MCPcopy Index your code
hub / github.com/dtolnay/include-json

github.com/dtolnay/include-json @0.1.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.1.2 ↗ · + Follow
9 symbols 11 edges 6 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

include_json!

github crates.io docs.rs build status

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());
}

License

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.

Core symbols most depended-on inside this repo

do_include_json
called by 1
src/lib.rs
include_json
called by 0
src/lib.rs
to_tokens
called by 0
src/lib.rs
main
called by 0
tests/ui/no_such_file.rs
main
called by 0
tests/ui/invalid_json.rs
main
called by 0
tests/ui/relative_path.rs

Shape

Function 7
Class 1
Method 1

Languages

Rust100%

Modules by API surface

src/lib.rs4 symbols
tests/ui/relative_path.rs1 symbols
tests/ui/no_such_file.rs1 symbols
tests/ui/invalid_json.rs1 symbols
tests/test.rs1 symbols
tests/compiletest.rs1 symbols

For agents

$ claude mcp add include-json \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact