summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
Diffstat (limited to 'inc')
-rw-r--r--inc/parser/renderer.php21
-rw-r--r--inc/parser/xhtml.php9
2 files changed, 21 insertions, 9 deletions
diff --git a/inc/parser/renderer.php b/inc/parser/renderer.php
index 89b28f248..43f071b32 100644
--- a/inc/parser/renderer.php
+++ b/inc/parser/renderer.php
@@ -1,4 +1,15 @@
<?php
+/**
+ * Renderer for XHTML output
+ *
+ * @author Harry Fuecks <hfuecks@gmail.com>
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/');
+
+require_once DOKU_INC . 'inc/parser/renderer.php';
+require_once DOKU_INC . 'inc/pluginutils.php';
+
class Doku_Renderer {
var $info = array(
'cache' => TRUE, // may the rendered result cached?
@@ -9,6 +20,16 @@ class Doku_Renderer {
$this->info['cache'] = FALSE;
}
+ //handle plugin rendering
+ function plugin($name,$data){
+ $plugin =& plugin_load('syntax',$name);
+ if($plugin != null){
+ // determine mode from renderer class name - format = "Doku_Renderer_<mode>"
+ $mode = substr(get_class($this), 14);
+ $plugin->render($mode,$this,$data);
+ }
+ }
+
function document_start() {}
function document_end() {}
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index 7dd1b8034..181562b2a 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -19,7 +19,6 @@ if ( !defined('DOKU_TAB') ) {
}
require_once DOKU_INC . 'inc/parser/renderer.php';
-require_once DOKU_INC . 'inc/pluginutils.php';
/**
* The Renderer
@@ -84,14 +83,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
}
- //handles plugin rendering
- function plugin($name,$data){
- $plugin =& plugin_load('syntax',$name);
- if($plugin != null){
- $plugin->render('xhtml',$this,$data);
- }
- }
-
function toc_open() {
global $lang;
$this->doc .= '<div class="toc">'.DOKU_LF;