Translations of this page?:

Renderer Plugins

Renderer plugins aka. pluggable renderers, allow to implement different rendering mechanisms for DokuWiki. DokuWiki parses Wiki syntax into an instruction array which then is “rendered” to the desired output format. This output format is usually the XHTML to display a nicely formatted Wiki page. Pluggable renderers allow plugin authors to write their own renderer to output any format they want.

Synopsis

A Renderer Plugin example needs to define a class named renderer_plugin_example which extends Doku_Renderer1) or one of it's subclasses. The class needs to be stored in a file called lib/plugins/example/renderer.php.

You need to implement all methods of the Doku_Renderer class to implement full output of all DokuWiki's markup.

Calling a Renderer Plugin

There are two mechanisms for calling a renderer plugin.

  1. via export command. This is primarily used to format wiki pages in non-xhtml formats, (e.g. S5, slideshow). The output of your plugin is accessed by appending do=export_<plugin_name> to the page URL (e.g http://www.mywiki.com/doku.php?id=somepage&do=export_s5 or with URL rewriting, http://www.mywiki.com/somepage?do=export_s5).

    To make the plugin's export mode accessible to the wiki user, add a button or link somewhere using a syntax plugin or action plugin. To create the correct link you should use the exportlink function.

  2. via renderer_xhtml configuration setting. This setting is used to replace the standard dokuwiki xhtml renderer with a renderer plugin (only xhtml renderer plugins should be used).

    Plugins which wish to use this method should also implement the canRender() method, e.g.
        function canRender($format) {
          return ($format=='xhtml');
        }

    . This method allows DokuWiki to list the plugin in the options for this setting on its configuration page.

Sample use

For an example of a renderer plugin, see the slide show plugin s5.

 
devel/renderer_plugins.txt · Last modified: 2008/10/28 00:56 by 70.103.232.219
 

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported

Imprint Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
WikiForumIRCBugsTranslate