*/ // must be run within Dokuwiki if(!defined('DOKU_INC')) die(); if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); require_once(DOKU_PLUGIN.'syntax.php'); /** * All DokuWiki plugins to extend the parser/rendering mechanism * need to inherit from this class */ class syntax_plugin_bookmarkme_bookmarkme extends DokuWiki_Syntax_Plugin { /** * return some info */ function getInfo(){ preg_match("#^.+BookmarkMe[/.]([^\\/]+)#"," $HeadURL: https://svn.debugger.ru/repos/common/DokuWiki/BookmarkMe/tags/BookmarkMe.v0.8/syntax/bookmarkme.php $ ", $v); $v = preg_replace("#.*?((trunk|\.v)[\d.]+)#","\\1",$v[1]); $b = preg_replace("/\\D/","", " $Rev: 111 $ "); return array( 'author' => "Ilya Lebedev" ,'email' => 'ilya@lebedev.net' ,'date' => preg_replace("#.*?(\d{4}-\d{2}-\d{2}).*#","\\1",'$Date: 2008-12-25 22:33:15 +0300 (Чтв, 25 Дек 2008) $') ,'name' => "BookmarkMe {$v}.$b." ,'desc' => "Allows to override config options for a cetrain page
Syntax: ~~BOOKMARKME:(off|top|bottom|both)~~." ,'url' => 'http://wiki.splitbrain.org/plugin:bookmarkme' ); } function getType(){ return 'substition'; } function getPType(){ return 'block'; } function getSort(){ return 110; } /** * Connect pattern to lexer */ function connectTo($mode){ if ($mode == 'base'){ $this->Lexer->addSpecialPattern('~~BOOKMARKME:(?:o(?:ff|n)|top|bot(?:tom|h))~~', $mode, 'plugin_bookmarkme_bookmarkme'); } } /** * Handle the match */ function handle($match, $state, $pos, &$handler){ return preg_replace("/[^:]+:(\\w+).+/","\\1",$match); } /** * Render output */ function render($mode, &$renderer, $data) { switch ($mode) { case 'metadata' : /* * mark metadata with found value */ $renderer->meta['bookmarkme'] = $data; return true; break; } return false; } }