kdleam

日本語

kdleam parses, serializes, normalizes, and builds KDL v2 documents in Gleam.

Install

gleam add kdleam

Usage

import kdleam
import kdleam/document

pub fn main() {
  let assert Ok(doc) = kdleam.parse("node \"hello\" flag=#true\n")
  let assert Some(node) = document.first_node(doc)
  let assert Some("hello") = document.first_string_arg(node)
  kdleam.serialize(doc)
}

Public modules

Targets

The same public API is available on the Erlang and JavaScript backends.

Limitations

The input format is KDL v2. Numbers retain their raw representation. An Int or Float is available only when that value can be represented.

License

MIT

Search Document