Per T113094: [EPIC] The Page Summary API needs to provide useful content for the majority of articles, you'll find the spec for the Page Summary API here: https://www.mediawiki.org/wiki/User:Phuedx_(WMF)/Reading/Web/Page_Preview_API
Plan (YMMV)
- Add a route to the MobileApps service (MCS) that accepts a title and returns some JSON response.
- Get the lead section of the page.
- Get the intro from the lead section of the page (see https://www.mediawiki.org/wiki/User:Phuedx_(WMF)/Reading/Web/Page_Preview_API#Intros)
- Strip all HTML elements from the intro.
- Add the HTML elements back in case by case, e.g.
- span
- a
- b
- i
- em
- sup
- sub
- Flatten a tags (see https://www.mediawiki.org/wiki/User:Phuedx_(WMF)/Reading/Web/Page_Preview_API#Flattening_inline_elements)
- Strip balanced parentheticals.
AC
- A service exists that responds as specified in https://www.mediawiki.org/wiki/User:Phuedx_(WMF)/Reading/Web/Page_Preview_API#Responses apart from the following cases:
- Service is deployed to the Beta Cluster ASAP
Notes
- The Page Content API is a superset of the Page Summary API. If the Page Content Service repository has been created prior to working on this, then add this endpoint there.