[Moin-devel] writing a moin parser

Thomas Waldmann tw-public at gmx.de
Wed Jun 15 02:27:14 EDT 2005


> are there any docs anywhere on writing a moin parser?  i.e. how a
> parser fits in with the rest of moin, the interfaces, etc.

Not really, but there is some example code in MoinMoin/parser/*.py. :)

And it is not THAT complicated.

A parser gets the raw page text and must generate calls to the formatter 
to produce output.

The existing wiki parser does this by parsing the raw page line-per-line 
with that big ugly regular expression and doing formatter calls 
depending on what matched. It keeps some state in variables like in_pre 
or in_table.

> our users would like to be able to use a simpler wiki markup language
> like in jspwiki.

Maybe it is a good idea to make a page on the moinmoin wiki about that 
topic. There might be 2 different scenarios:

1) You want to make a jspwiki compatible parser as an additional parser 
for moin (because your users are used to that and you have data in that 
markup). Good luck in that case! :)

2) You just want to improve the moinmoin default markup and parser.

We also want that, but there definitely needs to be some very concrete 
and common plan to make this work. E.g. we want to simplify the link 
markup, which is currently too complicated and too irregular. Same thing 
applies to "include" long-term. We also want to generate xhtml at some 
time, but with that line-by-line parser it won't be possible. We also 
want to use DOM to make include work better. attachments shall be 
unified (in storage as well as in linking / including).

Maybe get on #moin irc channel on irc.freenode.net to talk about it, if 
you want to help with that.





More information about the Moin-devel mailing list