-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsyntax.php
More file actions
42 lines (33 loc) · 1000 Bytes
/
syntax.php
File metadata and controls
42 lines (33 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* DokuWiki Plugin const (Syntax Component)
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author lisps
*/
// 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_const extends DokuWiki_Syntax_Plugin {
function getType() { return 'substition'; }
function getSort() { return 32; }
function connectTo($mode) {
$this->Lexer->addSpecialPattern('<const[^>]*>[^<]*</const>',$mode,'plugin_const');
}
function handle($match, $state, $pos, Doku_Handler $handler) {
return array($match, $state, $pos);
}
function render($mode, Doku_Renderer $renderer, $data) {
// $data is what the function handle return'ed.
if($mode == 'xhtml'){
$renderer->doc .="";
return true;
}
return false;
}
}