local p =
local format = mw.ustring.formatrequire('strict')local getArgs = require('Module:Arguments').getArgs local parserModule = require 'Module:Road data/parser'local parser = parserModule.parser
local function banner(args, style) if args.marker_image then return nil end local bannerSize if style
if not shield or shield
local function shield(args, style)
if args.marker_image then return args.marker_image end local horizontalSize local verticalSize if style
local shield = parser(args, 'shieldmain') or parser(args, 'shield') or local label = parser(args, 'name') or parser(args, 'abbr') or local alt = label .. ' marker' local orientation = parser(args, 'orientation') local function simpleSize(args) if orientation and orientation
local width = title.file.width local height = title.file.height if (orientation and orientation
then return nil elseif type(shield)
-- Links/abbreviationslocal function name(args) local name = args.name or parser(args, 'name') or parser(args, 'abbr') return nameend
function p._routeInfo(args) local style = args.style local banner = banner(args, style) local shield = shield(args, style) local name = name(args)
if not args.type and not args.route and not args.name and not args.marker_image then local container = nil else local container = mw.html.create('div'):cssText('text-align:center;') if shield
'none' or args.name and not args.marker_image and not args.type and not args.route then container:tag('p'):cssText('margin:0.1em;'):wikitext(name) elseif args.marker_image ~= and args.name
nil and not args.type and not args.route then container:tag('p'):cssText('margin:0.1em;'):wikitext(shield) elseif args.country
function p.routeInfo(frame) local args = getArgs(frame) return p._routeInfo(args);end
function p._shields(args) local style = args.style local banner = banner(args, style) local shield = shield(args, style)
if not args.type and not args.route and not args.name and not args.marker_image then local container = nil else local container = mw.html.create('div'):cssText('text-align:center; display: inline-block; vertical-align: baseline; line-height: 0;') container:tag('p'):cssText('margin:0.1em 0 0 0;'):wikitext(banner) container:tag('p'):cssText('margin:0 0 0.1em;'):wikitext(shield) return tostring(container) endend
function p.shields(frame) local args = getArgs(frame) return p._shields(args);end
function p._names(args) local name = name(args) return nameend
function p.names(frame) local args = getArgs(frame) return p._names(args);end
return p