Round trip: Mediawiki text -> Parse Tree -> Mediawiki text

14 views
Skip to first unread message

Bjoern

unread,
Apr 18, 2009, 2:14:11 PM4/18/09
to mwlib
Dear all,

Is it possible to 'round trip' a selection of wiki pages using mwlib?
I.e. can I go from Mediawiki text to Parse Tree, and then back to
mediawiki text?

I guess the Parse Tree format is documented somewhere, but I couldn't
find it. (I've been looking at the the wiki pages, and the short
example on http://code.pediapress.com/wiki/wiki/mwlib.)

Would it be easy to go from the Parse Tree to xml, and then back to
mediawiki text? (This might be obvious for a python programmer.)

Best,
Bjoern







Volker Haas

unread,
Apr 28, 2009, 9:45:08 AM4/28/09
to mw...@googlegroups.com
Hi Bjoern,

currently it is not possible to convert the parse tree back to mediawiki
markup. To achieve this, a mediawiki writer had to be written. Probably
this is not too hard but notheless tedious and a couple of details will
be tricky. If you are interested in learning Python this might be a good
exercise ;)
Another hard part of the task is the incomplete/missing documentation
for the parse tree...At some point we'll improve this, but definitely
not by tomorrow. So currently you have to look at the source code of one
of the writers as an example an check the parser/advtree for reference.

Regards,
Volker
--
volker haas brainbot technologies ag
fon +49 6131 2116394 boppstraße 64
fax +49 6131 2116392 55118 mainz
volke...@brainbot.com http://www.brainbot.com/

Reply all
Reply to author
Forward
0 new messages