[dokuwiki] Still struggling with getting plugins to nest successfully - maybe what I want isn't possible?

  • From: Chris G <cl@xxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Sat, 18 Dec 2010 17:27:23 +0000

I'm still struggling to get nested plugin syntax to do what I want, I'm
learning lots about Dokuwiki in the process though!  :-)

What I am after is something like the following:-

    <ab>This is some AB data<xv>xv data</xv>This is some more AB data</ab>

The ab plugin is one which 'eats' all of the data between the <ab> and
the </ab>, does some processing and outputs something entirely different
via "renderer->doc .= <something>".

The xv plugin simply needs to provide some data to the input which
plugin ab uses.  I.e. the above will become:-

    <ab>This is some AB data Result of xv plugin substitution This is some more 
AB data</ab>

and then the ab plugin will do its work.

Since the xv plugin is producing its data from a link parameter it can
only provide its data at render() time.

I'm beginning the think that getting the data produced by xv at render()
time expanded within the data that one feeds into the ab plugin simply
isn't possible.  Am I right?  Or can anyone see a way of producing the
effect that I want? (well, it's possible if the ab plugin 'knows about'
the xv plugin, see below)

If there was a way to get Dokuwiki to process that <xv> plugin before
it processes the <ab> plugin then I might be able to do what I want but
I think it's inevitable that the data is processed sequentially and it
will hit the <ab> before the <xv>.

It sounds as if an action plugin using PARSER_WIKITEXT_PREPROCESS would
do what I want but this idea is spoilt by the caching as
PARSER_WIKITEXT_PREPROCESS is only called if the text changes and in my
case it doesn't.  The whole point is that the xv plugin picks up a
change from the calling link and the page being displayed *doesn't*
change. 

Am I talking sense here?  If so I may explore other completely different
approaches.

One possibility is simply to get the ab plugin to do all the work rather
than trying to nest the xv one within it.  This is OK and will work, the
trouble is that I need the xv plugin's ability elsewhere by itself.  I
think this may be the only way though.

-- 
Chris Green
-- 
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist

Other related posts: