• 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
 
(265 intermediate revisions by the same user not shown)
Line 1: Line 1:
local p = {}
local export_table = {}
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 _, 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
 
--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.sub(v, "(}}\n)({{Spell Card Info)", "%1|%-|"..difficulty[j].."=\n%2")
  j = j+1
  end


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
end


output = header["Boss Spell Card #1"]
return export_table
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