- Welcome to Touhou Wiki!
- Registering is temporarily disabled. Check in our Discord server to request an account and for assistance of any kind.
Module:Test
Jump to navigation
Jump to search
Documentation for this module may be created at Module:Test/doc
local p = {}
function p.main(frame)
--Get article
local args = frame.args
local title = args.title
local title = mw.title.new(title)
local article = title:getContent()
local header = {}
local section = mw.text.split(article, "==.-==")
local i = 1
--Get custom difficulties
local difficulty = {"Easy", "Medium", "Hard", "Lunatic"}
for k, v in ipairs(args) do
difficulty[k] = v
end
--Split article
for s in string.gmatch(article, "==(.-)==") do
header[s] = section[i]
i = i+1
end
--Add tabber tags
j = 1
for k, v in pairs(header) do
v = k.."\n<tabber>"..v.."\n</tabber>"
--Add tabber tabs
for s in string.gmatch(v, "{{Spell Card Info") do
v = string.gsub(v, "(}}\n)({{Spell Card Info)", "%1|%-|"..difficulty[j].."=\n%2", 1)
j = j+1
end
end
output = mw.text.nowiki(header["Boss Spell Card #1"])
return output
end
return p