in reply to Writing a Wiki Parser

First of all, what don't you like about the wiki languages. This is markup that describes content as far as I can tell

A good simple parser module is Parse::RecDescent, I use it for a game management language. It has some rough edges. For example you should extract the perl code into subs instead of writing all in the parser because you otherwise get error messages with unusable line numbers. And I wouldn't use it for parsing complicated stuff like real computer languages, but for markup it should be good enough.

Replies are listed 'Best First'.
Re^2: Writing a Wiki Parser
by pileofrogs (Priest) on Jul 14, 2008 at 16:48 UTC

    Wikis (or at least the ones I've seen) describe how the document looks, eg __foo__ might mean underline foo.

    I want my markup to describe what the document says and later let my parser/processor implement the look. Then I get a consistent look, I can change it whenever I want and I can implement cool content related features, here's a pseudo code example.

    My favorite book is BOOK<Perl Programming>.  I also like BOOK<The Hobbit>.

    If I want to, I could render all book titles in bold, then I could later decide I want to render them in italics.I could put them in a list of all books mentioned in my document, I could make each book title include a link to Amazon... etc.. etc...

    You can do this with docbook, but it's a huge pain to actually write in. <document type=book link=true>The Hobbit</document> Note, that's not real docbook, but real docbook is that cumbersome.