3 * Renderer for XHTML output
5 * @author Harry Fuecks <hfuecks@gmail.com>
6 * @author Andreas Gohr <andi@splitbrain.org>
8 // must be run within Dokuwiki
9 if(!defined('DOKU_INC')) die();
11 // we inherit from the XHTML renderer instead directly of the base renderer
12 require_once DOKU_INC
.'inc/parser/xhtml.php';
17 class renderer_plugin_s5
extends Doku_Renderer_xhtml
{
18 var $slideopen = false;
23 * the format we produce
26 // this should be 's5' usally, but we inherit from the xhtml renderer
27 // and produce XHTML as well, so we can gain magically compatibility
28 // by saying we're the 'xhtml' renderer here.
34 * Initialize the rendering
36 function document_start() {
40 parent
::document_start();
42 // store the content type headers in metadata
44 'Content-Type' => 'text/html; charset=utf-8'
46 p_set_metadata($ID,array('format' => array('s5' => $headers) ));
47 $this->base
= DOKU_BASE
.'lib/plugins/s5/ui/';
48 $this->tpl
= $this->getConf('template');
52 * Print the header of the page
54 * Gets called when the very first H1 header is discovered. It includes
55 * all the S5 CSS and JavaScript magic
57 function s5_init($title){
63 //throw away any previous content
65 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
66 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
67 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="'.$conf['lang'].'"
68 lang="'.$conf['lang'].'" dir="'.$lang['direction'].'">
71 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
72 <title>'.hsc($title).'</title>
74 <meta name="generator" content="S5" />
75 <meta name="version" content="S5 1.1" />
76 <!-- configuration parameters -->
77 <meta name="defaultView" content="slideshow" />
78 <meta name="controlVis" content="hidden" />
79 <!-- style sheet links -->
80 <link rel="stylesheet" href="'.DOKU_BASE
.'lib/styles/style.css" type="text/css" media="screen" />
81 <link rel="stylesheet" href="'.$this->base
.$this->tpl
.'/slides.css" type="text/css" media="projection" id="slideProj" />
82 <link rel="stylesheet" href="'.$this->base
.'default/outline.css" type="text/css" media="screen" id="outlineStyle" />
83 <link rel="stylesheet" href="'.$this->base
.'default/print.css" type="text/css" media="print" id="slidePrint" />
84 <link rel="stylesheet" href="'.$this->base
.'default/opera.css" type="text/css" media="projection" id="operaFix" />
86 <script src="'.$this->base
.'default/slides.js" type="text/javascript"></script>
90 <div id="controls"><!-- DO NOT EDIT --></div>
91 <div id="currentSlide"><!-- DO NOT EDIT --></div>
92 <div id="header"></div>
95 <h2>'.hsc($conf['title']).' • '.strftime($conf['dformat'],$INFO['lastmod']).'</h2>
99 <div class="presentation">
104 * Closes the document
106 function document_end(){
107 // we don't care for footnotes and toc
108 // but cleanup is nice
109 $this->doc
= preg_replace('#<p>\s*</p>#','',$this->doc
);
111 if($this->slideopen
){
112 $this->doc
.= '</div>'.DOKU_LF
; //close previous slide
114 $this->doc
.= '</div>
120 * This is what creates new slides
122 * A new slide is started for each H2 header
124 function header($text, $level, $pos) {
126 if(!$this->slideopen
){
127 $this->s5_init($text); // this is the first slide
135 if($this->slideopen
){
136 $this->doc
.= '</div>'.DOKU_LF
; //close previous slide
138 $this->doc
.= '<div class="slide">'.DOKU_LF
;
139 $this->slideopen
= true;
141 $this->doc
.= '<h'.($level-1).'>';
142 $this->doc
.= $this->_xmlEntities($text);
143 $this->doc
.= '</h'.($level-1).'>'.DOKU_LF
;
147 * Top-Level Sections are slides
149 function section_open($level) {
151 $this->doc
.= '<div class="slidecontent">'.DOKU_LF
;
153 $this->doc
.= '<div>'.DOKU_LF
;
159 * Throw away footnote
161 function footnote_close() {
162 // recover footnote into the stack and restore old content
163 $footnote = $this->doc
;
164 $this->doc
= $this->store
;
169 * No acronyms in a presentation
171 function acronym($acronym){
172 $this->doc
.= $this->_xmlEntities($acronym);
176 * A line stops the slide and start the handout section
179 $this->doc
.= '</div>'.DOKU_LF
;
180 $this->doc
.= '<div class="handout">'.DOKU_LF
;
184 //Setup VIM: ex: et ts=4 enc=utf-8 :