Module:Service history generator
From CHIPPS
More actions
Documentation for this module may be created at Module:Service history generator/doc
function servicehist_gen(str)
local out = ""
for line in str:gmatch("[^\n]+")
do
local from, to, rr = line:match("([%d-]+) to ([%d-]+): ([^\n|]+)")
out = out .. "{{Service history entry|"..rr.."|"..from.."|"..to.."}} "
end
return out
end
return
{
servicehist_gen = servicehist_gen,
gen = function(frame)
local pargs = frame:getParent().args
if pargs.servicehist or pargs.servicehist_f
then
return frame:preprocess("{{infobox service history|"..
(pargs.servicehist or servicehist_gen(pargs.servicehist_f)).."}}")
end
end
}