Hi there,
I'm using the API to extract the raw wiki text from my pages, using the "?action=query&titles=Main_Page&export&exportnowrap" syntax. That works perfectly.
Now I would like to get the templates expanded out in the result, so I use: "?action=query&titles=Main_Page&prop=revisions&rvlimit=1&rvprop=content&rvexpandtemplates", which does the job, as expected, but it also strips out the comments.
My problem is that the comments are meaningful to me (I use them to help process the wiki text in subsequent steps).
Is there a way to expand templates with the API, but leave the comments intact?
Thanks, Kevin
2009/11/15 Kevin Dunn kgdunn@gmail.com:
Is there a way to expand templates with the API, but leave the comments intact?
No. There is no facility for that in the software, so the API can't expose it.
Roan Kattouw (Catrope)
On Sun, Nov 15, 2009 at 8:01 PM, Roan Kattouw roan.kattouw@gmail.com wrote:
2009/11/15 Kevin Dunn kgdunn@gmail.com:
Is there a way to expand templates with the API, but leave the comments intact?
No. There is no facility for that in the software, so the API can't expose it.
Roan Kattouw (Catrope)
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Wouldn't
$options->setRemoveComments( false );
work? Could be nice to have a parameter "&keepcomments" for action=expandtemplates..
P.Copp
2009/11/15 Paul Copperman paul.copperman@googlemail.com:
Wouldn't
$options->setRemoveComments( false );
work? Could be nice to have a parameter "&keepcomments" for action=expandtemplates..
Hm, I didn't know about that one. I'll look into it.
Roan Kattouw (Catrope)
mediawiki-api@lists.wikimedia.org