Module:Sandbox/trappist the monk/html/data

--[[--< F O R M A T _ S T R I N G S _ T >--

format strings for string.format

]]

local format_strings_t = { athletes = '%s',							-- country name; year; 'Winter' or 'Summer'; number of athletes caption = '%s at the %s Olympic Games',									-- country name; 'Winter' or 'Summer' game = '',											-- either of 'SOG' or 'WOG'; year	-- TODO: incorporate the data from that template in this module rank = '%s',								-- year; 'Winter' or 'Summer'; rank for that year }

--[[--< M E S S A G E S _ T >--

translate shorthand strings to full-length messages with wiki markup

]]

local messages_t = { future = "future event", DNP = "did not participate", }

--[[--< C O U N T R Y _ D A T A _ T >--

country_data_t is a table of tables. Country data are indexed with the same tags that are used in Module:Country_alias/data

Each country's table has these members all_time_rank – a number – presumably this number comes from someplace in All-time Olympic Games medal table country – a string – name of the country; used to create wikilinks in format_strings_t.athletes and format_strings_t.rank SOG – a sequence of k/v tables – Summer Olympic Games – used to build the html table; details below WOG – a sequence of k/v tables – Winter Olympic Games – used to build the html table; details below

SOG and WOG are sequences of k/v tables. Each k/v table represent one row of the rendered html table; each row may have some but not all of these members: year – required – a number or a string; when a number: used to create appropriate template used to create wikilinks in format_strings_t.athletes and format_strings_t.rank when a string: template is not created wikilinks in format_strings_t.athletes and format_strings_t.rank are not created all other members except message and rowspan are ignored athletes – a number – the number of country's athletes participating in the games; wikilinked by format_strings_t.athletes gold – a number – the number of gold medals awarded to country's athletes for year's games silver – a number – the number of silver medals awarded to country's athletes for year's games bronze – a number – the number of bronze medals awarded to country's athletes for year's games rank – a number – rank among the countries participating in year's games host – boolean – accepts the single value 'yes' – renders that row with a 3px purple boarder message – a string – plain text of keywords; when present causes colspan across all columns to the right of				the Games column; when message applies to multiple consecutive rows, use only in the top row supports these keywords: DNP – did not participate; see messages_t for definition future – future events; see messages_t for definition any other text rendered as is		rowspan – a number – used only with message; applies message to multiple consecutive rows ]]

