It's now possible to request a parsed wiki page via the MediaWiki API. You have to have node (and all the dependencies) installed. See the README file in the modules/parse directory. It simply shells out to node.js. A more clever version might make use of a node.js daemon, but it was just easier to reuse the STDIN/STDERR/STDOUT model this way.
It's implemented as a 'property' of a title, i.e.:
http://wiki.ivy.local/w/api.php?action=query&prop=parsetree&titles=M...
If I've read the docs right, this should work well with caching.
It doesn't work with format=xml, for some reason.
https://bugzilla.wikimedia.org/show_bug.cgi?id=34058
On 01/31/2012 02:31 AM, Neil Kandalgaonkar wrote:
It's now possible to request a parsed wiki page via the MediaWiki API.
Awesome! This will be very handy to quickly check the parser output.
In the longer run we'll need a daemon that also handles saving (serialization to WikiText and splicing with untouched source). Building the tokenizer from scratch each time is also quite slow. But for now this is great to have!
Gabriel
wikitext-l@lists.wikimedia.org