Expand description
HEDL ↔ TOON Conversion
Bidirectional conversion between HEDL documents and TOON (Token-Oriented Object Notation) format.
Uses the official toon-format crate for spec-compliant parsing and serialization.
§Overview
This crate provides conversion between HEDL and TOON using the official TOON parser. TOON is designed for efficient processing by Large Language Models while maintaining human readability.
§Quick Start
use hedl_toon::hedl_to_toon;
use hedl_core::Document;
let hedl = r#"%V:2.0
%NULL:~
%QUOTE:"
%S:User:[id, name]
---
users:@User
|u1, Alice
|u2, Bob
"#;
let doc = hedl_core::parse(hedl.as_bytes())?;
let toon = hedl_to_toon(&doc)?;
println!("{}", toon);TOON Spec: https://github.com/toon-format/spec
Structs§
- From
Toon Config - Configuration for TOON parsing
- ToToon
Config - Configuration for HEDL to TOON conversion
- ToToon
Config Builder - Builder for ToToonConfig
Enums§
Constants§
- MAX_
NESTING_ DEPTH - Maximum nesting depth allowed (security limit)
Functions§
- from_
toon - Parse TOON string to HEDL Document
- from_
toon_ with_ config - Parse TOON string to HEDL Document with configuration
- hedl_
to_ toon - Convert HEDL document to TOON string with default configuration
- to_toon
- Convert HEDL document to TOON string
- toon_
to_ hedl - Parse TOON string to HEDL document
Type Aliases§
- Result
- Result type for TOON operations