• 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

From Touhou Wiki
Revision as of 02:18, 28 September 2022 by Archimedes5000 (talk | contribs)
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
difficulty = {"Easy", "Medium", "Hard", "Lunatic"}
for i, v in ipairs(args) do
difficulty[i] = v
end

--Split article
for s in string.gmatch(article, "==(.-)==") do
header[s] = section[i]
i = i+1
end

output = header[2]
return output
end
return p