-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsyntax.php
More file actions
54 lines (50 loc) · 1.56 KB
/
syntax.php
File metadata and controls
54 lines (50 loc) · 1.56 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* Class syntax_plugin_extranet
*/
class syntax_plugin_extranet extends DokuWiki_Syntax_Plugin
{
/**
* What kind of syntax are we?
*/
public function getType() {
return 'substition';
}
/**
* Where to sort in?
*/
public function getSort() {
return 200;
}
/**
* Connect pattern to lexer
* @param string $mode
*/
public function connectTo($mode) {
$this->Lexer->addSpecialPattern('~~NOEXTRANET~~', $mode, 'plugin_extranet');
$this->Lexer->addSpecialPattern('~~EXTRANET~~', $mode, 'plugin_extranet');
}
/**
* Handler to prepare matched data for the rendering process
*
* @param string $match The text matched by the patterns
* @param int $state The lexer state for the match
* @param int $pos The character position of the matched text
* @param Doku_Handler $handler The Doku_Handler object
* @return array Return an array with all data you want to use in render
*/
public function handle($match, $state, $pos, Doku_Handler $handler) {
return strtoupper(trim(substr($match, 2, -2)));
}
/**
* Handles the actual output creation.
*
* @param string $mode output format being rendered
* @param Doku_Renderer $renderer the current renderer object
* @param array $data data created by handler()
* @return boolean rendered correctly?
*/
public function render($mode, Doku_Renderer $renderer, $data) {
return true;
}
}