moonrockz/diagrams-svg/writer

Types

Node

pub(all) enum Node {
  Element(String, ReadOnlyArray[(String, String)], ReadOnlyArray[Node])
  Text(String)
} derive(Eq, @moonbitlang/core/debug.Debug)

A node of an XML document.

Source

Node::equal

fn Node::equal(Node, Node) -> Bool

Source

Node::not_equal

fn Node::not_equal(x : Node, y : Node) -> Bool

Source

Node::to_repr

fn Node::to_repr(Node) -> @moonbitlang/core/debug.Repr

Source

Values

element

fn element(name : String, attrs? : ArrayView[(String, String)], children? : ArrayView[Node]) -> Node

An element with the name name, its attributes in order and its children.

Source

text

fn text(content : String) -> Node

A text node.

Source

to_string

fn to_string(node : Node) -> String

The XML text of node. An element with only text children is on one line. Child elements are on their own lines with two spaces of indentation for each level. The text ends with a line break.

Source