[dokuwiki] Changing pages from a plugin?

  • From: "Daniel Mitchell" <DanielMitchell@xxxxxxxxxxxxx>
  • To: <dokuwiki@xxxxxxxxxxxxx>
  • Date: Tue, 9 May 2006 16:33:47 -0600

 I'd like to write a plugin to do the following:

 I have a namespace tasks.
 I have pages tasks:inbox, tasks:home, tasks:work, tasks:garden, etc.
 I add tasks to the tasks:inbox page as I think of them (by using
procmail and a magic mailbox on my server) 
 I then want to move tasks from the 'inbox' page to the home/work/garden
pages.

 There's no easy way to do this within Dokuwiki -- I could open two
browser windows and cut and paste between them, but I'd like to do this
with a plugin.  I want the plugin to fire off when I _save_ the page,
and do something like:

 for each line in the text of currently being saved:
   if line begins with >>HOME
      delete this line from the current page and append it to tasks:home
   if line begins with >>WORK
      delete this line from the current page and append it to tasks:work
   if line begins with >>GARDEN
      delete this line from the current page and append it to
tasks:garden

  and so on (maybe just 'if line begins with >>, append it to
tasks:[first-word-of-line], even). That way I'd just edit the inbox to
tag each line with where it should go, and let the plugin take care of
things from there.
 
 Do I need to use an action plugin for this (and so presumably I need to
upgrade my wiki to the newest develonly version)? It seems like exactly
the sort of thing they're meant for, I'd hook IO_WIKIPAGE_SAVE and do my
stuff there, but I thought I should check before starting down the wrong
path.

  thanks,

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

Other related posts:

  • » [dokuwiki] Changing pages from a plugin?