summaryrefslogtreecommitdiff
path: root/inc/parser
diff options
context:
space:
mode:
Diffstat (limited to 'inc/parser')
-rw-r--r--inc/parser/handler.php4
-rw-r--r--inc/parser/renderer.php5
-rw-r--r--inc/parser/xhtml.php7
3 files changed, 10 insertions, 6 deletions
diff --git a/inc/parser/handler.php b/inc/parser/handler.php
index 4653cf603..dc5315fdd 100644
--- a/inc/parser/handler.php
+++ b/inc/parser/handler.php
@@ -11,8 +11,6 @@ class Doku_Handler {
var $meta = array(
'section' => FALSE,
- 'toc' => TRUE,
- 'cache' => TRUE,
);
var $rewriteBlocks = TRUE;
@@ -115,7 +113,7 @@ class Doku_Handler {
}
function notoc($match, $state, $pos) {
- $this->meta['toc'] = FALSE;
+ $this->_addCall('notoc',array(),$pos);
return TRUE;
}
diff --git a/inc/parser/renderer.php b/inc/parser/renderer.php
index a9c86c3f5..303af3db3 100644
--- a/inc/parser/renderer.php
+++ b/inc/parser/renderer.php
@@ -13,6 +13,7 @@ require_once DOKU_INC . 'inc/pluginutils.php';
class Doku_Renderer {
var $info = array(
'cache' => TRUE, // may the rendered result cached?
+ 'toc' => TRUE, // render the TOC?
);
@@ -20,6 +21,10 @@ class Doku_Renderer {
$this->info['cache'] = FALSE;
}
+ function notoc() {
+ $this->info['toc'] = FALSE;
+ }
+
//handle plugin rendering
function plugin($name,$data){
$plugin =& plugin_load('syntax',$name);
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index a54e5bcab..9950f28ce 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -89,7 +89,9 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
// prepend the TOC
- $this->doc = $this->render_TOC().$this->doc;
+ if($this->info['toc']){
+ $this->doc = $this->render_TOC().$this->doc;
+ }
}
/**
@@ -98,7 +100,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
* @author Andreas Gohr <andi@splitbrain.org>
*/
function render_TOC(){
- if(!count($this->toc)) return '';
+ if(count($this->toc) < 3) return '';
global $lang;
$out = '<div class="toc">'.DOKU_LF;
$out .= '<div class="tocheader toctoggle" id="toc__header">';
@@ -175,7 +177,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$hid = $this->_headerToLink($text,'true');
//handle TOC
-//FIXME if($this->meta['toc'] &&
if($level >= $conf['toptoclevel'] && $level <= $conf['maxtoclevel']){
// the TOC is one of our standard ul list arrays ;-)
$this->toc[] = array( 'hid' => $hid,