From 6b7b33dca364d6167321792ffb4459a604fbab82 Mon Sep 17 00:00:00 2001 From: hfuecks Date: Mon, 7 Nov 2005 01:05:54 +0100 Subject: xhtmlsummary_patch darcs-hash:20051107000554-e96b6-1a7ae7a9d5e820d3c52629570ff33f8e75bc4a46.gz --- inc/parser/xhtmlsummary.php | 85 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 inc/parser/xhtmlsummary.php (limited to 'inc/parser/xhtmlsummary.php') diff --git a/inc/parser/xhtmlsummary.php b/inc/parser/xhtmlsummary.php new file mode 100644 index 000000000..eeb684e57 --- /dev/null +++ b/inc/parser/xhtmlsummary.php @@ -0,0 +1,85 @@ +doc .= DOKU_LF.'
'.DOKU_LF; + } + + function document_end() { + $this->doc = $this->sum_summary; + $this->doc .= DOKU_LF.'
'.DOKU_LF; + } + + function toc_open() { + $this->sum_summary .= $this->doc; + } + + function toc_close() { + $this->doc = ''; + } + + function header($text, $level, $pos) { + if ( !$this->sum_pageTitle ) { + $this->info['sum_pagetitle'] = $text; + $this->sum_pageTitle = TRUE; + } + $this->doc .= DOKU_LF.''; + $this->doc .= $this->_xmlEntities($text); + $this->doc .= "".DOKU_LF; + } + + function section_open($level) { + if ( $this->sum_capture ) { + $this->sum_inSection = TRUE; + } + } + + function section_close() { + if ( $this->sum_capture && $this->sum_inSection ) { + $this->sum_summary .= $this->doc; + $this->sum_capture = FALSE; + } + } + + function p_open() { + if ( $this->sum_capture && $this->sum_paragraphs < 2 ) { + $this->sum_paragraphs++; + } + parent :: p_open(); + } + + function p_close() { + parent :: p_close(); + if ( $this->sum_capture && $this->sum_paragraphs >= 2 ) { + $this->sum_summary .= $this->doc; + $this->sum_capture = FALSE; + } + } + +} + + +//Setup VIM: ex: et ts=2 enc=utf-8 : -- cgit v1.2.3