* The returned array holds the following fields:
*
* - author
- Author of the plugin
* - email
- Email address to contact the author
* - date
- Last modified date of the plugin in
* YYYY-MM-DD format
* - name
- Name of the plugin
* - desc
- Short description of the plugin (Text only)
* - url
- Website with more information on the plugin
* (eg. syntax description)
*
* @param none
* @return Array Information about this plugin class.
* @public
* @static
*/
function getInfo(){
return array(
'author' => 'Tyler Bletsch',
'email' => 'tkbletsc@ncsu.edu',
'date' => '2010-12-02',
'name' => 'Literal Entities',
'desc' => "Prevent dokuwiki from escaping HTML entities (e.g., '>') so you can use them inline. Doesn't work with non-HTML renderers!",
'url' => 'http://www.dokuwiki.org/plugin:literal_entities',
);
}
/**
* Get the type of syntax this plugin defines.
*
* @param none
* @return String 'substition' (i.e. 'substitution').
* @public
* @static
*/
function getType(){
return 'substition';
}
/**
* Where to sort in?
*
* @param none
* @return Integer 6.
* @public
* @static
*/
function getSort(){
return 999;
}
/**
* Connect lookup pattern to lexer.
*
* @param $aMode String The desired rendermode.
* @return none
* @public
* @see render()
*/
function connectTo($mode) {
$this->Lexer->addSpecialPattern('&[#\w]\w*;',$mode,'plugin_literal_entities');
}
/**
* Handler to prepare matched data for the rendering process.
*
*
* The $aState parameter gives the type of pattern
* which triggered the call to this method:
*
*
* - DOKU_LEXER_ENTER
* - a pattern set by addEntryPattern()
* - DOKU_LEXER_MATCHED
* - a pattern set by addPattern()
* - DOKU_LEXER_EXIT
* - a pattern set by addExitPattern()
* - DOKU_LEXER_SPECIAL
* - a pattern set by addSpecialPattern()
* - DOKU_LEXER_UNMATCHED
* - ordinary text encountered within the plugin's syntax mode
* which doesn't match any pattern.
*
* @param $aMatch String The text matched by the patterns.
* @param $aState Integer The lexer state for the match.
* @param $aPos Integer The character position of the matched text.
* @param $aHandler Object Reference to the Doku_Handler object.
* @return Integer The current lexer state for the match.
* @public
* @see render()
* @static
*/
function handle($match, $state, $pos, &$handler){
return $match;
}
/**
* Handle the actual output creation.
*
*
* The method checks for the given $aFormat and returns
* FALSE when a format isn't supported. $aRenderer
* contains a reference to the renderer object which is currently
* handling the rendering. The contents of $aData is the
* return value of the handle() method.
*
* @param $aFormat String The output format to generate.
* @param $aRenderer Object A reference to the renderer object.
* @param $aData Array The data created by the handle()
* method.
* @return Boolean TRUE if rendered successfully, or
* FALSE otherwise.
* @public
* @see handle()
*/
function render($mode, &$renderer, $data) {
$renderer->doc .= $data;
return true;
}
}
?>