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 10:43, 16 February 2021. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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

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

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

function p.size(args)
	local args = getArgs(frame)
	return p._size(args)
end

function p._size(frame)
	if parser(args, 'orientation') == "upright" then
		return main(args)
	else return "x" .. main(args)
	end
end

function p.banner(args)
	return main(args)
end

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

return p