Sorry - Insufficient reading on my part. This only seems to be able to go down one level of depth (i.e one can't get subsections) - but this is probably good enough for most purposes - particularly the one I had in mind.
Is there a way getting a list of the section names directly? I can't seem to find a command in index.php, api.php or query.php.
Thanks very much, Tom Wright.
On Jan 28, 2008 6:18 PM, Roan Kattouw roan.kattouw@home.nl wrote:
Tom Wright schreef:
Would anyone be opposed to a "partial-content" call in the api that would return a particular section of a media-wiki page. This could be provided by adding a "rvpath=" option to the "prop=revisions" call, that adds a path to a particular session.
So for example api.php?action=query&prop=revisions&titles=Telephone&rvprop=timestamp|user|comment|content&rvpath=History.Early%20Development would return the early development subsection of the history section of the telephone article.
One would the need an additional call to return the section tree of a document, perhaps: api.php?action=query&prop=revisions&rvprop=sections.
The motivation behind this would be (a) To reduce bandwidth use for certain types of queries. (b) To prevent client programs from having to parse so much html by hand.
In this could be implemented on the server without too much overhead, since the section tree could be cached, and needs to be calculated when rendering a document to create tables of content.
Is this a terribly bad idea? Is this syntax okay?
We kinda already have this. index.php?action=raw&title=Example§ion=2 will return the 2nd section only. Using section=0 will get the top of the article, i.e. the part before the first section header.
Roan Kattouw (Catrope)
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-api