localp={}p.main=function(frame)localNNN=2-- provide counts only over this thresholdlocalargs=require("Module:Arguments").getArgs(frame)-- expect args.shortcut e.g. GA/H, args.type e.g. History, args.text a long listlocalsubpage=frame:preprocess("{{SUBPAGENAME}}")-- I never did look up if there's a better way to do this...localheader=""localshortcuts=""localtype=args.typeor"error: specify type = Good Articles type"localimage=''ifargs.imagethenimage='[['..args.image..'|22px|left]]'endlocalsectioncount=0if(subpage==typeorargs.override)then-- I haven't figured out how to deal with missing shortcut so why pretendshortcuts=frame:expandTemplate{title='shortcut',args={args.shortcut}}header=frame:expandTemplate{title='Wikipedia:Good articles/header',args={shortcuts=shortcuts}}endlocalintrotext=args.textor''replace=function(t)localxxxx,links=mw.ustring.gsub(t,"(%[%[[^%[%]]-%]%])","%1",nil)-- count how many linksiflinks>=NNNthent=t.."<small> ("..tostring(links).." articles)</small>"endreturnt.."\n"endlocalsectionfooter=[===[</div></div><!-- end of list -->]===]-- comments in the text below are historical from the page's own markuplocaloutput=header..[===[<!-- only include header on this page -->__NOTOC__<div style="clear:both;"><!-- DO NOT REMOVE THIS DIV, USED TO FORCE IE TO DISPLAY BACKGROUND FOR ARTS DIV --></div><div style="clear:both;"><span id="]===]..type..[===[" /><div style="padding:5px 5px 8px 5px; background-color:#66CC66; text-align:left; font-size:larger;">]===]..image..[===[''']===]..type..[===['''</div><div style="text-align:left;"></div></div>]===]..introtextlocalsection=0localfinaltext=''repeatlocalwrap=truesection=section+1localtext=(args['section'..tostring(section)]orargs[section]or'')localtitle=args['title'..tostring(section)]if(nottitle)thenif(text=='')thenbreakelselocalwrap=falseoutput=output..text-- sections without headers go in unwrappedendelselocalimage=args['image'..tostring(section)]text=mw.ustring.gsub(text.."\n=","(==.-)\n%s*%f[=]",replace)text=mw.ustring.sub(text,1,-2)-- ditching "=" mark from line aboveif(image)thenimage='[['..image..'|22px|left]]'elseimage=''-- make section without an imageendoutput=output..[===[<div style="clear:both;" class="NavFrame"><span id="World history"/><div class="NavHead" style="padding:2px 2px 2px 30px; background-color:#FFFAF0; text-align:left; font-size:larger;">]===]..image..title..[===[</div><div class="NavContent" style="text-align:left;">==­ ==]===]..text..sectionfooterenduntilfalsereturnoutputendreturnp