xref: /dokuwiki/inc/parser/renderer.php (revision 44881bd0f492e789063188af34111af4b4117028)
10cecf9d5Sandi<?php
261faf446Schris/**
35587e44cSchris * Renderer output base class
461faf446Schris *
561faf446Schris * @author Harry Fuecks <hfuecks@gmail.com>
661faf446Schris * @author Andreas Gohr <andi@splitbrain.org>
761faf446Schris */
861faf446Schrisif(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/');
961faf446Schris
1061faf446Schrisrequire_once DOKU_INC . 'inc/parser/renderer.php';
1161faf446Schrisrequire_once DOKU_INC . 'inc/pluginutils.php';
1261faf446Schris
130cecf9d5Sandiclass Doku_Renderer {
149dc2c2afSandi    var $info = array(
15*44881bd0Shenning.noren        'cache' => true, // may the rendered result cached?
16*44881bd0Shenning.noren        'toc'   => true, // render the TOC?
179dc2c2afSandi    );
189dc2c2afSandi
199dc2c2afSandi
209dc2c2afSandi    function nocache() {
21*44881bd0Shenning.noren        $this->info['cache'] = false;
229dc2c2afSandi    }
230cecf9d5Sandi
24e41c4da9SAndreas Gohr    function notoc() {
25*44881bd0Shenning.noren        $this->info['toc'] = false;
26e41c4da9SAndreas Gohr    }
27e41c4da9SAndreas Gohr
2861faf446Schris    //handle plugin rendering
2961faf446Schris    function plugin($name,$data){
3061faf446Schris        $plugin =& plugin_load('syntax',$name);
3161faf446Schris        if($plugin != null){
3261faf446Schris            // determine mode from renderer class name - format = "Doku_Renderer_<mode>"
3361faf446Schris            $mode = substr(get_class($this), 14);
3461faf446Schris            $plugin->render($mode,$this,$data);
3561faf446Schris        }
3661faf446Schris    }
3761faf446Schris
385587e44cSchris    /**
395587e44cSchris     * handle nested render instructions
405587e44cSchris     * this method (and nest_close method) should not be overloaded in actual renderer output classes
415587e44cSchris     */
425587e44cSchris    function nest($instructions) {
435587e44cSchris
445587e44cSchris      foreach ( $instructions as $instruction ) {
455587e44cSchris        // execute the callback against ourself
465587e44cSchris        call_user_func_array(array(&$this, $instruction[0]),$instruction[1]);
475587e44cSchris      }
485587e44cSchris    }
495587e44cSchris
505587e44cSchris    // dummy closing instruction issued by Doku_Handler_Nest, normally the syntax mode should
515587e44cSchris    // override this instruction when instantiating Doku_Handler_Nest - however plugins will not
525587e44cSchris    // be able to - as their instructions require data.
535587e44cSchris    function nest_close() {}
545587e44cSchris
550cecf9d5Sandi    function document_start() {}
560cecf9d5Sandi
570cecf9d5Sandi    function document_end() {}
580cecf9d5Sandi
594fced885SAndreas Gohr    function render_TOC() { return ''; }
600cecf9d5Sandi
61af587fa8Sandi    function header($text, $level, $pos) {}
620cecf9d5Sandi
6335dae8b0SBen Coburn    function section_edit($start, $end, $level, $name) {}
6435dae8b0SBen Coburn
650cecf9d5Sandi    function section_open($level) {}
660cecf9d5Sandi
670cecf9d5Sandi    function section_close() {}
680cecf9d5Sandi
690cecf9d5Sandi    function cdata($text) {}
700cecf9d5Sandi
710cecf9d5Sandi    function p_open() {}
720cecf9d5Sandi
730cecf9d5Sandi    function p_close() {}
740cecf9d5Sandi
750cecf9d5Sandi    function linebreak() {}
760cecf9d5Sandi
770cecf9d5Sandi    function hr() {}
780cecf9d5Sandi
790cecf9d5Sandi    function strong_open() {}
800cecf9d5Sandi
810cecf9d5Sandi    function strong_close() {}
820cecf9d5Sandi
830cecf9d5Sandi    function emphasis_open() {}
840cecf9d5Sandi
850cecf9d5Sandi    function emphasis_close() {}
860cecf9d5Sandi
870cecf9d5Sandi    function underline_open() {}
880cecf9d5Sandi
890cecf9d5Sandi    function underline_close() {}
900cecf9d5Sandi
910cecf9d5Sandi    function monospace_open() {}
920cecf9d5Sandi
930cecf9d5Sandi    function monospace_close() {}
940cecf9d5Sandi
950cecf9d5Sandi    function subscript_open() {}
960cecf9d5Sandi
970cecf9d5Sandi    function subscript_close() {}
980cecf9d5Sandi
990cecf9d5Sandi    function superscript_open() {}
1000cecf9d5Sandi
1010cecf9d5Sandi    function superscript_close() {}
1020cecf9d5Sandi
1030cecf9d5Sandi    function deleted_open() {}
1040cecf9d5Sandi
1050cecf9d5Sandi    function deleted_close() {}
1060cecf9d5Sandi
1070cecf9d5Sandi    function footnote_open() {}
1080cecf9d5Sandi
1090cecf9d5Sandi    function footnote_close() {}
1100cecf9d5Sandi
1110cecf9d5Sandi    function listu_open() {}
1120cecf9d5Sandi
1130cecf9d5Sandi    function listu_close() {}
1140cecf9d5Sandi
1150cecf9d5Sandi    function listo_open() {}
1160cecf9d5Sandi
1170cecf9d5Sandi    function listo_close() {}
1180cecf9d5Sandi
1190cecf9d5Sandi    function listitem_open($level) {}
1200cecf9d5Sandi
1210cecf9d5Sandi    function listitem_close() {}
1220cecf9d5Sandi
123699afdebSchris    function listcontent_open() {}
1240cecf9d5Sandi
1250cecf9d5Sandi    function listcontent_close() {}
1260cecf9d5Sandi
1270cecf9d5Sandi    function unformatted($text) {}
1280cecf9d5Sandi
1290cecf9d5Sandi    function php($text) {}
1300cecf9d5Sandi
1310cecf9d5Sandi    function html($text) {}
1320cecf9d5Sandi
1330cecf9d5Sandi    function preformatted($text) {}
1340cecf9d5Sandi
1350cecf9d5Sandi    function file($text) {}
1360cecf9d5Sandi
1370cecf9d5Sandi    function quote_open() {}
1380cecf9d5Sandi
1390cecf9d5Sandi    function quote_close() {}
1400cecf9d5Sandi
1410cecf9d5Sandi    function code($text, $lang = NULL) {}
1420cecf9d5Sandi
1430cecf9d5Sandi    function acronym($acronym) {}
1440cecf9d5Sandi
1450cecf9d5Sandi    function smiley($smiley) {}
1460cecf9d5Sandi
1470cecf9d5Sandi    function wordblock($word) {}
1480cecf9d5Sandi
1490cecf9d5Sandi    function entity($entity) {}
1500cecf9d5Sandi
1510cecf9d5Sandi    // 640x480 ($x=640, $y=480)
1520cecf9d5Sandi    function multiplyentity($x, $y) {}
1530cecf9d5Sandi
1540cecf9d5Sandi    function singlequoteopening() {}
1550cecf9d5Sandi
1560cecf9d5Sandi    function singlequoteclosing() {}
1570cecf9d5Sandi
1580cecf9d5Sandi    function doublequoteopening() {}
1590cecf9d5Sandi
1600cecf9d5Sandi    function doublequoteclosing() {}
1610cecf9d5Sandi
1620cecf9d5Sandi    // $link like 'SomePage'
1630cecf9d5Sandi    function camelcaselink($link) {}
1640cecf9d5Sandi
1650e1c636eSandi    // $link like 'wiki:syntax', $title could be an array (media)
1660cecf9d5Sandi    function internallink($link, $title = NULL) {}
1670cecf9d5Sandi
1680cecf9d5Sandi    // $link is full URL with scheme, $title could be an array (media)
1690cecf9d5Sandi    function externallink($link, $title = NULL) {}
1700cecf9d5Sandi
1710cecf9d5Sandi    // $link is the original link - probably not much use
1720cecf9d5Sandi    // $wikiName is an indentifier for the wiki
1730cecf9d5Sandi    // $wikiUri is the URL fragment to append to some known URL
1740cecf9d5Sandi    function interwikilink($link, $title = NULL, $wikiName, $wikiUri) {}
1750cecf9d5Sandi
1760cecf9d5Sandi    // Link to file on users OS, $title could be an array (media)
1770cecf9d5Sandi    function filelink($link, $title = NULL) {}
1780cecf9d5Sandi
1790cecf9d5Sandi    // Link to a Windows share, , $title could be an array (media)
1800cecf9d5Sandi    function windowssharelink($link, $title = NULL) {}
1810cecf9d5Sandi
182699afdebSchris//  function email($address, $title = NULL) {}
183699afdebSchris    function emaillink($address, $name = NULL) {}
1840cecf9d5Sandi
1850cecf9d5Sandi    function internalmedialink (
1860cecf9d5Sandi        $src,$title=NULL,$align=NULL,$width=NULL,$height=NULL,$cache=NULL
1870cecf9d5Sandi        ) {}
1880cecf9d5Sandi
1890cecf9d5Sandi    function externalmedialink(
1900cecf9d5Sandi        $src,$title=NULL,$align=NULL,$width=NULL,$height=NULL,$cache=NULL
1910cecf9d5Sandi        ) {}
1920cecf9d5Sandi
1930cecf9d5Sandi    function table_open($maxcols = NULL, $numrows = NULL){}
1940cecf9d5Sandi
1950cecf9d5Sandi    function table_close(){}
1960cecf9d5Sandi
1970cecf9d5Sandi    function tablerow_open(){}
1980cecf9d5Sandi
1990cecf9d5Sandi    function tablerow_close(){}
2000cecf9d5Sandi
2010cecf9d5Sandi    function tableheader_open($colspan = 1, $align = NULL){}
2020cecf9d5Sandi
2030cecf9d5Sandi    function tableheader_close(){}
2040cecf9d5Sandi
2050cecf9d5Sandi    function tablecell_open($colspan = 1, $align = NULL){}
2060cecf9d5Sandi
2070cecf9d5Sandi    function tablecell_close(){}
2080cecf9d5Sandi
2090cecf9d5Sandi}
2100cecf9d5Sandi
211340756e4Sandi
2129dc2c2afSandi//Setup VIM: ex: et ts=4 enc=utf-8 :
213