I guess I don't have such a clear understanding of what "parser" stands for and what it doesn't, so I might have misnamed my script as it better fits the definition of a converter since it's wiki to HTML only. Sorry about the confusion.
Anyway, the aim of this script is not to add flexibility to wiki code as Timwi's project (which looks very promissing, BTW), but to allow editors to generate instantaneous page previews in their browsers, thus enhancing their experience editing the wiki while reducing the load on the servers.
I haven't tried this yet, but I think a live-preview feature could be attached to the edit page by adding the script to the footer of the page (which is a simple MediaWiki message). I have done this before with the insertable special characters box in the Spanish wiki and worked just fine (seems like the English wiki is using now too, I haven't checked if it's the same method though). I will try it later on my own MediaWiki installation.
Once again, sorry about the confusion. I will rename the project to avoid further misunderstandings.
-Pedro
On Sun, 23 Jan 2005 23:51:01 +0100, Magnus Manske magnus.manske@web.de wrote:
Pedro Fayolle schrieb:
Hi,
I've been coding a wiki parser in JavaScript with the hope it could be of some use for the project (especially in giving some relief to the servers).
You can view a demo here: http://gusanos.sourceforge.net/wp/wikitest.htm
This works very well, but is it really a *parser* or "just" a *converter*? Don't get me wrong, I fell for the same thing at least twice :-)
Timwi and I (well, mostly Timwi) have been working on a *parser* wiki-to-XML, written in Bison, a parser-generator language that outputs C code. It is already pretty advanced (HTML parsing is currently kinda broken, though), and having an XML file as output beats wiki-to-HTML, as it can be converted into (X)HTML just as easily (relatively speaking;-) as into PDF, OpenOffice XML, RDF, or something else entirely (even back into wiki text, as a markup beautifier!).
So, if you've written a converter, well, great, but I wrote at least three of them in C++, and abandoned them all in different stages of development (at least one should do most of yours, including TOCs). Language flamewars aside, I think exchanging the current PHP converter for another is such a complex task (talking integration in the existing framework) that "merly" improving conversion speed might not be worth the effort.
If, however, you've written a "real" parser, it would be most interesting to know if it could produce XML instead.
Anyway, you might like to look at the Bison code of Timwis parser, in the CVS, module "flexbisonparse". You can try it with the CVS HEAD wikipedia, if you follow the instructions in "ParserXML.php", in case you're interested.
Magnus _______________________________________________ Wikitech-l mailing list Wikitech-l@wikimedia.org http://mail.wikipedia.org/mailman/listinfo/wikitech-l