Module:CraftingRecipe: Difference between revisions
Jump to navigation
Jump to search
Created page with "local p = {} function p.show(frame) local ingredients = frame.args['ingredients'] local products = frame.args['products'] local ingredientList = mw.text.split(ingredients, ',') local productList = mw.text.split(products, ',') local result = '{| class="wikitable"\n! Ingredient !! Amount\n' for _, item in ipairs(ingredientList) do local parts = mw.text.split(item, ':') result = result .. '|-\n| ' .. parts[1] .. ' || ' .. parts[2]..." |
(No difference)
|
Revision as of 10:32, 24 June 2025
Documentation for this module may be created at Module:CraftingRecipe/doc
local p = {}
function p.show(frame)
local ingredients = frame.args['ingredients']
local products = frame.args['products']
local ingredientList = mw.text.split(ingredients, ',')
local productList = mw.text.split(products, ',')
local result = '{| class="wikitable"\n! Ingredient !! Amount\n'
for _, item in ipairs(ingredientList) do
local parts = mw.text.split(item, ':')
result = result .. '|-\n| ' .. parts[1] .. ' || ' .. parts[2] .. '\n'
end
result = result .. '|}\n\n{| class="wikitable"\n! Product !! Amount\n'
for _, product in ipairs(productList) do
local parts = mw.text.split(product, ':')
result = result .. '|-\n| ' .. parts[1] .. ' || ' .. parts[2] .. '\n'
end
result = result .. '|}'
return result
end
return p