Module:StationInfobox: Difference between revisions
Appearance
Content deleted Content added
Created page with "local Infobox = {} local HF = require('Module:HF') local stations = mw.loadData( 'Module:FooBar/stations' ) function Infobox.Quantify( field, vars ) local unit = field.U..." |
mNo edit summary |
||
| Line 1: | Line 1: | ||
local Infobox = {} |
local Infobox = {} |
||
local HF = require('Module:HF') |
local HF = require('Module:HF') |
||
local lang = mw.language.new('en') |
|||
local stations = mw.loadData( 'Module:FooBar/stations' ) |
local stations = mw.loadData( 'Module:FooBar/stations' ) |
||
Revision as of 12:39, 26 May 2015
Documentation for this module may be created at Module:StationInfobox/doc
local Infobox = {}
local HF = require('Module:HF')
local lang = mw.language.new('en')
local stations = mw.loadData( 'Module:FooBar/stations' )
function Infobox.Quantify( field, vars )
local unit = field.Unit or ''
local value = field.Value or field.Default or '?'
if HF.isempty(value) then
return '---'
else
return value .. ' ' .. unit
end
end
function Infobox.MainImage( field, vars )
local output = ''
local station = field.Station
if HF.isempty(field.Value) and stations[station] ~= nil then
output = stations[station]
return output
end
output = "[[File:" .. field.Value .. "|285px]]"
return output
end
return Infobox