Site News |
---|
Warning: This wiki contains spoilers. Read at your own risk! Social media: If you would like, please join our Discord server, and/or follow us on Twitter or Tumblr! Engage info: As the game has only recently released, we lack much key information. Please help add any info that you can. |
Module:PageList
From Fire Emblem Wiki, your source on Fire Emblem information. By fans, for fans.
local p = {}
function p.pagelist(frame)
local pages = frame:getParent().args
total = 0
for k,v in pairs(pages) do
if type(k) == "number" then
total = total + 1
end
end
if total == 1 then
output = string.format("[[%s]]", pages[1])
elseif total == 2 then
output = string.format("[[%s]] and [[%s]]", pages[1], pages[2])
else
i = 1
output = ""
repeat
output = string.format("%s[[%s]], ", output, pages[i])
i = i + 1
until i == total
output = string.format("%sand [[%s]]", output, pages[i])
end
return output
end
return p