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