Migration to the new preprocessor/how to test
From Meta, a Wikimedia project coordination wiki
Contents |
There are various methods of testing a page's rendering in the new preprocessor on Wikimedia during this testing phase.
[edit] Checking which preprocessor is active
To check which preprocessor is active for you, use {{#if:{{#if:x|{{{2}}}|}}|new pp|old pp}}, here producing "new pp" (purge).
To check for a wiki which preprocessor is active by default, first apply {{fullurl:Special:Expandtemplates|timtest=removecookie}}, here [1], then apply purge to the page with the code above.
One can also view the template limit comment in the HTML source. The new one is titled "NewPP limit report". E.g.:
Old: <!-- Pre-expand include size: 11147/2048000 bytes Post-expand include size: 3704/2048000 bytes Template argument size: 365/2048000 bytes #ifexist count: 0/500 --> New: <!-- NewPP limit report Preprocessor node count: 282/1000000 Post-expand include size: 3154/2048000 bytes Template argument size: 177/2048000 bytes #ifexist count: 0/500 -->
[edit] Selecting a parser
[edit] By URL
For short URLs you can append a ?timtest=newpp or ?timtest=oldpp (default) parameter, for example:
http://meta.wikimedia.org/wiki/Main_Page [2]
becomes:
http://meta.wikimedia.org/wiki/Main_Page?timtest=newpp [3] http://meta.wikimedia.org/wiki/Main_Page?timtest=oldpp [4]
For ugly URLs, you use &timtest=newpp or &timtest=oldpp :
http://meta.wikimedia.org/w/index.php?title=Main_Page&action=edit [5]
becomes:
http://meta.wikimedia.org/w/index.php?title=Main_Page&action=edit&timtest=newpp [6] http://meta.wikimedia.org/w/index.php?title=Main_Page&action=edit&timtest=oldpp [7]
You may want to explicitly link to &timtest=oldpp in case someone is using a cookie (below).
&timtest=newpp or &timtest=oldpp can also be used for an edit link. &timtest=newpp allows a section code with a T in the URL. The first automatic preview (if applicable) uses the specified parser, but the manual previews and the automatic page view after saving use the default parser.
See also template:newpp ( talk edit history links ) and w:template:npp ( talk edit history links ).
[edit] By POST
For more esoteric uses, you can also use the POST variable method, some examples:
<input type='hidden' name='timtest' value='newpp'>
<input type='text' name='timtest' value='oldpp'>
parser: <input type="radio" name="timtest" value="oldpp" id="oldpp"><label for="oldpp">old</label> <input type="radio" name="timtest" value="newpp" id="newpp"><label for="oldpp">new</label>
[edit] By cookie
You can set a cookie in your browser session with timtest=setcookie and you can remove it with timtest=remove (or closing your browser). This is useful in conjunction with editing (you can see the new preprocessor in preview) or in Special:ExpandTemplates (you can use the new XML tag display).
http://meta.wikimedia.org/wiki/Special:Expandtemplates?timtest=setcookie http://meta.wikimedia.org/wiki/Special:Expandtemplates?timtest=removecookie
[edit] Special:ParserDiffTest
A new method is to use this new special page, which automatically renders the text/page in both processors, and does a diff on the generated HTML (minus comments).
The page name can be input manually and [Get text from page] clicked, or the page name can be passed as a parameter, eg:
http://meta.wikimedia.org/wiki/Special:ParserDiffTest/Main_Page
With this method, you can also create a wikilink to the diff page, eg:
[[Special:ParserDiffTest/Main_Page]]
You can also enter raw text, for example:
====
...should show a difference between the old and new parsers.
You can also add this to your user javascript for easy checking:
//add a toolbox link to Special:ParserDiffTest for most pages if(!wgCanonicalSpecialPageName) addOnloadHook(function() { var url = wgServer + wgArticlePath.replace(/\$1/,'Special:ParserDiffTest/') + wgPageName addPortletLink('p-tb',url,'Parser diff','ca-diffparser','Diff this page across both parsers.',''); });
[edit] FAQ
[edit] Where do I report possible errors?
Start at m:Talk:Migration_to_the_new_preprocessor#Possible_bugs. Most issues at this point are expected behavior changes that require slight wikicode fixes.