[dokuwiki] Re: Plugins, modes and, in particular, 'substition'

  • From: Chris G <cl@xxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Mon, 17 Oct 2011 10:09:48 +0100

On Sun, Oct 16, 2011 at 09:36:16PM +0200, Michael Hamann wrote:
> Hi,
> On Sun, Oct 16, 2011 at 5:55 PM, Chris G <cl@xxxxxxxx> wrote:
> > I'm interested in getting some plugins to nest, such that I can set the
> > parameters for one plugin (the include plugin in particular) with the
> > result of another plugin (it's a plugin I have written myself, called xv).
> I would suggest the following: If you don't mind being dependent on
> internal changes in the include plugin, I would simply call the render
> function of the include plugin, or rather the plugin function of the
> renderer with the parameters you want. The handle function of the
> include plugin is pretty small so it won't be a big problem to do the
> processing of the parameters in your plugin. The only problem might
> be, that the include plugin expects the section level as last
> parameter, just look at what the action part of the include plugin
> does. You could also call the helper functions the include plugin
> provides, but then you don't get the full cache handling the include
> plugin does.
> If you want to do even more advanced stuff you could also simply
> modify the instructions, i.e. when you find the instructions of your
> plugin and then the include plugin afterwards, modify the instructions
> of the include plugin. Just look at the include plugin in order to get
> some ideas how you could modify the instructions.
> Btw. concerning your other email: once you have the instructions of
> the syntax you want to execute, you can simply strip the
> document_start and document_end instructions, close the currently
> opened section, call the nest() function of the renderer with the
> instructions you want to execute and then open the section again
> (that's what the include plugin needs the section level for). This is
> a lot faster than generating a new renderer by calling p_render. When
> you generate the instructions you want to execute in the
> handle()-function, the render function should be as fast as with
> "normal" instructions.
> A "clean" solution without such "hacks" is unfortunately not really
> possible as the DokuWiki parser doesn't support that afaik.
Thanks for all the ideas, they've given me some other approaches at
least.  They also (maybe) indicate that my present solution isn't so

The idea for using nest() rather than p_render() is useful, I'm not
hitting any sort of performance problems at the moment but there is one
application where I might.

Chris Green
DokuWiki mailing list - more info at

Other related posts: