type

DocNode

src @Js
abstract class DocNode : Obj

DocNode is the base class for nodes in a fandoc model. There are two type of nodes: DocElem and DocText.

See pod doc for usage.

fields

parent

Get the DocElem that contains this node.

methods

dump

Debug dump to output stream.

id

Get node id for node type.

isBlock

Is this a block element versus an inline element.

isFirst

Return true if this node is the first child in its parent.

isInline

Is this an inline versus a block node.

isLast

Return true if this node is the last child in its parent.

path

Get the path from the root of the DOM to this node.

pos

Get the index of this node in its parent's children.

toText

Get all the DocText children as a string

write

Write this node to the specified DocWriter.

Slot Details

dump

src Void dump(OutStream out := Env.cur().out())

Debug dump to output stream.

id

src abstract DocNodeId id()

Get node id for node type.

isBlock

src Bool isBlock()

Is this a block element versus an inline element.

isFirst

src Bool isFirst()

Return true if this node is the first child in its parent.

isInline

src abstract Bool isInline()

Is this an inline versus a block node.

isLast

src Bool isLast()

Return true if this node is the last child in its parent.

parent

src DocElem? parent { internal set }

Get the DocElem that contains this node. Return null if not parented.

path

src virtual DocNode[] path()

Get the path from the root of the DOM to this node.

pos

src Int? pos()

Get the index of this node in its parent's children. Return null if not parented.

toText

src abstract Str toText()

Get all the DocText children as a string

write

src abstract Void write(DocWriter out)

Write this node to the specified DocWriter.