- 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: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary Tags: Mobile edit Mobile web edit |
mNo edit summary Tags: Mobile edit Mobile web edit |
||
Line 24: | Line 24: | ||
end | end | ||
output = mw.text.nowiki( | output = mw.text.nowiki(i) | ||
return output | return output | ||
end | end | ||
return p | return p |
Revision as of 03:46, 28 September 2022
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, "==.-==")
table.remove(section, 1)
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, "==(Suika Ibuki)==") do
header[s] = section[i]
i = i+1
end
output = mw.text.nowiki(i)
return output
end
return p