class

Hwaro::Utils::FrontmatterWriter::TomlBuilder

Inherits Reference < Object

Emits a TOML document body (no +++ fences) from a parsed frontmatter tree: scalars first, then [table] sections, then [[array-of-table]] sections, preserving source key order within each group.

Constructors

new(omit_null_keys : Set(String) = Set(String).new)

omit_null_keys: TOP-LEVEL keys dropped when their value is null. TOML has no null, so a null is otherwise written as "" — which keeps the key declared (it still shadows a section [cascade]) and matches what the build makes of a null custom/extra value. For a key whose "" is a meaningful SET value (slug = "" collides with the section index) a caller can name it here instead.

Source

Instance methods

build(yaml : YAML::Any) : String
Source
build(fields : Hash(String, YAML::Any)) : String

Convenience for callers holding a string-keyed field map (exporters).

Source