1<?php 2/** 3 * Mikio Syntax Plugin: Anchor 4 * 5 * @link http://github.com/nomadjimbob/mikioplugin 6 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) 7 * @author James Collins <james.collins@outlook.com.au> 8 */ 9if (!defined('DOKU_INC')) die(); 10if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); 11 12require_once(dirname(__FILE__).'/core.php'); 13 14class syntax_plugin_mikioplugin_anchor extends syntax_plugin_mikioplugin_core { 15 public $tag = 'anchor'; 16 public $hasEndTag = false; 17 public $options = array( 18 'id' => array('type' => 'text', 'default' => ''), 19 ); 20 21 public function getType() { return 'substition'; } 22 public function getPType() { return 'normal'; } 23 24 public function render_lexer_special(Doku_Renderer $renderer, $data) { 25 if($data['id'] != '') { 26 $renderer->doc .= '<a id="' . $data['id'] . '"></a>'; 27 } 28 } 29} 30?>