We would like to build a smarter wikitext editor with (for example) smart template/infobox collapsing.
But parsing wikitext on the client is a losing proposition.
Let's extend the [`sections` API](http://restbase.wikimedia.org/en.wikipedia.org/v1/?doc#resource_Mobile) used by mobile to be a full JSON description of the structure of a given wikitext revision. It should include wikitext offsets for:
* The start/end of sections
* The start/end of templates
* what else?
The wikitext editor can use these source offsets to collapse regions of wikitext by default to allow a cleaner editing experience.
To go further, perhaps we should export source offsets for things like bold face, italics, and links to allow the wikitext editor to do syntax highlighting? (Or not -- perhaps syntax highlighting is best done with imperfect-but-okay regexps on the client side.)