toon

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package toon implements low-level helpers for the TOON (Token-Oriented Object Notation) text format. Concrete renderers in individual tools (xref, history, ...) compose these primitives to emit their own schema. The format itself is documented at https://github.com/toon-format/toon.

Index

Constants

View Source
const Indent = "  "

Variables

This section is empty.

Functions

func JoinList

func JoinList(items []string) string

JoinList renders []string as a comma-separated TOON inline list with per-item quoting. Empty slices return an empty string.

func NeedsQuote

func NeedsQuote(s string) bool

NeedsQuote reports whether s contains any byte that would clash with TOON's structural characters (or leading/trailing whitespace).

func Scalar

func Scalar(s string) string

Scalar returns a TOON-safe representation of s — bare when possible, otherwise wrapped in double quotes with backslash escapes for the control characters and structural punctuation that TOON cares about.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL