• 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

From Touhou Wiki
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 19: Line 19:


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


output = mw.text.nowiki(header["=="])
output = mw.text.nowiki(header["Suika Ibuki"])
return output
return output
end
end
return p
return p

Revision as of 03:42, 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(header["Suika Ibuki"])
return output
end
return p