Модуль:Meals Lookup: различия между версиями

Нет описания правки
РЕЛИИИИИИЗ!!!!
Строка 443: Строка 443:
end
end


function p.soups(frame)
-- you should not use this for building recipes inside lua
function p.buildnamedrecipes(frame) -- {{#invoke:Meals Lookup|buildnamedrecipes|[Pattern1 | Pattern2 | Pattern3 | ...]}}
     local out = ""
     local out = ""
    local tablo = p.meals
    for _, patt in pairs(frame.args) do
        local ids = getrecipesbyname(frame, tablo, patt)
        out = out .. p.buildrecipeboxuniversal(frame, ids)
    end
     return out
     return out
end
end
Строка 482: Строка 488:
end
end


function p.tests3(frame)
    local out = ""
    local tablo = p.meals
    for _, patt in pairs(frame.args) do
        local ids = getrecipesbyname(frame, tablo, patt)
        -- for type, recipes in pairs(ids) do
        --    out = out .. table.length(recipes)
        --    for n, recipe in pairs(recipes) do
        --        local id = recipe["id"]
        --        out = out .. id .. "\n"
        --    end
        -- end
        out = out .. p.buildrecipeboxuniversal(frame, ids)
    end
    return out
end


-- function p.tests2(frame)
-- function p.tests2(frame)