>>>> "NP" == Nick Pisarro
<nickp(a)aperture.com> writes:
NP> One, is a one or two pass wiki parser. The current parser,
NP> which performs dozens of passes, probably degrades by the
NP> square of the file size. I have added some thoughts to
NP>
http://meta.wikipedia.org/wiki/One-pass_parser
So, one thing I think is important is changing the parser to create an
intermediate tree structure before generating HTML. That way, we'd be
able to output multiple data formats: PDF, XML, what-have-you.
I realize that few Wiki engines do this, probably because it's so easy
to just use regex substitutions for the most simple Wiki markup. But
separating the two functions of the parser -- parsing Wiki markup,
generating HTML -- would make the parser a lot easier to work with,
and we could make enhancements more easily. Also, of course, the whole
multiple output channel thing.
This would have a performance cost (BOO!) but it might be mitigated by
doing the parsing to intermediate format at save time, and storing the
intermediate format in the DB. One idea is parsing to a tree
structure, then storing that structure as YAML.
It's an idea to consider, even if we discard it. If we're going to
rework the parser, then this is the time to consider it.
~ESP
--
Evan Prodromou <evan(a)wikitravel.org>
Wikitravel -
http://www.wikitravel.org/
The free, complete, up-to-date and reliable world-wide travel guide