* title (optional) all text after '|' will be rendered above the main code text with a * different style. * * if no title is provided will render as native dokuwiki code syntax mode, e.g. *
...* * if title is provide will render as follows *
{title}
*...*
// e.g. ... [lang] [|title] > [content]
list($attr, $content) = preg_split('/>/u',$match,2);
list($lang, $title) = preg_split('/\|/u',$attr,2);
if ($this->syntax == 'code') {
$lang = trim($lang);
if ($lang == 'html') $lang = 'html4strict';
if (!$lang) $lang = NULL;
} else {
$lang = NULL;
}
return array($this->syntax, $lang, trim($title), $content);
}
return false;
}
/**
* Create output
*/
function render($mode, Doku_Renderer $renderer, $data) {
if (count($data) == 4) {
list($syntax, $lang, $title, $content) = $data;
if($mode == 'xhtml'){
if ($title) $renderer->doc .= "".$renderer->_xmlEntities($title)."
";
if ($syntax == 'code') $renderer->code($content, $lang); else $renderer->file($content);
if ($title) $renderer->doc .= "";
} else {
if ($syntax == 'code') $renderer->code($content, $lang); else $renderer->file($content);
}
return true;
}
return false;
}
}
//Setup VIM: ex: et ts=4 enc=utf-8 :