Jump to content

Module:Road data/size

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Fredddie (talk | contribs) at 09:36, 14 February 2021 (add here). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local getArgs = require('Module:Arguments').getArgs
local p = {}

local format = mw.ustring.format
local parserModule = require("Module:Road data/parser")
local parser = parserModule.parser

function p._main(args)
	local style = args.style
	if style == 'infobox' then
		return tostring('70px')
	elseif style == 'small' then
		return tostring('40px')
	elseif style == 'list' then
		return tostring('25px')
	else return tostring('20px')
	end
end

function p.size(frame)
	local args = getArgs(frame)
	if parser(args, 'shieldsize') == "upright" then
		return p._main(args)
	else return "x" .. p._main(args)
	end
end

function p.banner(frame)
	local args = getArgs(frame)
	return p._main(args)
end

return p