Last modified: 2009-12-30 05:22:39 UTC
(Per IRC convo with yurik) There is a native feature called LivePreview in the mediawiki core code (since 1.5), which allows an ajax POST request to fetch a preview (similar to action=render), but this feature request is not quite the same. The easiest description would be by pseudoexample: /w/api.php?action=livepreview&wiki=%5B%5BFoo%5D%5D On enwp it would return: <a href="/wiki/Foo" title="Foo">Foo</a> On a wiki without such a page: <a href="/w/index.php?title=Foo&action=edit" class="new" title="Foo">Foo</a> Future uses include ability to link to a preview, rather than require POST data, as well as possibly speeding up popups, and giving bots the ability to check wikicode structure easier. Could also improve wikiwyg feasability. Negative aspects do include possible performance vulnerabilities (associated with extensions) such as rapid generation of <timeline> and <math> tags (which already exist with LivePreview), but the restricted length of GET requests should limit this somewhat. Additionally, some new format= parameters may be required for optimal usage, such as format=raw (content-type: text/plain) format=render (content-type: text/html, with wrapping xml), etc.
Okay, the same feature will be nice for expanding templates
(In reply to comment #1) > Okay, the same feature will be nice for expanding templates > Can't you just do this? /w/api.php?action=livepreview&wiki={{template|param1|param2}}
Created attachment 4222 [details] Proposed patch Ok, here's a proposed implementation. Usage: api.php?action=render&title=Test&text=dd[[ff]]{{ee}}
Will also verify and test this one tomorrow.
Added in r26501. Thanks to VasilievVV for the patch.