1<?php
2/**
3 * DokuGource Plugin: extract gource log from the wiki
4 *
5 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author     Etienne Meleard <etienne.meleard@free.fr>
7 *
8 * 2010/05/19 : Creation
9 */
10
11if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/');
12if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
13require_once(DOKU_PLUGIN.'syntax.php');
14
15/**
16 * All DokuWiki plugins to extend the parser/rendering mechanism
17 * need to inherit from this class
18 */
19class syntax_plugin_dokugource extends DokuWiki_Syntax_Plugin {
20	// return some info
21	function getInfo() {
22		return confToHash(dirname(__FILE__).'/INFO');
23	}
24
25	function accepts($m) { return true;}
26	function getType() { return 'substition';}
27	function getPType() { return 'normal';}
28	function getSort() { return 5; }
29
30	// Connect pattern to lexer
31	function connectTo($mode){
32		$this->Lexer->addSpecialPattern('(?i)~~gourcecolor[<:>].+?~~', $mode, 'plugin_dokugource');
33	}
34
35	// Handle the match
36	function handle($match, $state, $pos, &$handler) {
37		return array();
38	}
39
40	/**
41	 * Create output
42	 */
43	function render($mode, &$renderer, $data) {
44		return true;
45	}
46} //class
47?>
48