Kuddle.V2 (Kuddle v1.0.0) View Source

This is the V2 interface which handles KDL2 documents, if you need the older encoder and encoder, see the V1 module instead.

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")
Link to this function

encode(doc, options \\ [])

View Source

Specs

encode(document(), Keyword.t()) :: {: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"])