• 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 Advanced mobile edit
 
(260 intermediate revisions by the same user not shown)
Line 1: Line 1:
local p = {}
local export_table = {}
function p.main(frame)


--Get article
export_table.functionName = function (frame)
local args = frame.args
  local ISO = frame.args[1]
local title = args.title
  local Name = frame.args[2]
local title = mw.title.new(title)
  local data = mw.ext.externalData.getExternalData("some shit with "..ISO.." and "..Name.." or whatever")
local article = title:getContent()
   return data
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
if i == 1 then return table.concat(difficulty, ";") end
--Split article
for s in string.gmatch(article, "==(.-)==") do
   header[s] = section[i]
  i = i+1
end
end


--Add tabber tags
return export_table
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

Latest revision as of 17:04, 19 March 2024

Documentation for this module may be created at Module:Test/doc

local export_table = {}

export_table.functionName = function (frame)
   local ISO = frame.args[1]
   local Name = frame.args[2]
   local data = mw.ext.externalData.getExternalData("some shit with "..ISO.." and "..Name.." or whatever")
   return data
end

return export_table