local p = function p.Shield(frame) local pframe = frame:getParent local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself local args = pframe.args -- the arguments passed TO the template, in the wikitext that transcludes the template --store special inputs local customsize = args["size"] -- store custom size if specified local alt = args["alt"] or "" -- store value of alt args["alt"], args["size"] = nil, nil -- destroy before populating tables -- populate table of highway types local htype = local indexcount = 1 for i = 1,7,2 do -- set to grab 4 if args[i] then htype[indexcount] = args[i] -- Get types of highway indexcount = indexcount + 1 end end
-- populate table of allocations (route numbers) local alloc = indexcount = 1 for i = 2,8,2 do -- set to grab 4 if args[i] then alloc[indexcount] = args[i] -- Get allocations (route numbers) indexcount = indexcount + 1 end end -- set up extension (currently not required) local ext = ".svg" -- this shouldnt need to ever change, but its here if needed. (it could also be moved into the table below) -- set up base types of highways with properties local entries = ; -- set up base type aliases (used if highway types share all properites) local aliases = ; --ACT also uses NSW style alphanumeric setmetatable(entries,); --produce shields local count = 1 local shield = repeat if alt
indexcount -- compare count to number of shields grabbed earlier return (shield[1] or "") .. (shield[2] or "") .. (shield[3] or "") .. (shield[4] or "")endreturn p