Lexer->addSpecialPattern('[ \t]*={2,}[^\n]+={2,}[ \t]*(?=\n)', $mode, 'plugin_revealjs_header');
}
/**
* Handler to prepare matched data for the rendering process.
*
* @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
*/
public function handle($match, $state, $pos, Doku_Handler $handler) {
/* We reuse and adapt here the default DokuWiki header handler code. See also
/inc/parser/handler.php around line 97. */
// get level and title
$title = trim($match);
$level = 7 - strspn($title,'=');
if($level < 1) $level = 1;
$title = trim($title,'= ');
if ($this->getConf('revealjs_active') || $_GET['do']=='export_revealjs') {
/* We are now on a reveal.js activated page and we want to do our
own section handling to be able to get all relevant content from
one slide into one edit section. Since sections are header driven,
we have to do also our own header handling.
Because we are in a plugin context, we are automatically called and
do our work in the render function (see below).*/
// pass
}
else {
/* This is the DokuWiki default header/section handling, we use it on NON Reveal.js
activated pages (keyword ~~REVEAL~~ not found on page). See also theme.php */
$handler->_addCall('header', array($title, $level, $pos), $pos);
}
return array($title, $level, $pos);
}
/**
* Handle the actual output creation.
*
* @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()
*/
public function render($mode, Doku_Renderer $renderer, $data) {
global $conf;
if($mode == 'xhtml') {
list($text, $level, $pos) = $data;
$horizontal_slide_level = $this->getConf('horizontal_slide_level');
/* examples:
horizontal_slide_level=2 ==> headers level 1-3 open slides, headers 4-6 are only content on slides
horizontal_slide_level=1 ==> headers level 1-2 open slides, headers 3-6 are only content on slides */
// rendering the slideshow
if (is_a($renderer, 'renderer_plugin_revealjs')){
// slide indicator: special horizontal rules ---- section orange zoom slow no-footer ---->
if (!$renderer->slide_indicator_headers) {
$renderer->doc .= '