Module:Spell: Difference between revisions

From Kronopolis and the Flat Plane
No edit summary
No edit summary
Line 2: Line 2:


function p.getDomainList(frame)
function p.getDomainList(frame)
     local page = 'Module:Spell/domain_' .. frame.args[1] .. '.json'
     local directory = 'Json/Spell/Domain/'
    local page = directory .. frame['domain']
     local data = mw.loadJsonData(page)
     local data = mw.loadJsonData(page)
      
      
     return data
     local out = {}
 
for idx = 1, 5 do
table.insert(out, idx)
end
 
return table.concat(out, "<br>")
end
end


return p
return p

Revision as of 13:05, 24 February 2023

Usage

  • {{#invoke:spell|list|domain=}}
  • {{#invoke:spell|list|category=}}

local p = {}

function p.getDomainList(frame)
    local directory = 'Json/Spell/Domain/'
    local page = directory .. frame['domain']
    local data = mw.loadJsonData(page)
    
    local out = {}

	for idx = 1, 5 do
		table.insert(out, idx)
	end

	return table.concat(out, "<br>")
end

return p