local p = {}
local data_competitions, data_absences
local all_competitions = {
local function load_data(frame)
["All-Africa Games"] = {
-- Load data module (or its sandbox) and set variables from its exported data.
1965, 1973, 1978, 1987, 1991, 1995, 1999, 2003, 2007, 2011, 2015},
if not data_competitions then
frame = frame or mw.getCurrentFrame()
-----Asian Games----
local sandbox = frame:getTitle():find('sandbox', 1, true) and '/sandbox' or ''
["Asian Games"] = {
local datamod = mw.loadData('Module:Team appearances list/data' .. sandbox)
1951, 1954, 1958, 1962, 1966, 1970, 1974, 1978, 1985, 1986, 1990, 1994,
data_competitions = datamod.competitions
1998, 2002, 2006, 2010, 2014},
data_absences = datamod.absences
["Asian Beach Games"] = {
end
2008, 2010, 2012, 2014, 2016},
end
["Asian Para Games"] = {
2010, 2014, 2018},
["Asian Youth Games"] = {
2009, 2013, 2021},
["Asian Winter Games"] = {
1986, 1990, 1996, 1999, 2003, 2007, 2011, 2017},
["East Asian Games"] = {
1993, 1997, 2001, 2005, 2009, 2013},
["South Asian Games"] = {
1984, 1985, 1987, 1989, 1991, 1993, 1995, 1999, 2004, 2006, 2010, 2016},
["Southeast Asian Games"] = {
1977, 1979, 1981, 1983, 1985, 1987, 1989, 1991, 1993, 1995, 1997, 1999,
2001, 2003, 2005, 2007, 2009, 2011, 2013, 2015, 2017},
["Southeast Asian Peninsular Games"] = {
1959, 1961, 1963, 1965, 1967, 1969, 1971, 1973, 1975},
["West Asian Games"] = {
1997, 2002, 2005, 2016},
-----Commonwealth Games-----
["Commonwealth Games"] = {
1930, 1934, 1938, 1950, 1954, 1958, 1962, 1966, 1970, 1974, 1978, 1982,
1986, 1990, 1994, 1998, 2002, 2006, 2010, 2014},
["Commonwealth Youth Games"] = {
2000, 2004, 2008, 2011, 2015, 2017},
-----European Games-----
["European Athletics Championships"] = {
1934, 1938, 1946, 1950, 1954, 1958, 1962, 1966, 1969, 1971, 1974, 1978,
1982, 1986, 1990, 1994, 1998, 2002, 2006, 2010, 2012, 2014, 2016},
["European Games"] = {
2015},
["Mediterranean Games"] = {
1951, 1955, 1959, 1963, 1967, 1971, 1975, 1979, 1983, 1987, 1991, 1993,
1997, 2001, 2005, 2009, 2013, 2017},
----- Olympics -----
["Summer Olympics"] = {
1896, 1900, 1904, 1908, 1912, 1920, 1924, 1928, 1932, 1936, 1948, 1952,
1956, 1960, 1964, 1968, 1972, 1976, 1980, 1984, 1988, 1992, 1996, 2000,
2004, 2008, 2012, 2016},
["Summer Paralympics"] = {
1960, 1964, 1968, 1972, 1976, 1980, 1984, 1988, 1992, 1996, 2000, 2004,
2008, 2012, 2016},
["Summer Youth Olympics"] = {
2010, 2014, 2018},
["Winter Olympics"] = {
1924, 1928, 1932, 1936, 1948, 1952, 1956, 1960, 1964, 1968, 1972, 1976,
1980, 1984, 1988, 1992, 1994, 1998, 2002, 2006, 2010, 2014},
["Winter Paralympics"] = {
1976, 1980, 1984, 1988, 1992, 1994, 1998, 2002, 2006, 2010, 2014},
["Winter Youth Olympics"] = {
2012, 2016},
----- Misc / World -----
["FEI World Equestrian Games"] = {
1990, 1994, 1998, 2002, 2006, 2010, 2014},
["Pan American Games"] = {
1951, 1955, 1959, 1963, 1967, 1971, 1975, 1979, 1983, 1987, 1991, 1995,
1999, 2003, 2007, 2011, 2015},
["Summer Universiade"] = {
1959, 1961, 1963, 1965, 1967, 1970, 1973, 1975, 1977, 1979, 1981, 1983,
1985, 1987, 1989, 1991, 1993, 1995, 1997, 1999, 2001, 2003, 2005, 2007,
2009, 2011, 2013, 2015, 2017},
["Winter Universiade"] = {
1960, 1962, 1964, 1966, 1968, 1972, 1978, 1981, 1983, 1985, 1987, 1989,
1991, 1993, 1995, 1997, 1999, 2001, 2003, 2005, 2007, 2009, 2011, 2013,
2015, 2017},
["World Aquatics Championships"] = {
1973, 1975, 1978, 1982, 1986, 1991, 1994, 1998, 2001, 2003, 2005, 2007,
2009, 2011, 2013, 2015},
["World Championships in Athletics"] = {
1983, 1987, 1991, 1993, 1995, 1997, 1999, 2001, 2003, 2005, 2007, 2009,
2011, 2013, 2015, 2017},}
local function strip_to_nil(text)
local begin_year = tonumber(args.begin_year)
local end_year = tonumber(args.end_year)
local competitions = all_competitionsdata_competitions[args.competition]
if competitions then
begin_year = begin_year or 0
-- Should show error if begin_year > end_year.
function p._main(args)
load_data() -- in case this function is called by another module
local hlist = require('Module:List').horizontal
local absent_years, absent_ranges = {}, {}
function p.main(frame)
load_data(frame)
return p._main(frame:getParent().args)
end
|