[pmwiki-users] Operating on wiki.d outside of PMWiki

Patrick R. Michaud pmichaud at pobox.com
Thu Dec 14 15:08:17 CST 2006


On Wed, Dec 13, 2006 at 11:55:43PM -1000, Sivakatirswami wrote:
> If  I "operate" on files in wiki.d  in two ways:
> 
> 1. Manipulate file names
> 2. manipulate content on pages
> 
> The format is easily parseable and one could read and write directly
> to the text= node, and, if the filenames  were changed by an process
> external to PMwiki, I would of course need to update the  name=node
> to match the new file name... but all that's quite easy to do.  I just 
> wonder
> if PMwiki is going to have a melt down if we make such changes.

PmWiki won't melt down.  In fact, it's not even necessary to
update the name= attribute; PmWiki maintains name= as a form of
backup redundancy, not because it needs or uses it anywhere.

The only thing that will be an issue is the .pageindex file, which
will be out of sync with any page files that are manipulated directly.
An easy solution is to simply remove the .pageindex file whenever
a page is changed directlyi -- PmWiki will then rebuild .pageindex
over subsequent requests.

> Also where is the primary PMwiki mark strings to HTML output array
> that  I might put into my own arrays to operate properly on the text=node?

They're held in the $MarkupTable array.  Each entry of $MarkupTable
is itself an array with several entries -- the ones you'll be
looking for are:

    'pat' == the pattern to be replaced
    'rep' == what to replace it with

Note that many times 'rep' is itself an executable function, as
opposed to a simple replacement string.

Pm




More information about the pmwiki-users mailing list