User:Phuedx (WMF)/Extension:Cards

Cards is a small library that allows the developer to retrieve a rendered summary of one or more wiki pages from a MediaWiki wiki. Eventually, the library will be used to replace similar behaviour in RelatedArticles, Gather, and MobileFrontend. As the library deals with presentation in the UA and is intended to be used only by MediaWiki extensions it is also packaged as a MediaWiki extension.

Operation
Using the injected instance of,   makes an API request to the target wiki for the first sentence of the page in plain text, returned by TextExtracts, and a thumbnail, returned by PageImages. The API result is processed so that it can be passed as data to a compiled Hogan.js template.