Module:Infobox road/route/sandbox explained

local p =

local format = mw.ustring.formatrequire('strict')local getArgs = require('Module:Arguments').getArgs local parserModule = require 'Module:Road data/parser'local parser = parserModule.parserlocal displayModule = require("Module:Sandbox/BrandonXLF/4")

local function shield(args, style) if args.marker_image then return args.marker_image end return displayModule.shield(args, 'main', style, true)end

-- 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 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

nil or args.marker_image

'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

or args.name

nil and not args.type and not args.route then container:tag('p'):cssText('margin:0.1em;'):wikitext(shield) elseif args.country

'AUS' then container:tag('p'):cssText('margin:0.1em;'):wikitext(name) container:tag('p'):cssText('margin:0.1em 0 0 0;'):wikitext(shield) else -- container:tag('p'):cssText('margin:0.1em 0 0 0;'):wikitext(banner) container:tag('p'):cssText('margin:0 0 0.1em;'):wikitext(shield) container:tag('p'):cssText('margin:0.1em;'):wikitext(name) end return tostring(container) endend

function p.routeInfo(frame) local args = getArgs(frame) return p._routeInfo(args);end

function p._shields(args) local style = 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