Simplewiki
1.1
|
$emitter = new SimpleWiki_Emitter() - create new instance of emitter
$html = $emitter->emit($dom); see Muster_SimpleWiki_DocNode for docnode type documentation.
More...
Public Member Functions | |
Property accessors | |
symlinks () | |
returns registered symlinks | |
symlink_handler () | |
returns registered symlink handler | |
blocktags ($blocktaglist=NULL) | |
get or set collection of block declarations recognized by emitter | |
Register callouts | |
Clients register callouts for classes, macros, symlinks, and events. All callbacks are passed nodes | |
register_events ($callbacks) | |
['event']=>'methodref'. | |
register_symlinks ($symlinks) | |
[$symlink]=>$value. | |
register_symlink_handler ($handler) | |
Default handler for symlinks not registered: array($objectref,'methodname'). | |
register_charfilter_handler ($handler) | |
Handler for rawlinks: array($objectref,'methodname'). | |
register_rawlink_handler ($handler) | |
Handler for rawlinks: array($objectref,'methodname'). | |
register_class_callouts ($callouts) | |
[$nodetype][$classname]=>$methodref. | |
register_property_callouts ($callouts) | |
[$nodetype][$propertyname]=>$methodref. | |
register_macro_callouts ($callouts) | |
[$macroname]=>$methodref. | |
register_blockdef_handler ($handler) | |
Handler for block definitions: array($objectref,'methodname'). | |
Protected Member Functions | |
Invoke callouts | |
expand_symlink ($node) | |
triggered from prepare_link_node. | |
expand_rawlink ($node) | |
triggered from prepare_link_node. | |
call_macro ($node) | |
triggered from prepare_macro. | |
call_classes ($node) | |
triggered from prepare_node. | |
call_properties ($node) | |
triggered from prepare_node. | |
call_event ($event, $node) | |
triggered from _document_emit | |
Support methods | |
prepare_image_node ($node) | |
interpret address, inlcuding symlink; prepare src, alt, title attributes. | |
prepare_link_node ($node) | |
identify anchor for special handling; prepare attributes - name, href, title. | |
prepare_macro_node ($node) | |
trigger callouts; prepare output property | |
prepare_node ($node) | |
Standard data preparation for emitting html. | |
standard_assembly ($node) | |
Assembles and returns standard node html components. | |
char_filter ($text, $node=NULL) | |
Filters text with htmlspecialchars($text) by default. | |
Node emitters | |
_document_emit ($node) | |
emit html for document. | |
_paragraph_emit ($node) | |
emit html for paragraph. | |
_text_emit ($node) | |
emit html for text node. | |
_heading_emit ($node) | |
emit html for heading. | |
_emphasis_emit ($node) | |
emit html for emphasis. | |
_strong_emit ($node) | |
emit html for strong. | |
_linebreak_emit ($node) | |
emit html for linebreak. | |
_horizontalrule_emit ($node) | |
emit html for horizontalrule. | |
_link_emit ($node) | |
emit html for link. | |
_image_emit ($node) | |
emit html for image. | |
_def_list_emit ($node) | |
emit html for definition list. | |
_def_term_emit ($node) | |
emit html for definition term. | |
_def_desc_emit ($node) | |
emit html for definition description. | |
_ordered_list_emit ($node) | |
emit html for ordered list. | |
_unordered_list_emit ($node) | |
emit html for unordered list. | |
_list_item_emit ($node) | |
emit html for list item. | |
_table_emit ($node) | |
emit html for table. | |
_table_row_emit ($node) | |
emit html for table row. | |
_table_headcell_emit ($node) | |
emit html for table head cell. | |
_table_cell_emit ($node) | |
emit html for table data cell. | |
_span_emit ($node) | |
emit html for span. | |
_blockdivider_emit ($node) | |
emit html for block divider. | |
_code_emit ($node) | |
emit html for code. | |
_preformatted_emit ($node) | |
emit html for preformatted. | |
_blockdef_emit ($node) | |
emit html for blockdef. | |
_macro_emit ($node) | |
emit html for macro. | |
Protected Attributes | |
Data properties | |
$_dom | |
document object model, through the root node | |
$_rules | |
regex rules combined into applied regular expressions | |
$_link_re | |
link regular expressions, external link, symlink, and anchor | |
$_image_re | |
image link regular expressions, external link and symlink | |
$_blocktags | |
supported block tags | |
Registered data | |
$_class_callouts = array() | |
[$nodetype][$classname]=>$methodref | |
$_property_callouts = array() | |
[$nodetype][$propertyname]=>$methodref | |
$_macro_callouts = array() | |
[$macroname]=>$methodref | |
$_symlinks = array() | |
[$symlink]=>$value | |
$_symlink_handler | |
array($objectref,'methodname') | |
$_rawlink_handler | |
array($objectref,'methodname') | |
$_charfilter_handler | |
array($objectref,'methodname') | |
$_events = array() | |
['event']=>'methodref' | |
$_blockdef_handler | |
array($objectref,'methodname') | |
Creation | |
__construct () | |
The constructor. | |
set_rules () | |
Sets rules used in the class. | |
set_re ($rules) | |
Sets the regelar expressions applied. | |
Control methods | |
emit ($dom) | |
generate html from the passed document object model. | |
emit_children ($node) | |
collects and returns html for chilren. | |
emit_node_text ($node) | |
text only, no html or other markup. | |
emit_node ($node) | |
controller directs flow to one of the node emit methods. | |
emit_children_text ($node) | |
supports emit_node_text. | |
$emitter = new SimpleWiki_Emitter() - create new instance of emitter
$html = $emitter->emit($dom); see Muster_SimpleWiki_DocNode for docnode type documentation.
Definition at line 23 of file emitter.php.
__construct | ( | ) |
The constructor.
Sets regex rules, and combines them into applied regex. No parameters.
Definition at line 70 of file emitter.php.
|
protected |
emit html for blockdef.
object | $node | document node |
Definition at line 988 of file emitter.php.
|
protected |
emit html for block divider.
object | $node | document node |
Definition at line 941 of file emitter.php.
|
protected |
emit html for code.
object | $node | document node |
Definition at line 955 of file emitter.php.
|
protected |
emit html for definition description.
object | $node | document node |
Definition at line 818 of file emitter.php.
|
protected |
emit html for definition list.
object | $node | document node |
Definition at line 792 of file emitter.php.
|
protected |
emit html for definition term.
object | $node | document node |
Definition at line 805 of file emitter.php.
|
protected |
emit html for document.
object | $node | document node |
Definition at line 602 of file emitter.php.
|
protected |
emit html for emphasis.
object | $node | document node |
Definition at line 653 of file emitter.php.
|
protected |
emit html for heading.
object | $node | document node |
Definition at line 640 of file emitter.php.
|
protected |
emit html for horizontalrule.
object | $node | document node |
Definition at line 677 of file emitter.php.
|
protected |
emit html for image.
object | $node | document node |
Definition at line 753 of file emitter.php.
|
protected |
emit html for linebreak.
object | $node | document node |
Definition at line 669 of file emitter.php.
|
protected |
emit html for link.
object | $node | document node |
Definition at line 686 of file emitter.php.
|
protected |
emit html for list item.
object | $node | document node |
Definition at line 859 of file emitter.php.
|
protected |
emit html for macro.
object | $node | document node |
Definition at line 1031 of file emitter.php.
|
protected |
emit html for ordered list.
object | $node | document node |
Definition at line 831 of file emitter.php.
|
protected |
emit html for paragraph.
object | $node | document node |
Definition at line 617 of file emitter.php.
|
protected |
emit html for preformatted.
object | $node | document node |
Definition at line 970 of file emitter.php.
|
protected |
emit html for span.
object | $node | document node |
Definition at line 927 of file emitter.php.
|
protected |
emit html for strong.
object | $node | document node |
Definition at line 661 of file emitter.php.
|
protected |
emit html for table data cell.
object | $node | document node |
Definition at line 912 of file emitter.php.
|
protected |
emit html for table.
object | $node | document node |
Definition at line 873 of file emitter.php.
|
protected |
emit html for table head cell.
object | $node | document node |
Definition at line 899 of file emitter.php.
|
protected |
emit html for table row.
object | $node | document node |
Definition at line 886 of file emitter.php.
|
protected |
emit html for text node.
object | $node | document node |
Definition at line 630 of file emitter.php.
|
protected |
emit html for unordered list.
object | $node | document node |
Definition at line 846 of file emitter.php.
blocktags | ( | $blocktaglist = NULL | ) |
get or set collection of block declarations recognized by emitter
Definition at line 178 of file emitter.php.
|
protected |
triggered from prepare_node.
Definition at line 359 of file emitter.php.
|
protected |
triggered from _document_emit
string | $event | the event being triggered |
object | $node | the current document node |
Definition at line 410 of file emitter.php.
|
protected |
triggered from prepare_macro.
object | $node | the current document node |
Definition at line 345 of file emitter.php.
|
protected |
triggered from prepare_node.
object | $node | the current document node |
Definition at line 384 of file emitter.php.
|
protected |
Filters text with htmlspecialchars($text) by default.
But allows substitution of alternate or custom character filters.
Definition at line 584 of file emitter.php.
emit | ( | $dom | ) |
generate html from the passed document object model.
object | $dom | the root node of the document object model for which html is being emitted. |
Definition at line 113 of file emitter.php.
emit_children | ( | $node | ) |
collects and returns html for chilren.
Can be useful for registered method classes, macros and events, so it is public.
object | $node |
Definition at line 131 of file emitter.php.
|
protected |
supports emit_node_text.
text only, no html or other markup, helpful for registrants.
Definition at line 154 of file emitter.php.
|
protected |
controller directs flow to one of the node emit methods.
object | $node |
Definition at line 122 of file emitter.php.
emit_node_text | ( | $node | ) |
text only, no html or other markup.
Can be helpful for registrants, so it is public.
Definition at line 144 of file emitter.php.
|
protected |
triggered from prepare_link_node.
object | $node | the current document node |
Definition at line 330 of file emitter.php.
|
protected |
triggered from prepare_link_node.
object | $node | the current document node |
Definition at line 312 of file emitter.php.
|
protected |
interpret address, inlcuding symlink; prepare src, alt, title attributes.
Then call standard prepare_node
object | $node | the current document node |
Definition at line 434 of file emitter.php.
|
protected |
identify anchor for special handling; prepare attributes - name, href, title.
Then call standard prepare_node
object | $node |
Definition at line 477 of file emitter.php.
|
protected |
trigger callouts; prepare output property
object | $node | document node |
Definition at line 521 of file emitter.php.
|
protected |
Standard data preparation for emitting html.
trigger class and property callouts; prepare attributes, classes, and styles for HTML by combining into single attribute array
object | $node | document node |
Definition at line 537 of file emitter.php.
register_blockdef_handler | ( | $handler | ) |
Handler for block definitions: array($objectref,'methodname').
$param methodref $handler normally array($object,'methodname')
Definition at line 300 of file emitter.php.
register_charfilter_handler | ( | $handler | ) |
Handler for rawlinks: array($objectref,'methodname').
Definition at line 225 of file emitter.php.
register_class_callouts | ( | $callouts | ) |
[$nodetype][$classname]=>$methodref.
Typically called by SimpleWiki (as facade). One callback per type class.
Definition at line 239 of file emitter.php.
register_events | ( | $callbacks | ) |
['event']=>'methodref'.
Definition at line 192 of file emitter.php.
register_macro_callouts | ( | $callouts | ) |
[$macroname]=>$methodref.
Typically called by SimpleWiki (as facade).
Definition at line 286 of file emitter.php.
register_property_callouts | ( | $callouts | ) |
[$nodetype][$propertyname]=>$methodref.
Typically called by SimpleWiki (as facade). One callback per type class.
Definition at line 263 of file emitter.php.
register_rawlink_handler | ( | $handler | ) |
Handler for rawlinks: array($objectref,'methodname').
Definition at line 232 of file emitter.php.
register_symlink_handler | ( | $handler | ) |
Default handler for symlinks not registered: array($objectref,'methodname').
Definition at line 218 of file emitter.php.
register_symlinks | ( | $symlinks | ) |
[$symlink]=>$value.
Definition at line 207 of file emitter.php.
|
protected |
Sets the regelar expressions applied.
_link_re for link addresses; _image_re for image addresses (excludes anchors)
Definition at line 102 of file emitter.php.
|
protected |
Sets rules used in the class.
lists prototypes, sets regex for external url's, symlinks, and anchors
Definition at line 79 of file emitter.php.
|
protected |
Assembles and returns standard node html components.
opentag_head, node attributes, opentag_tail, elementcontent, and closetag.
object | $node | document node |
Definition at line 576 of file emitter.php.
symlink_handler | ( | ) |
returns registered symlink handler
Definition at line 173 of file emitter.php.
symlinks | ( | ) |
returns registered symlinks
Definition at line 168 of file emitter.php.
|
protected |
array($objectref,'methodname')
Definition at line 62 of file emitter.php.
|
protected |
supported block tags
Definition at line 35 of file emitter.php.
|
protected |
array($objectref,'methodname')
Definition at line 58 of file emitter.php.
|
protected |
[$nodetype][$classname]=>$methodref
Definition at line 46 of file emitter.php.
|
protected |
document object model, through the root node
Definition at line 27 of file emitter.php.
|
protected |
['event']=>'methodref'
Definition at line 60 of file emitter.php.
|
protected |
image link regular expressions, external link and symlink
Definition at line 33 of file emitter.php.
|
protected |
link regular expressions, external link, symlink, and anchor
Definition at line 31 of file emitter.php.
|
protected |
[$macroname]=>$methodref
Definition at line 50 of file emitter.php.
|
protected |
[$nodetype][$propertyname]=>$methodref
Definition at line 48 of file emitter.php.
|
protected |
array($objectref,'methodname')
Definition at line 56 of file emitter.php.
|
protected |
regex rules combined into applied regular expressions
Definition at line 29 of file emitter.php.
|
protected |
array($objectref,'methodname')
Definition at line 54 of file emitter.php.
|
protected |
[$symlink]=>$value
Definition at line 52 of file emitter.php.