Simplewiki  1.1
DocNode Class Reference

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.
 

Detailed Description

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.

Version
1.1
Date
October 22, 2012

Definition at line 18 of file docnode.php.

Constructor & Destructor Documentation

__construct (   $type,
  $parent = NULL 
)

Create new node.

initialized children array, sets type and parent, and adds to parent children list.

Parameters
string$typeselected from one of the class constants
object$parentthe parent of the node.

Definition at line 355 of file docnode.php.

Member Function Documentation

child_append (   $child)
protected

Add child to children list.

Children emit output as content for the current node.

Parameters
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.

Field Documentation

$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

See Also
Muster_SimpleWiki_Emitter::$_blocktags for a list of blocktags.
Muster_SimpleWiki_Parser::_set_rules ($rules->blockdef)
Muster_SimpleWiki_Parser::_blockdef_node
Muster_SimpleWiki_Emitter::_blockdef_emit

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

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->blockdivider)
Muster_SimpleWiki_Parser::_blockdivider_node
Muster_SimpleWiki_Emitter::_blockdivider_emit

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

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->code)
Muster_SimpleWiki_Parser::_code_node
Muster_SimpleWiki_Emitter::_code_emit

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

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->defitem)
Muster_SimpleWiki_Parser::_defitem_node
Muster_SimpleWiki_Emitter::_def_desc_emit

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

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->deflist)
Muster_SimpleWiki_Parser::_deflist_node
Muster_SimpleWiki_Emitter::_def_list_emit

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

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->defitem)
Muster_SimpleWiki_Parser::_defitem_node
Muster_SimpleWiki_Emitter::_def_term_emit

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.

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->emph)
Muster_SimpleWiki_Parser::_emph_node
Muster_SimpleWiki_Emitter::_emphasis_emit

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

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->heading)
Muster_SimpleWiki_Parser::_heading_node
Muster_SimpleWiki_Emitter::_heading_emit

Definition at line 64 of file docnode.php.

const HORIZONTALRULE = 'horizontalrule'

Horizontal rule node (<hr />).

No parsed properties

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->horizontalrule)
Muster_SimpleWiki_Parser::_horizontalrule_node
Muster_SimpleWiki_Emitter::_horizontalrule_emit

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

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->image)
Muster_SimpleWiki_Parser::_image_node
Muster_SimpleWiki_Emitter::_image_emit

Definition at line 139 of file docnode.php.

const LINEBREAK = 'linebreak'

Linebreak node (<br />).

No parsed properties

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->linebreak)
Muster_SimpleWiki_Parser::_linebreak_node
Muster_SimpleWiki_Emitter::_linebreak_emit

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)

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->link)
Muster_SimpleWiki_Parser::_link_node
Muster_SimpleWiki_Emitter::_link_emit

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

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->item)
Muster_SimpleWiki_Parser::_item_node
Muster_SimpleWiki_Emitter::_list_item_emit

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.

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->macro, $rules->blockmacro)
Muster_SimpleWiki_Parser::_macro_node
Muster_SimpleWiki_Parser::_blockmacro_node
Muster_SimpleWiki_Emitter::_macro_emit

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

See Also
Muster_SimpleWiki_Parser::_set_rules
Muster_SimpleWiki_Parser::_list_node
Muster_SimpleWiki_Emitter::_ordered_list_emit

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

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->paragraph)
Muster_SimpleWiki_Parser::_paragraph_node
Muster_SimpleWiki_Emitter::_paragraph_emit

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

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->pre)
Muster_SimpleWiki_Parser::_pre_node
Muster_SimpleWiki_Emitter::_preformatted_emit

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

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->span)
Muster_SimpleWiki_Parser::_span_node
Muster_SimpleWiki_Emitter::_span_emit

Definition at line 269 of file docnode.php.

const STRONG = 'strong'

Strong node (<strong>).

No parsed properties

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->strong)
Muster_SimpleWiki_Parser::_strong_node
Muster_SimpleWiki_Emitter::_strong_emit

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

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->table)
Muster_SimpleWiki_Parser::_table_node
Muster_SimpleWiki_Emitter::_table_emit

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

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->cell)
Muster_SimpleWiki_Parser::_table_node
Muster_SimpleWiki_Emitter::_table_cell_emit

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

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->cell)
Muster_SimpleWiki_Parser::_table_node
Muster_SimpleWiki_Emitter::_table_headcell_emit

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

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->table)
Muster_SimpleWiki_Parser::_table_node
Muster_SimpleWiki_Emitter::_table_row_emit

Definition at line 233 of file docnode.php.

const TEXT = 'text'

Text node.

No html markup.

Parsed properties: textcontent

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->char, $rules->escape)
Muster_SimpleWiki_Parser::_char_node (inline non-markup character sets)
Muster_SimpleWiki_Parser::_escape_node (escaped characters)
Muster_SimpleWiki_Parser::_span_node (when error)
Muster_SimpleWiki_Emitter::_text_emit

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

See Also
Muster_SimpleWiki_Parser::_set_rules ($rules->list)
Muster_SimpleWiki_Parser::_list_node
Muster_SimpleWiki_Emitter::_unordered_list_emit

Definition at line 163 of file docnode.php.


The documentation for this class was generated from the following file: