[dokuwiki] Re: Plugin writing questions / recursive parser

  • From: Redeeman <redeeman@xxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Fri, 23 Sep 2005 03:33:15 +0200

On Fri, 2005-09-23 at 02:09 +0100, Christopher Arndt wrote:
> Hi,
> 
> 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 
> customers.
> 
> The syntax I imagined goes something like this:
> 
> <if joe>
> Here comes some text...
> </if>
> 
> => show text only if the logged in user is "joe"
> 
> <if not joe>
> Here comes some text...
> </if>
> 
> => show text only if the logged in user is *not* "joe"
> 
> <if @clients>
> Legal blurb here...
> </if>
> 
> => show the legal blurb only if the logged in user belongs to the group 
> "clients"
> 
> <if not @clients,boss>
> FIXME The following description is totally out of date!
> </if>
> 
> => 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?

i think this is possible, you just gotta change what type of stuff you
allow, i think this is described at the plugin howto. but im not 100%
sure

> Chris
> 

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

Other related posts: