Documentation
¶
Overview ¶
Package toon is an encode-only implementation of TOON (Token-Oriented Object Notation), spec v3.3 (https://github.com/toon-format/spec).
TOON is a line-oriented, indentation-based text format for the JSON data model. Compared with JSON it drops most punctuation (braces, brackets around every array element, quotes around most strings) and encodes arrays of uniform objects as a compact table with a single field header instead of repeating keys on every row. The result is a representation that costs far fewer tokens to feed to an LLM while remaining unambiguous and deterministic.
Only encoding is implemented; there is no decoder — the format targets LLM consumers, which read it natively.
Values are first interpreted using encoding/json semantics — json struct tags and custom json.Marshaler implementations are honored — then rendered as TOON. Anything that marshals correctly to JSON marshals correctly to TOON, with object key order and full number precision preserved.
Index ¶
Constants ¶
const MediaType = "text/toon"
MediaType is the provisional media type for TOON.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.