Expand description
§jason-RS
jason is a lightweight JSON templating tool that transforms reusable .jason template files into standard JSON. Build modular and composable JSON structures with parameter support and file inclusion.
§Features
- Template Parameters — Define reusable templates with named parameters
- File Inclusion — Compose JSON from multiple
.jasonfiles - 1:1 Conversion — Clean mapping from
.jasonsyntax to standard JSON - Library-First — Designed for seamless integration into Rust projects
§Usage
Add jason-rs to your Cargo.toml:
[dependencies]
jason-rs = "0.1"Parse a Jason file to JSON:
use jason_rs::jason_to_json;
fn main() {
let json = jason_to_json("./Page.jason").unwrap();
println!("{}", json);
}§Syntax Overview
| Syntax | Description |
|---|---|
(param1, param2) | Define template parameters |
#param | Reference a parameter value |
<./File.jason> | Include another Jason file |
<./File.jason | arg1, arg2> | Include with arguments |
Parses a .jason file at the given path and returns the resulting JSON as a String.
Re-exports§
pub use jason::*;
Modules§
- jason
- The
jasonmodule contains all public functions for converting.jasonfiles into JSON, YAML, or TOML.