Follow up from the offsite:
Both the new and old page content APIs output JSON directly. While this is the end goal it has a few downsides:
1. It does not separate the concerns of finding content within the HTML and formatting it into JSON
2. Because changes are not output as HTML any cleanup performed by the API is not easily upstreamed to Parsoid if it is found to be general purpose.
In order to address this, a new API will be written that only extracts the content of the new HTML API using known selectors and then outputs the content as JSON. This API will be the basis for all other platform specific JSON APIs that are written so that none of them need to perform any extraction from HTML.
NOTE: If any more content needs to be extracted for new APIs, the extraction should be done here so that we do not have HTML extraction code in different APIs.
In particular this API should extract and return all content identified by the Reading platform teams here (from: https://etherpad.wikimedia.org/p/web-code):
- page id https://www.mediawiki.org/wiki/Manual:Page_table#page_id
- revision id https://www.mediawiki.org/wiki/Manual:Revision_table#rev_id
- Wikibase item (Wikidata Q number)
- Display Title
- Wikidata description
- Section List (with mapping to section ids)
- Lead image
- Lat/Long (geolocation)
- Gallery / Image List (licences, owners, image info)
- References List
- Whether the page response was from a redirect
- Language Variants List
- Last Modified Date / User / logged in / anonymous
- Name Space
- Name Space Name
- Page Protection
- ContentModel - https://www.mediawiki.org/wiki/Manual:ContentHandler
- Whether the page is "Main Page" or not, a disambiguation page,
- Is editable
- page issues
- Info box (the html)
- Link to the spoken version
- Hatnotes (disambig links etc)
## Open questions
### Do we include the following? How?
- Lead section?
- Pronunciation url?
- Pronunciation links?
- Whether the page was featured?
- Whether the page is watched by the logged in user?
- All links? Or only interlanguage links? Redlinks (please!!!!)?
### Do we include the HTML blobs for the following in this response or separate HTML APIs?
- Article Content