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.
Node::equal
fn Node::equal(Node, Node) -> BoolNode::not_equal
fn Node::not_equal(x : Node, y : Node) -> BoolNode::to_repr
fn Node::to_repr(Node) -> @moonbitlang/core/debug.ReprValues
element
fn element(name : String, attrs? : ArrayView[(String, String)], children? : ArrayView[Node]) -> NodeAn element with the name name, its attributes in order and its children.
text
fn text(content : String) -> NodeA text node.
to_string
fn to_string(node : Node) -> StringThe 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.