*/ class syntax_plugin_dokuflashcard extends SyntaxPlugin { /** @inheritDoc */ public function getType() { return 'protected'; } /** @inheritDoc */ public function getPType() { return 'block'; } /** @inheritDoc */ public function getSort() { return 32; } /** @inheritDoc */ public function connectTo($mode) { // $this->Lexer->addSpecialPattern('', $mode, 'plugin_dokuflashcard'); $this->Lexer->addEntryPattern('', $mode, 'plugin_dokuflashcard'); } // /** @inheritDoc */ public function postConnect() { $this->Lexer->addExitPattern('', 'plugin_dokuflashcard'); } /** @inheritDoc */ public function handle($match, $state, $pos, Doku_Handler $handler) { switch ($state) { case DOKU_LEXER_ENTER : return array($state, ''); case DOKU_LEXER_UNMATCHED : return array($state, $match); case DOKU_LEXER_EXIT : return array($state, ''); } return array(); } /** @inheritDoc */ public function render($mode, Doku_Renderer $renderer, $data) { if ($mode !== 'xhtml') { return false; } list($state,$match) = $data; switch ($state) { case DOKU_LEXER_ENTER : $renderer->doc .= '
Start!
'; $renderer->doc .= '
'; $renderer->doc .= '
'; break; case DOKU_LEXER_UNMATCHED : $renderer->doc .= $renderer->_xmlEntities($match); break; case DOKU_LEXER_EXIT : $renderer->doc .= '
'; break; return true; } } }