Content deleted Content added
BrandonXLF (talk | contribs) No edit summary |
BrandonXLF (talk | contribs) No edit summary |
||
Line 21:
local file = nil
if string.match(image,
file = mw.getCurrentFrame():expandTemplate{title =
elseif string.match(image,
local country, var = string.match(image,
file = mw.getCurrentFrame():expandTemplate{title =
else
file = mw.getCurrentFrame():expandTemplate{title =
end
Line 35:
function p.main(frame)
local args = getArgs(frame)
local
local entries = {}
local i = 1
local keyHandles = {
[''] = getCountry,
}
for i, entry in ipairs(args) do
local country
local timespan local flag
local data = {}
for line in
line = mw.text.trim(line)
local key, val = line:match('^([a-z]*):? *(.*)$')
if keyHandles[key
▲ timespan = getTimespan(val)
▲ image = getImage(val)
else
return require('Module:Error').error{'Invalid key ' .. key .. ' in argument ' .. i}
Line 58 ⟶ 62:
end
if not
return require('Module:Error').error{'A country is required in argument ' .. i}
end
if not
return require('Module:Error').error{'A date is required in argument ' .. i}
end
table.insert(entries, {▼
if
end
i = i + 1
Line 91:
outTable:tag('tr')
:tag('th')
:attr('colspan',
:css({
['text-align'] = 'center',
Line 102:
local row = outTable:tag('tr')
if entry.
row:tag('td')
:css('vertical-align', 'top')
:wikitext(entry.
elseif
row:tag('td')
end
Line 115:
['vertical-align'] = 'top'
})
:wikitext(entry
end
|