Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Module:Sandbox/BrandonXLF/4

From Wikipedia, the free encyclopedia

-- Sandbox, do not delete
local p = {}

local roadDataModule = require('Module:Road data/sandbox') -- REMOVE SANDBOX

function p._shieldmain(args)
	local shields = {}
	local routeCount = 1
	
	while args[routeCount * 2 - 1] do
		local route = {
			country = args['country' .. routeCount] or args.country,
			state = args['state' .. routeCount] or args['province' .. routeCount] or args.state or args.province,
			type = args[routeCount * 2 - 1],
			route = args[routeCount * 2]
		}
		
		if not route.country then
			local countryModule = mw.loadData('Module:Road data/countrymask')
			route.country = countryModule[route.state] or 'UNK'
		end

		local shield = roadDataModule.shield(route, 'main', 'infobox', true)
		table.insert(shields, shield)

		routeCount = routeCount + 1
	end

	return table.concat(shields, ' ')
end

function p.shieldmain(frame)
	local args = require('Module:Arguments').getArgs(frame)
	return p._shieldmain(args)
end

return p