Content added Content deleted
No edit summary |
No edit summary |
||
Line 5: | Line 5: | ||
p.getRecipe = function(frame) |
p.getRecipe = function(frame) |
||
local result = frame.args[1] |
local result = frame.args[1] |
||
for |
for k, v in pairs(recipelist) do |
||
if recipelist[ |
if recipelist[v]['output-name'] == result then |
||
local txt = recipelist[ |
local txt = recipelist[v]['output-name'] |
||
end |
end |
||
end |
end |
Revision as of 19:27, 16 February 2022
Documentation for this module may be created at Module:Recipe/doc
local recipelist = mw.text.jsonDecode(mw.getCurrentFrame():expandTemplate{title='Template:Recipes.json'})
local p = {}
p.getRecipe = function(frame)
local result = frame.args[1]
for k, v in pairs(recipelist) do
if recipelist[v]['output-name'] == result then
local txt = recipelist[v]['output-name']
end
end
return txt
end
return p