jason_rs/lib.rs
1
2//! # jason-RS
3//!
4//! [](https://crates.io/crates/jason-rs)
5//! [](https://docs.rs/jason-rs)
6//! [](LICENSE)
7//!
8//! **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.
9//!
10//! ## Features
11//!
12//! - Template Parameters — Define reusable templates with named parameters
13//! - File Inclusion — Compose JSON from multiple `.jason` files
14//! - 1:1 Conversion — Clean mapping from `.jason` syntax to standard JSON
15//! - Library-First — Designed for seamless integration into Rust projects
16//!
17//! ## Usage
18//!
19//! Add `jason-rs` to your `Cargo.toml`:
20//!
21//! ```toml
22//! [dependencies]
23//! jason-rs = "0.1"
24//! ```
25//!
26//! Parse a Jason file to JSON:
27//!
28//! ```rust
29//! use jason_rs::jason_to_json;
30//!
31//! fn main() {
32//! let json = jason_to_json("./Page.jason").unwrap();
33//! println!("{}", json);
34//! }
35//! ```
36//!
37//! ## Syntax Overview
38//!
39//! | Syntax | Description |
40//! |--------|-------------|
41//! | `(param1, param2)` | Define template parameters |
42//! | `#param` | Reference a parameter value |
43//! | `<./File.jason>` | Include another Jason file |
44//! | `<./File.jason \| arg1, arg2>` | Include with arguments |
45//!
46//! Parses a `.jason` file at the given path and returns the resulting JSON as a `String`.
47
48/// The `jason` module contains all public functions for converting `.jason` files
49/// into JSON, YAML, or TOML.
50
51pub mod jason;
52
53pub use jason::*;
54