diff --git a/inc/parser/handler.php b/inc/parser/handler.php index 4653cf603264729ba9a0fe0a2542f6458863b858..dc5315fdd203f98bc9bb81eea95fb7e3a765fbde 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 a9c86c3f52a9ea9ad21b1eecad39d2122a356b73..303af3db3a340e4663f90ef9315615377839f77b 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 a54e5bcaba6747e31d4b81ab78aa781d8677460c..9950f28cec033fcb8624c111d5cb05d180e75719 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,