Module:Flag/sandbox explained

local margs = require('Module:Arguments')

local function _main(frame, name, mode) local categories =

local yesno = require('Module:Yesno')

--Get input arguments local args = margs.getArgs(frame,) local preftext = "" if name

'Flag+link' then args.pref = args[1] elseif name

'Flag athlete' then args.preftext = args[1] args[2] = args.code or args[2] or "" args.variant = args.variant or args[3] elseif name

'Flag medalist' then preftext = (args[1] or "") .. "
" args[2] = args.code or args[2] or "" args.variant = args.variant or args[3] elseif name

'Flag link' then args.suff = args[2] args[2] = args[1] or "" args.variant = args.variant or args[3] else sports = if sports[name] then args.avar = sports[name] if name

'fb' and yesno(args.align)

true then args.align='c' end end args.variant = args.variant or args[2] args[2] = args[1] or "" end

args[1] = mode .. (args.opts or ) args.missingcategory = categories[name] args.noredlink = args.noredlink or 'notext'

if args.placeholder and yesno(args.placeholder) ~= true then args[1] = args[1] .. 'o' end

if mw.title.getCurrentTitle.namespace

0 then local unknown = '' else local unknown = end check = if name

'Flag icon' then local opts = check = require('Module:Check for unknown parameters')._check(opts,args) end

return preftext .. require('Module:Flagg').luaMain(frame,args) .. checkend

local p =

p['deco'] = p.decorationp['IOC 2'] = p.IOC2p['IOC athlete'] = p.IOCathlete

return p