1<?php 2/** 3 * Mikio Syntax Plugin: Heading 4 * 5 * Syntax: ---- or <HR> will be replaced with the horizontal line element 6 * 7 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) 8 * @author James Collins <james.collins@outlook.com.au> 9 */ 10 11if (!defined('DOKU_INC')) die(); 12if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); 13require_once(dirname(__FILE__).'/core.php'); 14 15class syntax_plugin_mikioplugin_heading extends syntax_plugin_mikioplugin_core { 16 public $tag = 'heading'; 17 public $defaults = array('size' => '1'); 18 public $options = array( 19 'size' => array('1', '2', '3', '4', '5') 20 ); 21 22 23 public function render_lexer_enter(Doku_Renderer $renderer, $data) { 24 $classes = $this->buildClassString($data); 25 26 $renderer->doc .= '<h' . $data['size'] . ' class="' . $classes . '">'; 27 } 28 29 30 public function render_lexer_exit(Doku_Renderer $renderer, $data) { 31 $renderer->doc .= '</h' . $this->values['size'] . '>'; 32 } 33} 34 35?>