Usage
{{#invoke:Item timeline by year|list}}
produces:
{{#invoke:Item timeline by year|list|12}}
produces:
{{#invoke:Item timeline by year|list|1}}
produces:
{{#invoke:Item timeline by year|list|9999}}
produces:
local p = {}
function p.generate(f)
local output = {}
local startYear = 2007
local currentYear = tonumber(os.date("%Y"))
local split = f.args[1] or 6
local if_lang = f:expandTemplate{title='If lang'}
for year = startYear, currentYear, split do
table.insert(output, '<div style="display:inline-table">')
for y = year, math.min(year + split - 1, currentYear) do
table.insert(output, string.format(':* [[Item timeline in %d%s|%d]]', y, if_lang, y))
end
table.insert(output, '</div>')
end
return table.concat(output, "\n")
end
return p