- Index
- »
- fan.fandoc
- »
- DocNode
DocNode
@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.
Get the DocElem that contains this node
Return true if this node is the first child in its parent
Get the path from the root of the DOM to this node
Is this a block element versus an inline element
Return true if this node is the last child in its parent
Get the index of this node in its parent's children
Is this an inline versus a block node
Debug dump to output stream
Get node id for node type
Write this node to the specified DocWriter
Get all the DocText children as a string
Void dump(OutStream out)
Debug dump to output stream.
abstract DocNodeId id()
Get node id for node type.
Bool isBlock()
Is this a block element versus an inline element.
Bool isFirst()
Return true if this node is the first child in its parent.
abstract Bool isInline()
Is this an inline versus a block node.
Bool isLast()
Return true if this node is the last child in its parent.
DocElem? : parent
Get the DocElem that contains this node. Return null if not parented.
virtual DocNode[] path()
Get the path from the root of the DOM to this node.
Int? pos()
Get the index of this node in its parent's children. Return null if not parented.
abstract Str toText()
Get all the DocText children as a string
abstract Void write(DocWriter out)
Write this node to the specified DocWriter.