Simplewiki
1.1
|
The parser creates a document tree (document object model) consisting of these nodes to debug the contents of a node, use var_dump($node->get_display_list()), which avoids parent and children nodes. More...
Public Member Functions | |
__construct ($type, $parent=NULL) | |
Create new node. | |
get_display_list () | |
For debug: Returns a clone of properties, leaving out parent and children properties. | |
Data Fields | |
Types of nodes | |
const | DOCUMENT = 'document' |
Document node. | |
const | TEXT = 'text' |
Text node. | |
const | PARAGRAPH = 'paragraph' |
Paragraph node (<p>). | |
const | HEADING = 'heading' |
Heading node (<h1-6>). | |
const | EMPHASIS = 'emphasis' |
Emphasis node (<em>). | |
const | STRONG = 'strong' |
Strong node (<strong>). | |
const | LINEBREAK = 'linebreak' |
Linebreak node (<br />). | |
const | HORIZONTALRULE = 'horizontalrule' |
Horizontal rule node (<hr />). | |
const | LINK = 'link' |
Link node (<a>). | |
const | IMAGE = 'image' |
Image node (<img />). | |
const | ORDERED_LIST = 'ordered_list' |
Ordered list node (<ol>). | |
const | UNORDERED_LIST = 'unordered_list' |
Unordered list node (<ul>). | |
const | LIST_ITEM = 'list_item' |
List item node (<li>). | |
const | DEF_LIST = 'def_list' |
Definition list node (<dl>). | |
const | DEF_TERM = 'def_term' |
Definition term node (<dt>). | |
const | DEF_DESC = 'def_desc' |
Definition description node (<dd>). | |
const | TABLE = 'table' |
Table node (<table>). | |
const | TABLE_ROW = 'table_row' |
Table row node (<tr>). | |
const | TABLE_HEADCELL = 'table_headcell' |
Table headcell node (<th>). | |
const | TABLE_CELL = 'table_cell' |
Table data cell node (<td>). | |
const | SPAN = 'span' |
Span node (<span>). | |
const | BLOCKDIVIDER = 'blockdivider' |
Blockdivider node (<div></div>). | |
const | CODE = 'code' |
Code node (<code>). | |
const | PREFORMATTED = 'preformatted' |
Preformatted node (<pre>). | |
const | BLOCKDEF = 'blockdef' |
Blockdef node (various). | |
const | MACRO = 'macro' |
Macro definition. | |
Standard node properties | |
$parent | |
A parent node in the document tree. | |
$children | |
array of child nodes - used to emit content | |
$type | |
holds the type of node - See constants for types | |
Protected Member Functions | |
child_append ($child) | |
Add child to children list. | |
The parser creates a document tree (document object model) consisting of these nodes to debug the contents of a node, use var_dump($node->get_display_list()), which avoids parent and children nodes.
Definition at line 18 of file docnode.php.
__construct | ( | $type, | |
$parent = NULL |
|||
) |
Create new node.
initialized children array, sets type and parent, and adds to parent children list.
string | $type | selected from one of the class constants |
object | $parent | the parent of the node. |
Definition at line 355 of file docnode.php.
|
protected |
Add child to children list.
Children emit output as content for the current node.
object | $child |
Definition at line 367 of file docnode.php.
get_display_list | ( | ) |
For debug: Returns a clone of properties, leaving out parent and children properties.
Definition at line 373 of file docnode.php.
$children |
array of child nodes - used to emit content
Definition at line 345 of file docnode.php.
$parent |
A parent node in the document tree.
Definition at line 343 of file docnode.php.
$type |
holds the type of node - See constants for types
Definition at line 347 of file docnode.php.
const BLOCKDEF = 'blockdef' |
Blockdef node (various).
Parsed properties: blocktag, decoration
Added by node emitter: knowntag (can be over-ridden by blockdef handler)
Added by node emitter: opentag_head = "\n<$blocktag", opentag_tail = "/>", closetag = "\n</$blocktag>", elementcontent set by child nodes, unless set by blockdef handler. dl... blocktags changed to xmlns form (dl:tag); unknown blocktag returns markup text.
Added by prepare_node: attributes from decoration, classes, properties as styles
Definition at line 324 of file docnode.php.
const BLOCKDIVIDER = 'blockdivider' |
Blockdivider node (<div></div>).
Parsed properties: decoration
Added by node emitter: opentag_head = "\n<div", opentag_tail = "/>", closetag = "\n</div>", elementcontent = ''
Added by prepare_node: attributes from decoration, classes, properties as styles
Definition at line 281 of file docnode.php.
const CODE = 'code' |
Code node (<code>).
Parsed properties: textcontent, decoration
Added by node emitter: opentag_head = "\n<code", opentag_tail = "/>", closetag = "\n</code>", elementcontent = textcontent (encoded if escapecontent)
escapecontent = TRUE, may get altered by callout
Added by prepare_node: attributes from decoration, classes, properties as styles
Definition at line 295 of file docnode.php.
const DEF_DESC = 'def_desc' |
Definition description node (<dd>).
Parsed properties: decoration
Added by node emitter: opentag_head = "\n<dd", opentag_tail = "/>", closetag = "\n</dd>", elementcontent set from child emitters
Added by prepare_node: attributes from decoration, classes, properties as styles
Definition at line 211 of file docnode.php.
const DEF_LIST = 'def_list' |
Definition list node (<dl>).
Parsed properties: level, decoration
Added by node emitter: opentag_head = "\n<dl", opentag_tail = "/>", closetag = "\n</dl>", elementcontent set from child emitters
Added by prepare_node: attributes from decoration, classes, properties as styles
Definition at line 187 of file docnode.php.
const DEF_TERM = 'def_term' |
Definition term node (<dt>).
Parsed properties: decoration
Added by node emitter: opentag_head = "\n<dt", opentag_tail = "/>", closetag = "\n</dt>", elementcontent set from child emitters
Added by prepare_node: attributes from decoration, classes, properties as styles
Definition at line 199 of file docnode.php.
const DOCUMENT = 'document' |
Document node.
The root node. No parsed properties
Added by node emitter: opentag_head = '', closetag = '', elementcontent set from child emitters
Definition at line 27 of file docnode.php.
const EMPHASIS = 'emphasis' |
Emphasis node (<em>).
No parsed properties.
Definition at line 73 of file docnode.php.
const HEADING = 'heading' |
Heading node (<h1-6>).
Parsed properties: level, decoration
Added by prepare_node: attributes from decoration, classes, properties as styles
Added by node emitter: opentag_head = "\n<h" + level, opentag_tail = ">", closetag = "</h" + level + ">", elementcontent set from child emitters
Definition at line 64 of file docnode.php.
const HORIZONTALRULE = 'horizontalrule' |
Horizontal rule node (<hr />).
No parsed properties
Definition at line 97 of file docnode.php.
const IMAGE = 'image' |
Image node (<img />).
Parsed properties: target, title, decoration
Added by node emitter: linkparts->internaladdress, linkparts->symlink, linkparts->internalselector, linkparts->externaladdress, linkparts->externalprotocol, linkparts->externalselector, linkparts->rawlink, linkparts->rawlinkaddress
Added by node emitter: opentag_head = "\n<img", opentag_tail = "/>", caption set from child emitters
Added by registered symlinks: linkparts->symlinkpath (or must be added by registered symlink handler)
Added by prepare_image_node: attributes from decoration, classes, properties as styles
Definition at line 139 of file docnode.php.
const LINEBREAK = 'linebreak' |
Linebreak node (<br />).
No parsed properties
Definition at line 89 of file docnode.php.
const LINK = 'link' |
Link node (<a>).
Parsed properties: target, title, decoration
Added by node emitter: linkparts->anchor, linkparts->internaladdress, linkparts->symlink, linkparts->internalselector, linkparts->internalversion, linkparts->symlinkpath (set by handlers), linkparts->externaladdress, linkparts->externalprotocol, linkparts->externalselector, linkparts->rawlink, linkparts->rawlinkaddress (set by handlers)
Added by node emitter: opentag_head = "\n<a", opentag_tail = ">", closetag = "</a>", caption set from child emitters
Added by node emitter: unknown = FALSE; set to TRUE if link doesn't parse, and symlink/rawlink handlers absent. If set to true, causes link to appear underlined and appended with superscript "?"
caption set by target if both caption and linkparts->anchor are empty
Added by registered symlinks: linkparts->symlinkpath (or must be added by registered symlink handler)
Added by registered rawlink handler: linkparts->rawlinkaddress
elementcontent set by caption
Added by prepare_link_node: linkparts->anchor ("#" stripped out if linkparts->anchor is set, and caption is empty)
Definition at line 122 of file docnode.php.
const LIST_ITEM = 'list_item' |
List item node (<li>).
Parsed properties: decoration
Added by node emitter: opentag_head = "\n<li", opentag_tail = "/>", closetag = "\n</li>", elementcontent set from child emitters
Added by prepare_node: attributes from decoration, classes, properties as styles
Definition at line 175 of file docnode.php.
const MACRO = 'macro' |
Macro definition.
parsed properties: macroname, textcontent, decoration.
added by node emitter: processed. Automatically set to TRUE if a macro processor found, otherwise set to false for internal processing control (error).
added by macro: output. If output is not set, caption is used for text output if available.
Definition at line 338 of file docnode.php.
const ORDERED_LIST = 'ordered_list' |
Ordered list node (<ol>).
Parsed properties: level, decoration ($rules->list)
Added by node emitter: opentag_head = "\n<ol", opentag_tail = "/>", closetag = "\n</ol>", elementcontent set from child emitters
Added by prepare_node: attributes from decoration, classes, properties as styles
Definition at line 151 of file docnode.php.
const PARAGRAPH = 'paragraph' |
Paragraph node (<p>).
Parsed properties: decoration
Added by node emitter: opentag_head = "\n<p", opentag_tail = ">", closetag = "</p>", elementcontent set from child emitters
Added by prepare_node: attributes from decoration, classes, properties as styles
Definition at line 51 of file docnode.php.
const PREFORMATTED = 'preformatted' |
Preformatted node (<pre>).
Parsed properties: textcontent, decoration
Added by node emitter: opentag_head = "\n<pre", opentag_tail = "/>", closetag = "\n</pre>", elementcontent = textcontent (encoded if escapecontent)
escapecontent = TRUE, may get altered by callout
Added by prepare_node: attributes from decoration, classes, properties as styles
Definition at line 309 of file docnode.php.
const SPAN = 'span' |
Span node (<span>).
Parsed properties: decoration
Added by node emitter: opentag_head = "\n<span", opentag_tail = "/>", closetag = "\n</span>", elementcontent set from child emitters
Added by prepare_node: attributes from decoration, classes, properties as styles
Definition at line 269 of file docnode.php.
const STRONG = 'strong' |
Strong node (<strong>).
No parsed properties
Definition at line 81 of file docnode.php.
const TABLE = 'table' |
Table node (<table>).
Parsed properties: decoration
Added by node emitter: opentag_head = "\n<table", opentag_tail = "/>", closetag = "\n</table>", elementcontent set from child emitters
Added by prepare_node: attributes from decoration, classes, properties as styles
Definition at line 223 of file docnode.php.
const TABLE_CELL = 'table_cell' |
Table data cell node (<td>).
Parsed properties: decoration
Added by node emitter: opentag_head = "\n<td", opentag_tail = "/>", closetag = "\n</td>", elementcontent set from child emitters
Added by prepare_node: attributes from decoration, classes, properties as styles
Definition at line 257 of file docnode.php.
const TABLE_HEADCELL = 'table_headcell' |
Table headcell node (<th>).
Parsed properties: decoration
Added by node emitter: opentag_head = "\n<tr", opentag_tail = "/>", closetag = "\n</tr>", elementcontent set from child emitters
Added by prepare_node: attributes from decoration, classes, properties as styles
Definition at line 245 of file docnode.php.
const TABLE_ROW = 'table_row' |
Table row node (<tr>).
Parsed properties: decoration
Added by prepare_node: attributes from decoration, classes, properties as styles
Definition at line 233 of file docnode.php.
const TEXT = 'text' |
Text node.
No html markup.
Parsed properties: textcontent
Definition at line 38 of file docnode.php.
const UNORDERED_LIST = 'unordered_list' |
Unordered list node (<ul>).
Parsed properties: level, decoration
Added by node emitter: opentag_head = "\n<ul", opentag_tail = "/>", closetag = "\n</ul>", elementcontent set from child emitters
Added by prepare_node: attributes from decoration, classes, properties as styles
Definition at line 163 of file docnode.php.