Module:Timeline of release years/sandbox: Difference between revisions

Content deleted Content added
Way too long
Cleanup, shrink up, handle TBA
Line 79:
end
 
local function row(builder, args, year, emptyyear, lastyear)
local itemNum, itemList = items(args, year)
-- If excludeempty is set and no items are returned, don't build a row.
if args.excludeempty and #itemList < 1 then
return nil
end
-- If compressempty is set, check for empty items, track empty years, and put out a compressed range when next year is found.
builder = builder:tag('tr')
if( args.compressempty) then
left(builder, args, year, itemNum)
-- If we're compressing and there's no items, return this year for tracking.
right(builder, args, year, itemNum, itemList)
if #itemList < 1 then
end
return year
 
end
local function rowCompress(builder, args, year, emptyyear)
local itemNum, itemList = items(args, year)
-- If we're nothave compressingitems andbut there'sare notracking items,an return thisempty year, foroutput trackingcompressed range row.
if #itemListemptyyear <~= 1nil then
builder = builder:tag('tr')
return year
if year == 'TBA' then
end
left(builder, args, emptyyear .. ' ~ ' .. (year-1)lastyear, 0)
right(builder, args, (year-1)emptyyear .. ' ~ ' .. lastyear, 0, {})
-- If we have an empty year, output empty row.
if(emptyyear elseif year ~= nil)emptyyear then
left(builder, args, emptyyear .. ' ~ ' .. (year-1), 0)
builder = builder:tag('tr')
if right(yearbuilder, ~=args, emptyyear .. ' ~ ' .. (year-1), then0, {})
else
left(builder, args, emptyyear .. ' ~ ' .. (year-1), 0)
right left(builder, args, emptyyear .. ' ~ ' .. (year-1), 0, {})
left right(builder, args, (year-1), 0, itemNum{})
else
end
left(builder, args, (year-1), 0)
right(builder, args, (year-1), 0, {})
end
end
Line 169 ⟶ 167:
local emptyyear = nil
for year = firstyear, lastyear do
local functionyearcheck rowCompress= row(builderret, args, year, emptyyear, lastyear)
if(args.compressempty) then
if (emptyyear == nil and yearcheck ~= nil) or (emptyyear ~= nil and yearcheck == nil) then
local yearcheck = rowCompress(ret, args, year, emptyyear)
if (emptyyear == nil and yearcheck ~= nil) or (emptyyear ~= nil and yearcheck == nil) then
emptyyear = yearcheck
end
else
row(ret, args, year)
end
end