Kotoba.Nodes.Unknown (Kotoba v0.5.0)

Copy Markdown View Source

A node of a type that is not in the node registry.

Kotoba.Document.parse/2 keeps the JSON map of the node in raw, with its children, and to_json/1 returns it with no change. Kotoba does not read the children of an unknown node.

Summary

Functions

Builds an unknown node from its JSON map.

Returns the JSON map of the node.

Types

t()

@type t() :: %Kotoba.Nodes.Unknown{raw: map(), type: String.t()}

Functions

from_json(json)

@spec from_json(map()) :: t()

Builds an unknown node from its JSON map.

to_json(unknown)

@spec to_json(t()) :: map()

Returns the JSON map of the node.