Does anybody know how to get access to the template's body inside the page?
I'm familiar with the API that returns the list of ALL templates that exist on the page, but how I can get access to the template's body? Is there any API for this? For now I see only one possible way... parse it manually. Am I wrong?
This is an old question, but it helped me figure out how to fetch a mediawiki page with template macros expanded. Very useful if you are doing a conversion.
发布评论
评论(2)
您可以使用 expandtemplates API 调用,或
rvexpandtemplates
参数修订 API 调用。You can use the expandtemplates API call, or the
rvexpandtemplates
parameter for the revisions API call.这是一个老问题,但它帮助我弄清楚如何获取扩展了模板宏的 mediawiki 页面。如果您正在进行转换,则非常有用。
我正在解析从此查询返回的 xml 以获取扩展页面。
This is an old question, but it helped me figure out how to fetch a mediawiki page with template macros expanded. Very useful if you are doing a conversion.
I am parsing the xml returned from this query to get the expanded page.