Module:Year in sports explained

local getArgs = require('Module:Arguments').getArgslocal sidebar = require('Module:Sidebar')local list = require('Module:List')local parser = mw.ext.ParserFunctions

local sports =

local p =

local function link(a, b) if (not b) then return "" .. a .. "" end return "" .. b .. ""end

function p.main(frame) local args = getArgs(frame) return p._main(frame, args)end

function p._main(frame, args) local year = args[1] or args['year'] or os.date("%Y") local what = args[2] or args['sport'] or "sports" local inwhat = " in " .. what local pages = for i, sport in ipairs(sports) do local s = year .. " in " .. sport local page = mw.title.new(s, 0) if (page.exists) then table.insert(pages, link(s, sport:gsub("^%l", string.upper))) end end local l = list.horizontal(pages) local years = year local y = year - 1 if (mw.title.new(y .. inwhat)) then years = link(y .. inwhat, y) .. " " .. years end y = y - 1 if (mw.title.new(y .. inwhat)) then years = link(y .. inwhat, y) .. " " .. years end y = y - 1 if (mw.title.new(y .. inwhat)) then years = link(y .. inwhat, y) .. " " .. years end y = y - 1 if (mw.title.new(y .. inwhat)) then years = link(y .. inwhat, "←") .. " " .. years end y = year + 1 if (mw.title.new(y .. inwhat)) then years = years .. " " .. link(y .. inwhat, y) end y = y + 1 if (mw.title.new(y .. inwhat)) then years = years .. " " .. link(y .. inwhat, y) end y = y + 1 if (mw.title.new(y .. inwhat)) then years = years .. " " .. link(y .. inwhat, y) end y = y + 1 if (mw.title.new(y .. inwhat)) then years = years .. link(y .. inwhat, "→") end local v = "Years" if mw.title.new("List of years in " .. what) then v = link("List of years in " .. what, "Years") end local passing = return sidebar.sidebar(frame, passing)end

return p