local country_data_t = { MEX = { all_time_rank = 50, country = 'Mexico', SOG = { {year = 1896, message = 'DNP'}, {year = 1900, athletes = 4, gold = 0, silver = 0, bronze = 0, rank = 20}, {year = 1904, message = 'DNP', rowspan = 4}, {year = 1908}, {year = 1912}, {year = 1920}, {year = 1924, athletes = 13, gold = 0, silver = 0, bronze = 0, rank = '-'}, {year = 1928, athletes = 30, gold = 0, silver = 0, bronze = 0, rank = '-'}, {year = 1932, athletes = 73, gold = 0, silver = 2, bronze = 0, rank = 21}, {year = 1936, athletes = 32, gold = 0, silver = 0, bronze = 3, rank = 28}, {year = 1948, athletes = 88, gold = 2, silver = 1, bronze = 2, rank = 17}, {year = 1952, athletes = 64, gold = 0, silver = 1, bronze = 0, rank = 34}, {year = 1956, athletes = 24, gold = 1, silver = 0, bronze = 1, rank = 23}, {year = 1960, athletes = 69, gold = 0, silver = 0, bronze = 1, rank = 41}, {year = 1964, athletes = 94, gold = 0, silver = 0, bronze = 1, rank = 35}, {year = 1968, athletes = 275, gold = 3, silver = 3, bronze = 3, rank = 15, host = 'yes'}, {year = 1972, athletes = 174, gold = 0, silver = 1, bronze = 0, rank = 33}, {year = 1976, athletes = 97, gold = 1, silver = 0, bronze = 1, rank = 25}, {year = 1980, athletes = 45, gold = 0, silver = 1, bronze = 3, rank = 29}, {year = 1984, athletes = 99, gold = 2, silver = 3, bronze = 1, rank = 17}, {year = 1988, athletes = 83, gold = 0, silver = 0, bronze = 2, rank = 44}, {year = 1992, athletes = 102, gold = 0, silver = 1, bronze = 0, rank = 49}, {year = 1996, athletes = 97, gold = 0, silver = 0, bronze = 1, rank = 71}, {year = 2000, athletes = 78, gold = 1, silver = 2, bronze = 3, rank = 40}, {year = 2004, athletes = 109, gold = 0, silver = 3, bronze = 1, rank = 59}, {year = 2008, athletes = 85, gold = 2, silver = 0, bronze = 2, rank = 36}, {year = 2012, athletes = 102, gold = 1, silver = 3, bronze = 4, rank = 38}, {year = 2016, athletes = 125, gold = 0, silver = 3, bronze = 2, rank = 61}, {year = 2020, athletes = 164, gold = 0, silver = 0, bronze = 4, rank = 84}, {year = 2024, message = 'future', rowspan = 3}, {year = 2028}, {year = 2032}, },			WOG = { {year = 1924, message = 'DNP'}, {year = 1928, athletes = 4, gold = 0, silver = 0, bronze = 0, rank = '-'}, {year = 1932, message = 'DNP', rowspan = 11}, {year = 1936}, {year = 1948}, {year = 1952}, {year = 1956}, {year = 1960}, {year = 1964}, {year = 1968}, {year = 1972}, {year = 1976}, {year = 1980}, {year = 1984, athletes = 1, gold = 0, silver = 0, bronze = 0, rank = '-'}, {year = 1988, athletes = 11, gold = 0, silver = 0, bronze = 0, rank = '-'}, {year = 1992, athletes = 20, gold = 0, silver = 0, bronze = 0, rank = '-'}, {year = 1994, athletes = 1, gold = 0, silver = 0, bronze = 0, rank = '-'}, {year = 1998, message = 'DNP'}, {year = 2002, athletes = 3, gold = 0, silver = 0, bronze = 0, rank = '-'}, {year = 2006, message = 'DNP'}, {year = 2010, athletes = 1, gold = 0, silver = 0, bronze = 0, rank = '-'}, {year = 2014, athletes = 1, gold = 0, silver = 0, bronze = 0, rank = '-'}, {year = 2018, athletes = 4, gold = 0, silver = 0, bronze = 0, rank = '-'}, {year = 2022, athletes = 4, gold = 0, silver = 0, bronze = 0, rank = '-'}, {year = 2006, message = 'future'}, }			},		SRB = {																	-- games and results for Serbia; wikipedia does not predict the future so I left out future events country = 'Serbia', all_time_rank = 67, SOG = { {year = 1912, athletes = 3, gold = 0, silver = 0, bronze = 0, rank = '-'}, {year = '1920–1988', message = "as part of "}, {year = 1992, message = "as part of the "}, {year = '1996–2004', message = "as part of "}, {year = 2008, athletes = 92, gold = 0, silver = 1, bronze = 1, rank = 61}, {year = 2012, athletes = 116, gold = 1, silver = 1, bronze = 2, rank = 43}, {year = 2016, athletes = 103, gold = 2, silver = 4, bronze = 2, rank = 32}, {year = 2020, athletes = 87, gold = 3, silver = 1, bronze = 5, rank = 28}, {year = 2024, message = 'future', rowspan = 3}, {year = 2028}, {year = 2032} },			WOG = { {year = '1924–1992', message = "as part of "}, {year = 1994, message = 'DNP'}, {year = '1998–2006', message = "as part of "}, {year = 2010, athletes = 10, gold = 0, silver = 0, bronze = 0, rank = '-'}, {year = 2014, athletes = 8, gold = 0, silver = 0, bronze = 0, rank = '-'}, {year = 2018, athletes = 4, gold = 0, silver = 0, bronze = 0, rank = '-'}, {year = 2022, athletes = 2, gold = 0, silver = 0, bronze = 0, rank = '-'}, {year = 2026, message = 'future'}, }			}		}

----< E X P O R T E D  T A B L E S >

return { country_data_t = country_data_t, format_strings_t = format_strings_t, messages_t = messages_t, }