Simplewiki
1.1
|
Facade, and default method classes, macros, events and symlinks public methods. More...
Public Member Functions | |
constructor | |
__construct ($text=NULL) | |
The constructor for Simplewiki. | |
__clone () | |
settings methods | |
allow_html ($bool=NULL) | |
Get or set permission to allow html in markup. | |
register_class_callbacks ($callbacks) | |
Set callbacks for class methods. | |
register_property_callbacks ($callbacks) | |
Set callbacks for property methods. | |
register_symlinks ($symlinks) | |
Set specific symlinks for link and image markup. | |
register_symlink_handler ($handler) | |
Set symlink handler, to handle any number of symlinks. | |
register_rawlink_handler ($handler) | |
Set rawlink handler. | |
register_charfilter_handler ($handler) | |
Set charfilter handler. | |
register_blockdef_handler ($handler) | |
Set blockdef handler. | |
register_macro_callbacks ($callbacks) | |
Registers macro callbacks. | |
register_events ($callbacks) | |
Registers events. | |
operational methods | |
prepare ($raw) | |
Prepare the markup for processing. | |
get_html ($markup=NULL) | |
Generate html from the markup text, as passed to the constructor, or to prepare. | |
accessor methods | |
parser ($parser=NULL) | |
Get or set the instance of the parser used by Simplewiki. | |
emitter ($emitter=NULL) | |
Get or set the instance of the emitter used by Simplewiki. | |
get_metadata () | |
Get metadata from prepared markup. | |
get_markerdata () | |
Get marker data from prepared markup. | |
get_preprocessed_markup () | |
Get markup from prepared markup. | |
standard class callbacks | |
Standard class callbacks are registered in the constructor (__construct) with register_class_callbacks | |
callback_paragraph_nop ($node) | |
Standard callback |:p nop:| (no paragraph). | |
callback_paragraph_div ($node) | |
Standard callback |:p div:| (paragraph to div). | |
callback_code_html ($node) | |
Standard callback c html% code to html. | |
callback_blockdef_frame ($node) | |
Standard callback (:div frame:) frame. | |
callback_image_frame ($node) | |
Standard callback left or right frame. | |
callback_pre_html ($node) | |
Standard callback block html. | |
callback_span_comment ($node) | |
Standard callback %s comment%...%%. | |
callback_span_footnote ($node) | |
Standard callback %s footnote%...%%. | |
callback_span_superscript ($node) | |
Standard callback %s superscript%. | |
callback_span_subscript ($node) | |
Standard callback %s subscript%. | |
callback_link_newwin ($node) | |
Standard callback %l newwin%[[... | |
standard macros | |
macro_quicktoc ($node) | |
quicktoc macro. | |
standard event methods | |
render_footnotes ($document) | |
auto_quicktoc ($document) | |
Protected Member Functions | |
macro_quicktoc_assemble_headings ($node, $contents) | |
Protected Attributes | |
$_parser | |
$_allow_html = TRUE | |
$_emitter | |
$_footnotes | |
$_footnotereferences | |
$_working_parser | |
Facade, and default method classes, macros, events and symlinks public methods.
$wiki = new SimpleWiki($markup) - create object to process markup text
note that SimpleWiki registers a number of default behaviours with SimpleWikiEmitter
Definition at line 153 of file simplewiki.php.
__construct | ( | $text = NULL | ) |
The constructor for Simplewiki.
The constructor does the following:
string | $text | the markup text to be processed. |
instantiate and save new parser
instantiate and save new emitter
register standard class callbacks
register standard macro callbacks
register standard symlinks
Definition at line 178 of file simplewiki.php.
__clone | ( | ) |
Definition at line 218 of file simplewiki.php.
allow_html | ( | $bool = NULL | ) |
Get or set permission to allow html in markup.
...from within "<pre>" elements.
boolean | $bool | true allows html (default), false disallows |
Definition at line 232 of file simplewiki.php.
auto_quicktoc | ( | $document | ) |
Definition at line 876 of file simplewiki.php.
callback_blockdef_frame | ( | $node | ) |
Standard callback (:div frame:) frame.
object | $node | class DocNode |
Definition at line 518 of file simplewiki.php.
callback_code_html | ( | $node | ) |
Standard callback c html% code to html.
object | $node | class DocNode |
Definition at line 502 of file simplewiki.php.
callback_image_frame | ( | $node | ) |
Standard callback left or right frame.
%i lframe%{{... or %i lframe%{{...
object | $node | class DocNode |
Definition at line 528 of file simplewiki.php.
callback_link_newwin | ( | $node | ) |
Standard callback %l newwin%[[...
object | $node | class DocNode |
Definition at line 655 of file simplewiki.php.
callback_paragraph_div | ( | $node | ) |
Standard callback |:p div:| (paragraph to div).
object | $node | class DocNode |
Definition at line 490 of file simplewiki.php.
callback_paragraph_nop | ( | $node | ) |
Standard callback |:p nop:| (no paragraph).
object | $node | class DocNode |
Definition at line 478 of file simplewiki.php.
callback_pre_html | ( | $node | ) |
Standard callback block html.
|:pre html:|{{{... pre to html.
object | $node | class DocNode |
Definition at line 554 of file simplewiki.php.
callback_span_comment | ( | $node | ) |
Standard callback %s comment%...%%.
object | $node | class DocNode |
Definition at line 570 of file simplewiki.php.
callback_span_footnote | ( | $node | ) |
Standard callback %s footnote%...%%.
object | $node | class DocNode |
Definition at line 583 of file simplewiki.php.
callback_span_subscript | ( | $node | ) |
Standard callback %s subscript%.
object | $node | class DocNode |
Definition at line 643 of file simplewiki.php.
callback_span_superscript | ( | $node | ) |
Standard callback %s superscript%.
object | $node | class DocNode |
Definition at line 631 of file simplewiki.php.
emitter | ( | $emitter = NULL | ) |
Get or set the instance of the emitter used by Simplewiki.
The emitter method allows the caller to set a different instance of the emitter, or to obtain the current instance of the emitter.
$emitter | object, optional, class Emitter |
Definition at line 434 of file simplewiki.php.
get_html | ( | $markup = NULL | ) |
Generate html from the markup text, as passed to the constructor, or to prepare.
Definition at line 395 of file simplewiki.php.
get_markerdata | ( | ) |
Get marker data from prepared markup.
Definition at line 453 of file simplewiki.php.
get_metadata | ( | ) |
Get metadata from prepared markup.
Gets the metadata from the metadata section of the parsed markup.
Definition at line 445 of file simplewiki.php.
get_preprocessed_markup | ( | ) |
Get markup from prepared markup.
Definition at line 461 of file simplewiki.php.
macro_quicktoc | ( | $node | ) |
quicktoc macro.
enclosing div is given class 'quicktoc-platform'
to suppress heading inclusion, give header element the attribute toc=no
Definition at line 670 of file simplewiki.php.
|
protected |
Definition at line 784 of file simplewiki.php.
parser | ( | $parser = NULL | ) |
Get or set the instance of the parser used by Simplewiki.
The parser method allows the caller to set a different instance of the parser, or to obtain the current instance of the parser.
object | $parser | class Parser |
Definition at line 422 of file simplewiki.php.
prepare | ( | $raw | ) |
Prepare the markup for processing.
string | $raw | (markup text) |
This method is a facade for the parser object (Parser), to which the markup is passed directly.
Definition at line 387 of file simplewiki.php.
register_blockdef_handler | ( | $handler | ) |
Set blockdef handler.
The blockdef handler is called for any known blockdef, with a param of the blockdef node.
method | $handler | typically in the form array(objectref,'methodname') |
Definition at line 338 of file simplewiki.php.
register_charfilter_handler | ( | $handler | ) |
Set charfilter handler.
The charfilter handler is called by the emitter where normally htmlspecialchars would be applied (the default), allowing clients to substitute alternate or custom character filters.
method | $handler | typically in the form array(objectref,'methodname') |
Definition at line 328 of file simplewiki.php.
register_class_callbacks | ( | $callbacks | ) |
Set callbacks for class methods.
array | $callbacks | [$nodetype][$classname]=>$methodref $methodref is typically array(objectref,'methodname') |
$classname can be any valid class string
Callback methods are passed a DocNode object, and are expected to manipulate and return that object
This method is a facade for the emitter object (Emitter), to which the callbacks are passed directly.
Definition at line 253 of file simplewiki.php.
register_events | ( | $callbacks | ) |
Registers events.
array | $callbacks | in the form [$eventname]=>$methodref $methodref is typically array(objectref,'methodname') |
$eventname can be 'onemit' or 'onafteremit'
$event callbacks are handed a DocNode object, and are expected to manipulate and return that object.
This method is a facade for the emitter object (Emitter), to which the callbacks are passed directly.
Definition at line 372 of file simplewiki.php.
register_macro_callbacks | ( | $callbacks | ) |
Registers macro callbacks.
array | $callbacks | in the form [$macroname]=>$methodref $methodref is typically array(objectref,'methodname') |
$macro callbacks are handed a DocNode object, and are expected to manipulate and return that object.
This method is a facade for the emitter object (Emitter), to which the callbacks are passed directly.
Definition at line 354 of file simplewiki.php.
register_property_callbacks | ( | $callbacks | ) |
Set callbacks for property methods.
array | $callbacks | [$nodetype][$propertyname]=>$methodref $methodref is typically array(objectref,'methodname') |
$propertyname can be any valid class string
Callback methods are passed a DocNode object, and are expected to manipulate and return that object
This method is a facade for the emitter object (Emitter), to which the callbacks are passed directly.
Definition at line 273 of file simplewiki.php.
register_rawlink_handler | ( | $handler | ) |
Set rawlink handler.
The rawlink handler is called for any links that are not anchors, external links (with recognized prototcol), or symlinks.
method | $handler | typically in the form array(objectref,'methodname') |
Definition at line 317 of file simplewiki.php.
register_symlink_handler | ( | $handler | ) |
Set symlink handler, to handle any number of symlinks.
method | $handler | typically in the form array(objectref,'methodname') |
$handler is handed a DocNode object, and is expected to manipulate and return that object.
This method is a facade for the emitter object (Emitter), to which the callbacks are passed directly.
Definition at line 307 of file simplewiki.php.
register_symlinks | ( | $symlinks | ) |
Set specific symlinks for link and image markup.
array | $symlinks | [$symlink]=>$value $value should be an absolute or relative html link (href/src) |
$symlink can be any string of letters with a leading uppercase letter.
This method is a facade for the emitter object (Emitter), to which the callbacks are passed directly.
Definition at line 290 of file simplewiki.php.
render_footnotes | ( | $document | ) |
Definition at line 820 of file simplewiki.php.
|
protected |
Definition at line 156 of file simplewiki.php.
|
protected |
Definition at line 157 of file simplewiki.php.
|
protected |
Definition at line 159 of file simplewiki.php.
|
protected |
Definition at line 158 of file simplewiki.php.
|
protected |
Definition at line 155 of file simplewiki.php.
|
protected |
Definition at line 160 of file simplewiki.php.