summaryrefslogtreecommitdiff
path: root/inc/parser
diff options
context:
space:
mode:
Diffstat (limited to 'inc/parser')
-rw-r--r--inc/parser/handler.php6
-rw-r--r--inc/parser/parser.php11
-rw-r--r--inc/parser/renderer.php10
3 files changed, 25 insertions, 2 deletions
diff --git a/inc/parser/handler.php b/inc/parser/handler.php
index 91d884345..ce0fb5d4c 100644
--- a/inc/parser/handler.php
+++ b/inc/parser/handler.php
@@ -12,6 +12,7 @@ class Doku_Handler {
var $meta = array(
'section' => FALSE,
'toc' => TRUE,
+ 'cache' => TRUE,
);
var $rewriteBlocks = TRUE;
@@ -97,6 +98,11 @@ class Doku_Handler {
$this->meta['toc'] = FALSE;
return TRUE;
}
+
+ function nocache($match, $state, $pos) {
+ $this->_addCall('nocache',array(),$pos);
+ return TRUE;
+ }
function linebreak($match, $state, $pos) {
$this->_addCall('linebreak',array(),$pos);
diff --git a/inc/parser/parser.php b/inc/parser/parser.php
index 8c6b7329b..7de715b95 100644
--- a/inc/parser/parser.php
+++ b/inc/parser/parser.php
@@ -198,6 +198,15 @@ class Doku_Parser_Mode_NoToc extends Doku_Parser_Mode {
}
//-------------------------------------------------------------------
+class Doku_Parser_Mode_NoCache extends Doku_Parser_Mode {
+
+ function connectTo($mode) {
+ $this->Lexer->addSpecialPattern('~~NOCACHE~~',$mode,'nocache');
+ }
+
+}
+
+//-------------------------------------------------------------------
class Doku_Parser_Mode_Linebreak extends Doku_Parser_Mode {
function connectTo($mode) {
@@ -816,7 +825,7 @@ function Doku_Parser_Substition() {
$modes = array(
'acronym','smiley','wordblock','entity','camelcaselink',
'internallink','media','externallink','linebreak','emaillink',
- 'windowssharelink','filelink','notoc','multiplyentity',
+ 'windowssharelink','filelink','notoc','nocache','multiplyentity',
'quotes','rss',
);
return $modes;
diff --git a/inc/parser/renderer.php b/inc/parser/renderer.php
index 2fd5bfe6f..89b28f248 100644
--- a/inc/parser/renderer.php
+++ b/inc/parser/renderer.php
@@ -1,5 +1,13 @@
<?php
class Doku_Renderer {
+ var $info = array(
+ 'cache' => TRUE, // may the rendered result cached?
+ );
+
+
+ function nocache() {
+ $this->info['cache'] = FALSE;
+ }
function document_start() {}
@@ -167,4 +175,4 @@ class Doku_Renderer {
}
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=4 enc=utf-8 :