Module:Roadtable/manualprops
Jump to navigation
Jump to search
Documentation for this module may be created at Module:Roadtable/manualprops/doc
Code
local p = {}
local concat = table.concat
local insert = table.insert
local properties = {road = 'P31', shield = 'P14', map = 'P15', kml = 'P3096', admin = 'P131', country = 'P17', maint = 'P126',
own = 'P127', sys = 'P16', ends = 'P559', endsloc = 'P609', date = 'P580', length = 'P2043',
osmrel = 'P402', osmtag = 'P1282', numformat = 'P8498', nameformat = 'P8898', shieldtemplate = 'P8505'}
function p._props(args)
local propTable = {}
for code,pid in pairs(properties) do
local prop = args[code] or ''
if prop ~= '' then
insert(propTable, pid .. '-' .. prop)
end
end
return concat(propTable, ':')
end
function p.props(frame)
local pframe = frame:getParent()
local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself
local args = pframe.args -- the arguments passed TO the template, in the wikitext that transcludes the template
return p._props(args)
end
return p