Module:Tennis events nav/sandbox

-- [SublimeLinter luacheck-globals:mw]

local p = {} local getBuffer, print = require("Module:OutputBuffer")

local STYLES = { ["singlesdoubles"] = {[=[|- ["1"] = "singlesdoubles", ["men"] = "singlesdoubles", ["mens"] = "singlesdoubles", ["women"] = "singlesdoubles", ["womens"] = "singlesdoubles", ["singles"] = {[=[|- ["doubles"] = {[=[|- ["menswomenssingles"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ["menswomensdoubles"] = {[=[|- ["menssinglesdoubles"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ["boysgirlssingles"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ["miamimasters"] = "boysgirlssingles", ["mixeddoubles"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ["mixednowomensdoubles"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ["mixed"] = "mixeddoubles", ["grandslam"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ["grandslamnomixed"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ["grandslamnojuniordoubles"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ]=]},	["grandslamwc"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ! scope="row" style="font-weight: normal; text-align: right;" | WC Singles ! scope="row" style="font-weight: normal; text-align: right;" | WC Doubles ["juniors"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ["juniorsmixed"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ["team"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ! scope="row" style="font-weight: normal; text-align: right;" | Team ["mixedandteam"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ! scope="row" style="font-weight: normal; text-align: right;" | Team ["australianopen"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ! scope="row" style="font-weight: normal; text-align: right;" | WC Singles ! scope="row" style="font-weight: normal; text-align: right;" | WC Doubles ! scope="row" style="font-weight: normal; text-align: right;" | Legends ]=]},	["frenchopen"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ! scope="row" style="font-weight: normal; text-align: right;" | WC Singles ! scope="row" style="font-weight: normal; text-align: right;" | WC Doubles ! scope="row" style="font-weight: normal; text-align: right;" | Legends ]=]},	["frenchopen2022"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ! scope="row" style="font-weight: normal; text-align: right;" | WC Singles ! scope="row" style="font-weight: normal; text-align: right;" | WC Doubles ! scope="row" style="font-weight: normal; text-align: right;" | Legends ]=]},	["frenchopen2023"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ! scope="row" style="font-weight: normal; text-align: right;" | WC Singles ! scope="row" style="font-weight: normal; text-align: right;" | WC Doubles ! scope="row" style="font-weight: normal; text-align: right;" | Legends ]=]},	["wimbledonchampionships"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ! scope="row" style="font-weight: normal; text-align: right;" | WC Singles ! scope="row" style="font-weight: normal; text-align: right;" | WC Doubles ! scope="row" style="font-weight: normal; text-align: right;" | Legends ]=]},	["wimbledon2022"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ! scope="row" style="font-weight: normal; text-align: right;" | WC Singles ! scope="row" style="font-weight: normal; text-align: right;" | WC Doubles ! scope="row" style="font-weight: normal; text-align: right;" | Legends ! scope="row" style="font-weight: normal; text-align: right; white-space:nowrap;" | 14&U Singles ]=]},	["usopen"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ! scope="row" style="font-weight: normal; text-align: right;" | WC Singles ! scope="row" style="font-weight: normal; text-align: right;" | WC Doubles ! scope="row" style="font-weight: normal; text-align: right;" | Legends ]=]},	["abnamroworldtennistournament"] = {[=[|- ["queensclubtennistournament"] = {[=[|- ["doublestwotourneys"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles [""] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ["nowomensdoubles"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ["quad"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ["singlesquad"] = {[=[|- ["doublesquad"] = {[=[|- ["qual"] = {[=[|- ["qualsingles"] = {[=[|- ["qualsinglesdoubles"] = {[=[|- ["qualmenswomenssingles"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ["qualgrandslam"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ["qualmixed"] = {[=[|- ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ["olympics1908"] = {[=[|- ! scope="row" style="font-weight: bold; text-align: center;" colspan="3"| Outdoor ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ! scope="row" style="font-weight: bold; text-align: center;" colspan="3"| Indoor ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ["olympics1912"] = {[=[|- ! scope="row" style="font-weight: bold; text-align: center;" colspan="4"| Outdoor ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ! scope="row" style="font-weight: bold; text-align: center;" colspan="4"| Indoor ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ["olympics1968"] = {[=[|- ! scope="row" style="font-weight: bold; text-align: center;" colspan="4"| Demonstration ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles ! scope="row" style="font-weight: bold; text-align: center;" colspan="4"| Exhibition ! scope="row" style="font-weight: normal; text-align: right;" | Singles ! scope="row" style="font-weight: normal; text-align: right;" | Doubles
 * Singles
 * Doubles]=]},
 * Singles]=]},
 * Doubles]=]},
 * men
 * women]=]},
 * men
 * women]=]},
 * men
 * men]=]},
 * men
 * women
 * boys
 * girls
 * men
 * women]=]},
 * men
 * women
 * men
 * women
 * mixed]=]},
 * men
 * women
 * men
 * mixed]=]},
 * mixed]=]},
 * men
 * women
 * boys
 * girls
 * girls
 * men
 * women
 * mixed
 * boys
 * girls]=]},
 * men
 * women
 * boys
 * girls
 * men
 * women
 * boys
 * girls]=]},
 * men
 * women
 * boys
 * girls
 * girls
 * men
 * women
 * mixed
 * men
 * women
 * boys
 * girls
 * girls
 * men
 * women
 * mixed
 * boys
 * girls
 * men
 * women
 * quad
 * men
 * women
 * quad]=]},
 * boys
 * girls
 * boys
 * girls]=]},
 * boys
 * girls
 * boys
 * girls
 * mixed]=]},
 * men
 * women
 * men
 * women
 * men
 * women]=]},
 * men
 * women
 * men
 * women
 * mixed
 * men
 * women]=]},
 * men
 * women
 * boys
 * girls
 * girls
 * men
 * women
 * mixed
 * boys
 * girls
 * men
 * women
 * quad
 * men
 * women
 * quad
 * men
 * women
 * mixed
 * men
 * women
 * boys
 * girls
 * girls
 * men
 * women
 * mixed
 * boys
 * girls
 * men
 * women
 * quad
 * men
 * women
 * quad
 * −45
 * 45+
 * women
 * men
 * women
 * boys
 * girls
 * girls
 * men
 * women
 * mixed
 * boys
 * girls
 * men
 * women
 * quad
 * men
 * women
 * quad
 * men
 * women
 * men
 * women
 * boys
 * girls
 * girls
 * men
 * women
 * mixed
 * boys
 * girls
 * men
 * women
 * quad
 * men
 * women
 * quad
 * men
 * women
 * mixed
 * men
 * women
 * boys
 * girls
 * girls
 * men
 * women
 * mixed
 * boys
 * girls
 * men
 * women
 * quad
 * men
 * women
 * quad
 * men
 * women
 * seniors
 * men
 * women
 * boys
 * girls
 * girls
 * men
 * women
 * mixed
 * boys
 * girls
 * men
 * women
 * quad
 * men
 * women
 * quad
 * men
 * women
 * mixed
 * boys
 * girls
 * men
 * women
 * boys
 * girls
 * girls
 * men
 * women
 * mixed
 * boys
 * girls
 * men
 * women
 * quad
 * men
 * women
 * quad
 * men
 * women
 * mixed
 * singles
 * doubles
 * wheelchair singles
 * wheelchair doubles]=]},
 * wheelchair doubles]=]},
 * Singles
 * Doubles
 * WC Singles
 * WC Doubles]=]},
 * WC Doubles]=]},
 * men
 * women
 * men
 * women]=]},
 * men
 * women
 * men
 * women]=]},
 * men
 * women
 * men]=]},
 * men
 * women
 * quad
 * men
 * women
 * quad]=]},
 * men
 * women
 * quad]=]},
 * men
 * women
 * quad]=]},
 * Qualification]=]},
 * Singles]=]},
 * Singles
 * Doubles]=]},
 * men
 * women]=]},
 * men
 * women
 * men
 * women]=]},
 * men
 * women
 * men
 * women
 * mixed]=]},
 * men
 * women
 * men
 * men
 * women
 * men]=]},
 * men
 * women
 * men
 * mixed
 * mixed
 * men
 * women
 * men
 * mixed]=]},
 * mixed]=]},
 * men
 * women
 * men
 * women
 * mixed
 * men
 * women
 * men
 * women
 * mixed]=]}}

local function pullItem(value, default) value = value and string.lower(string.gsub(value, "%W", "")) if type(STYLES[value]) == "string" then value = STYLES[value] end if STYLES[value] then return STYLES[value][1] else return STYLES[default][1] end end

function p._main(args) local default = "" if args[2] ~= args[3] then default = "doublestwotourneys" end

print('{| style="border-spacing: 0.6em 0; margin: auto; ' ..		 'text-align: center;"') local draws = (string.gsub(pullItem(args.type, default), "{(%w+)}", {prefix = args.prefix or "", year = args[1], tournament = args[2], tournamentd = args[3]})) print (draws) print("|}") return getBuffer("\n") end

function p.main(frame) local args = require("Module:Arguments").getArgs(frame) return p._main(args) end

return p