Module:RecipeUsage

local p = {}

local recipes = mw.loadData('Module:CraftingRecipes')

function createTable(recipe) local table = mw.html.create('table'):addClass('wikitable') local head = table:tag('tr') head:tag('th'):wikitext('Ingredients') head:tag('th'):wikitext('Product') head:tag('th'):wikitext('Energy (MW)') head:tag('th'):wikitext('Time (s)')

head:tag('th'):wikitext(#recipe.ingredients)

return table end

p.crafting = function(f) local pageName = f:getParent:getTitle for k,v in pairs(recipes) do       if v.product[2] == pageName then return createTable(v) end end return "No crafting recipe was found in Module:CraftingRecipes for " .. pageName end

return p