Module:PoliticalParty/data: Difference between revisions
Jump to navigation
Jump to search
(Created page with "local p = {} p.partyNames = { ["UAP"] = "Unity and Progress Party", ["Unity and Progress"] = "Unity and Progress Party", ["ADP"] = "Antarctic Democratic Party", ["CLAU"] = "Classical Liberalists of the Antarctic Union", ["PRP"] = "Polar Republic Party" } --color shortname altname tablecolor p.parties = { ["Unity and Progress Party"] = {"#F600C2", "UAP", "Unity and Progress", "#F67CDD"}, ["Antarctic Democratic Party"] = {"#6f56d6", "ADP", "Antarctic Democratic Pa...") |
mNo edit summary |
||
Line 1: | Line 1: | ||
p = {} | |||
local data = require("Module:PoliticalParty/data") | |||
function nameConvert(arg) | |||
if data.partyNames[arg] ~= nil then | |||
return data.partyNames[arg] | |||
else | |||
return arg | |||
end | |||
end | |||
p.color = function(frame) | |||
p. | local arg = frame.args[1] | ||
[ | return data.parties[nameConvert(arg)][1] | ||
[ | end | ||
[ | p.shortname = function(frame) | ||
local arg = frame.args[1] | |||
return data.parties[nameConvert(arg)][2] | |||
end | |||
p.altname = function(frame) | |||
local arg = frame.args[1] | |||
return data.parties[nameConvert(arg)][3] | |||
end | |||
p.tablecolor = function(frame) | |||
local arg = frame.args[1] | |||
return data.parties[nameConvert(arg)][4] | |||
end | |||
return p | return p |
Revision as of 07:19, 14 November 2023
Documentation for this module may be created at Module:PoliticalParty/data/doc
p = {}
local data = require("Module:PoliticalParty/data")
function nameConvert(arg)
if data.partyNames[arg] ~= nil then
return data.partyNames[arg]
else
return arg
end
end
p.color = function(frame)
local arg = frame.args[1]
return data.parties[nameConvert(arg)][1]
end
p.shortname = function(frame)
local arg = frame.args[1]
return data.parties[nameConvert(arg)][2]
end
p.altname = function(frame)
local arg = frame.args[1]
return data.parties[nameConvert(arg)][3]
end
p.tablecolor = function(frame)
local arg = frame.args[1]
return data.parties[nameConvert(arg)][4]
end
return p