[pmwiki-devel] parse pages as they are saved
eemeli at gmail.com
Mon Feb 23 03:07:59 CST 2009
When a page is saved PmWiki calls the
UpdatePage($pagename,&$page,&$new) function, which in turns calls the
functions listed in the $EditFields array. That's the place to add
your hook, eg. with $EditFunctions = 'YourFunctionName'; . Note that
these functions get called every time any page editing happens, so you
should check that the global variable $EnablePost is true. To really
make sure that the page has been updated to disk, you can check that
$IsPagePosted is true, provided you add your function to the end of
the $EditFields array.
To translate PmWiki markup to HTML, you should use the
MarkupToHTML($pagename,$text) function. For a more specifc example,
take a look at SaveAttributes(), one of the functions in $EditFields.
All of these variables and functions are defined in pmwiki.php.
2009/2/23 Ryan O'Toole <rotoole at gmail.com>:
> I am trying to write a hook that will parse a page each time it's saved for
> some specific data that I'd like to insert into a database. Can someone
> point me to the right function or file to look at that would handle such an
> operation. I'm assuming there is already something pretty close to what I
> need being done to handle the translation of pmwiki markup to html.
> pmwiki-devel mailing list
> pmwiki-devel at pmichaud.com
More information about the pmwiki-devel