Crate jason_rs

Crate jason_rs 

Source
Expand description

§jason-RS

Crates.io Docs License

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 .jason files
  • 1:1 Conversion — Clean mapping from .jason syntax 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

SyntaxDescription
(param1, param2)Define template parameters
#paramReference 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 jason module contains all public functions for converting .jason files into JSON, YAML, or TOML.