User:Sumit.iitp/draft pagebanner

This is an initial draft for discussing the strategy for converting the functionality of pagebanner template at wikivoyage to an extension. The discussion is being tracked at phabricator report [here]

Workflow
Step 1: Create a basic skeleton along the lines of the template. This involves:
 * 1) Creating a parser function as '#pagebanner' which when supplied no argument, adds a banner image from wikitext item P:948(default)
 * 2) The wikidata image will be fetched using lua scripting supported by mediawiki
 * 3) The parser function will support additional parameters to mimic the current pagebanner template in terms of its use, so that end-users perceive minimum change:
 * 4) *caption text: Recommended. Enter caption=description to display a description of the picture when a mouse pointer is placed over the banner image.
 * 5) *page name: Optional. Enter pgname=name to display in the banner. Only enter a name if you want it to be different than the formal name of the page.
 * 6) *disambiguation: Optional. Displays a disambiguation icon in the banner (a question mark) and the disambiguation hatnote after the banner. Enter disambig=yes if the name of the disambiguation page is page name (disambiguation). Enter disambig=disambiguation page name if the disambiguation page name is different from the current page name.
 * 7) *star: Optional. Enter star=yes if the guide is a Star article. This displays the Star article symbol in the top right corner.
 * 8) *DotM: Optional. Enter dotm=yes if the guide is a previous Destination of the month. This displays the DotM symbol in the top right corner.
 * 9) *OtBP: Optional. Enter otbp=yes if the guide has been featured on [Off the beaten path]. This displays the OtBP symbol in the top right corner.
 * 10) *Ftt: Optional. Enter ftt=yes if the guide has been a Featured travel topic. This displays the Ftt symbol in the top right corner.
 * 11) *unesco: Optional. Enter unesco=yes if the guide is or describes a site on the Unesco World Heritage list. Only the lowest level guides in the hierarchy should be tagged (ie, Sydney/City Centre for the Opera House, not Sydney). This displays the World Heritage symbol in the top right corner and adds a category.
 * 12) *TOC box: Optional. Enter box=black for the TOC to appear in a translucent black box with white type. Enter box=white for the TOC to appear in a translucent white box with black type. Enter nothing for the default solid grey box with black type.
 * 13) *notoc: Optional. Enter notoc=true to stop the TOC being included in the banner and for the entire TOC to be shown within the article instead. Mainly to be used on articles with lots of sections.
 * 14) *index: Optional. Enter index=yes for banners on title/index pages or pages in other main namespace article categories which do not always get banners.
 * 15) *fop: Optional. Enter fop=yes for freedom-of-panorama banners which are not allowed on Commons, to remove them from applicable maintenance categories
 * 16) After the code for the banner generated, its important to detect the screen size of the user and resize the banner appropriately. This step is essential for mobile users, who are one of the important targets of this extension