[pmwiki-users] Page File Format: why? Tools to handle?

Ben Wilson dausha at gmail.com
Sat Mar 17 14:22:30 CDT 2007


On 3/17/07, Oliver Betz <list_ob at gmx.net> wrote:
> Hello All (especially PM):
>
> what were the reasons for the current method to store page markup text
> (in one line, with newline and percent sign converted)?

Think of the wiki page storage as a hash (associative array), with
each row of the file being a different key/value pair. When the page
is read into such a hash, then calling a specific value is a simple
hash reference. Specifically relating to the page text, it is
"$Page['text']"  Aliasing the newlines allows all the page text to be
displayed on one line this way.

This approach differs from DokuWiki where the current page is in one
file, and all metadata (including history) is stored separately.

As far as accessing the data separately, the PmWiki approach is
actually quite technology independent. What I mean is you can grep out
the page text and pipe through sed to display the source the way it is
written. I've used grep/sed, and Python both to read PmWiki pages.
Heck, I've even used a shell script doing the grep/sed piping to
convert the source (as read from the file, not PmWiki) into LaTex
markup.

> It's somewhat hard to access this fomat from outside, e.g. diff and
> merge.
>
> The PhpWiki "dump" format (multipart MIME) is much "friendlier" in
> this respect.
>
>
> Before I start to hack an import filter for Beyond Compare: Are there
> tools to convert, compare, edit the pages?
>
> Maybe I'm simply using the wrong tools...

I'd need a bit more specificity for me to help here. If you're talking
about converting from one wiki to another via external shell script,
then there are several ways to do it. My Pywe recipe should allow you
to upload a file into PmWiki, although that requires feeding through a
browser.

Another way to do it is to find what the default values are for a page
(e.g. Author, Text, etc.) and create a script that creates a hash,
converts the text ala PmWiki, and saves as a file. Perhaps a standard
library could be made in different languages to facilitate this?
-- 
Ben Wilson
"Words are the only thing which will last forever" --- Churchill



More information about the pmwiki-users mailing list