[dokuwiki] Re: preventing instruction level caching

  • From: Christopher Smith <chris@xxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Wed, 29 Apr 2009 17:36:32 +0100


On 29 Apr 2009, at 10:51, James Lin wrote:


To output the XHTML of some syntax:

$syntax = '{{indexmenu>....}}';
print p_render('xhtml', p_get_instructions($syntax), $info);

Note: This is an "expensive" operation as it instantiates a new renderer for each p_render() call. Using it for sth. like you want to achive shouldn't be a
problem though as you problably only call it once in your plugin.

cool! will give a try tomorrow at work. Cheers!


I'm not sure what the indexmenu does internally and it could of course make use of other rendering functions, but you could grab the plugin and call its render method directly using a mocked up object to provide the output string ($doc) or create a new renderer object but avoid the expensive initialization carried out by p_render (setting up smileys, acronyms, link schemes, etc, etc).

- Chris
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: