Module:StepHarvest
Appearance
Documentation for this module may be created at Module:StepHarvest/doc
-- Shared helpers for StepHarvest templates.
-- Keeps palette logic in one place so templates stay thin.
local p = {}
-- Renders a comma separated season list ("spring, fall") as Season tags.
function p.seasons( frame )
local arg = frame.args[1] or ''
local out = {}
for season in mw.text.gsplit( arg, ',' ) do
season = mw.text.trim( season )
if season ~= '' then
table.insert( out, frame:expandTemplate{ title = 'Season', args = { season } } )
end
end
if #out == 0 then
return ''
end
return table.concat( out, ' ' )
end
return p