Hello,
sorry for the maybe naïve question. Within an extension, is there a specific method (via Parser class, for instance) or a more or less direct way that could turn a template in a wikitext string into an object or associative array. Let's say: {{Example|Name=John|Last=Smith}} into: { "Example": { "Name": "John", "Last": "Smith" } }
Thanks,
On 02/14/2014 04:00 AM, Toni Hermoso Pulido wrote:
Within an extension, is there a specific method (via Parser class, for instance) or a more or less direct way that could turn a template in a wikitext string into an object or associative array.
If you need both the parameters (including nested templates) and the rendered output, then one option is to use Parsoid for this by calling the web service: http://parsoid-lb.eqiad.wikimedia.org/ https://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Transclusion_conte...
Gabriel
El 14/02/14 23:59, Gabriel Wicke ha escrit:
On 02/14/2014 04:00 AM, Toni Hermoso Pulido wrote:
Within an extension, is there a specific method (via Parser class, for instance) or a more or less direct way that could turn a template in a wikitext string into an object or associative array.
If you need both the parameters (including nested templates) and the rendered output, then one option is to use Parsoid for this by calling the web service: http://parsoid-lb.eqiad.wikimedia.org/ https://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Transclusion_conte...
Thanks Gabriel! I'll take a look!
wikitech-l@lists.wikimedia.org