Steve Bennett wrote:
On 2/12/08, Stephen Bain
<stephen.bain(a)gmail.com> wrote:
Ah ha! Thanks. And this page:
http://en.wikipedia.org/wiki/Special:Version
answers my next question, which was going to be "just how flaming many
of these extensions are they, and how difficult will it be to cope
with them?"
Please do not even try to cover individual extension (there were more than 700
alone on
mediawiki.org last i checked). The ones relevant come in two varieties:
1) "parser hook" extensions (aka tag hooks aka extension tags), which conform
to
a (fuzzy) xml syntax: <name foo="bar" bla=12 blubb>...</name>; The
... in
between the tags should be completely opaque, the parser should skip everything
up to the closing tag. There is no support for nesting, no expansion of
templates or template parameters, nothing. Also, the the text *returned* by the
extension is expected to be HTML, and should be passed through the generation
stage untouched.
2) "parser functions" which conform to an extended template syntax:
{{#name: param|param|param...}}; In this case, all parameters have to be fully
parsed and expanded, so this needs to work:
{{#foo:xx|{{#bar|{{{bla|frob}}}}}|{{something}}}}
The output of parser functions may be wikitext that has to be further processed
in context (just as if it where a normal template), or it may be HTML that has
to be passed through (and a few more minor options). This is determined by each
extension when registering the hook.
These two types of structures should be handeled by the parser, and stored asa
structure for further processing by extensions (if no extension handles them,
they should be re-assembled into plain text).
Extensions may also introduce arbitrary magic words. Such extensions are
impossible to make compatible with a new ANTRL based parser, they would have to
be rewritten as plugins to such a parser. Would it be possible to allow such
plugins? I'm thinking of allowing a way for extensions to redifine individula
bits of the grammar.
Regards,
Daniel