Kuddle (Kuddle v1.0.0) View Source

Kuddle is a KDL (https://github.com/kdl-org/kdl) encoder and decoder.

It is compliant with both the 1.x and 2.x specifications, simply use the appropriately versioned module for your needs.

And yes UTF-8 still works.

V2 is the default.

Link to this section Summary

Functions

Decode a KDL document into kuddle nodes

Encode a kuddle document as serialized KDL

Select allows searching a document for particular nodes by name, and or attributes.

Link to this section Types

Link to this section Functions

Specs

decode(String.t()) :: {:ok, document(), rest :: String.t()} | {:error, term()}

Decode a KDL document into kuddle nodes

Usage:

[%Node{name: "node"}] = Kuddle.decode("node")

Specs

encode(document()) :: {:ok, String.t()} | {:error, term()}

Encode a kuddle document as serialized KDL

Usage:

"node" = Kuddle.encode([%Node{name: "node"}])

Specs

select(document(), Kuddle.Path.path()) :: document()

Select allows searching a document for particular nodes by name, and or attributes.

Usage:

[%Node{name: "node"}] = Kuddle.select(document, ["node"])