axelclk(a)t-online.de schrieb:
I started to write a renderer in Java for the previewer
of the Wikipedia
Eclipse plugin:
http://phpeclipse.de/tiki-index.php?page=Wikipedia+Editor+Plugin
But the renderer is incomplete at the moment.
Does it make sense to use your C/C++ parser for preview rendering (i.e.
generate a HTML page without SQL access)?
At the moment, the parser is (slightly) incomplete as well, but I'm
working to change that. It will be most useful for many purposes to have
a single, standardized parser (which will then be the "reference
implementation", I hope). No need to write a new renderer for our quite
complicated syntax each time.
So yes, I think it would make a lot of sense.
If yes, is it possible to use templates for the
generated HTML pages?
First, the parser generates *XML*, not *HTML*. The parser knows nothing
about the database or even the language of the underlying wikipedia. The
transition from XML to HTML has to be done in a second step, which is
relatively easy, as there are lots o' tools that can generate an XML
tree, in every programming language. I have done a XML-to-(X)HTML
conversion in ParserXML.php, which is part of the mediawiki CVS HEAD.
Second, if by "templates" you mean wiki {{templates}}, this is done in
the post-parser part described above. The parser generates a XML
structure for each {{template}} or {{{variable}}}.
Are there binaries for Linux, Windows available?
On Linux, you can checkout the flexbisonparse module from the mediawiki
CVS, then just "make" it. The resulting executable is "wikiparse",
into
which you pipe the wiki text and get the XML.
Magnus