[dokuwiki] Plugin writing questions / recursive parser

  • From: Christopher Arndt <chris.arndt@xxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Fri, 23 Sep 2005 02:09:33 +0100


I just tried DokuWiki 2 days ago for the first time and I must say I really
like it! Unlike with MediaWiki, I was immediately able to figure out, how to
adapt thins to my liking and the source code is structured very well too.

Anyway, in trying to make DokuWiki more useful as a documentation writer's
environment, I decided to write a plugin, that allows certain text on a page to
be hidden depending on what user is logged in. This would be especially useful
in conjunction with a tool, that saves a statical version of the Wiki, so you
could deploy slightly different versions of your wiki to e.g. different 

The syntax I imagined goes something like this:

<if joe>
Here comes some text...

=> show text only if the logged in user is "joe"

<if not joe>
Here comes some text...

=> show text only if the logged in user is *not* "joe"

<if @clients>
Legal blurb here...

=> show the legal blurb only if the logged in user belongs to the group 

<if not @clients,boss>
FIXME The following description is totally out of date!

=> leave users of the group "clients" and user "boss" unaware of "inaccuracies"
of your text ;-)

I am aware, that the hidden text would still be visible through the source
code. As I already said, this plugin would mostly be useful when exporting your
content somehow.

The problem with this plugin would be, that basically any syntax should be
allowed between the start/end tags. But that is AFAICS not easily achievable
with the current plugin system. Am I missing something here?

IMHO the parser should allow recursive parsing, i.e. the plugin would just feed
the wiki text it finds between the start/end tags to the parser again (if the
condition matches). Is this already possible/feasible?


Other related posts: