This module is rated as beta, and is ready for widespread use. It is still new and should be used with some caution to ensure the results are as expected.
This module depends on the following other modules:
Lua-native alternative to popular flag templates. Can be used to reduce post-expand include size of pages with lots of templates, since it avoids calling multilevel templates.
localp={}functionp._main(frame,name,mode,check)localcategories={Flagicon='[[Category:Flagicons with missing country data templates]]',Flagdeco='[[Category:Flagdeco with missing country data templates]]',}localargs={}localyesno=require('Module:Yesno')ifyesno(frame.args.getParent)thenfork,vinpairs(frame:getParent().args)doif(vor'')~=''thenargs[k]=vendendendfork,vinpairs(frame.args)doif(vor'')~=''thenargs[k]=vendendifname=='Flag+link'thenargs.pref=args[1]elseifname=='Flagathlete'thenlocalathlete=args[1]localcode=args.codeorargs[2]or''args.text=function(data)localtooltip=((data['shortname alias']or'')=='')and(data.aliasor'')ordata['shortname alias']returnathlete..' <span style="font-size:90%">(<abbr title="'..tooltip..'">'..code..'</abbr>)</span>';endargs.variant=args.variantorargs[3]args.placeholder=trueelseargs.variant=args[2]orargs.variantargs[2]=args[1]endargs[1]=mode..(args.optsor'')args.missingcategory=categories[name]args.noredlink=args.noredlinkor'no'ifyesno(args.placeholder)~=truethenargs[1]=args[1]..'o'endifmw.title.getCurrentTitle().namespace==0thenlocalunknown='[[Category:Pages using '..mw.ustring.lower(name)..' template with unknown parameters|_VALUE_'..frame:getParent():getTitle()..']]'elselocalunknown=''endifcheckthenlocalopts={unknown=unknown,preview='Page using [[Template:'..name..']] with unknown parameter "_VALUE_"',ignoreblank='y','1','2','variant','image','size','sz','border','align','al','width','w','alt','ilink','noredlink','missingcategory','name','clink','link','pref','suff','plink','the','section','altvar','avar','age','nalign','nal','text','nodata','opts','placeholder','getParent'}check=require('Module:Check for unknown parameters')._check(opts,args)elsecheck=''endreturnrequire('Module:Flagg').luaMain(frame,args)..checkendfunctionp.main(frame)returnp._main(frame,'Flag','uncb',false)endp.flag=p.mainfunctionp.deco(frame)returnp._main(frame,'Flagdeco','uxx',false)endp.flagdeco=p.decofunctionp.icon(frame)returnp._main(frame,'Flagicon','cxxl',true)endp.flagicon=p.iconfunctionp.pluslink(frame)returnp._main(frame,'Flag+link','unpof',false)endp['+link']=p.pluslinkp['flag+link']=p.pluslinkfunctionp.country(frame)returnp._main(frame,'Flagcountry','unce',false)endp.flagcountry=p.countryfunctionp.athlete(frame)returnp._main(frame,'Flagathlete','unx',false)endp.flagathlete=p.athletereturnp