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

Нет описания правки
Нет описания правки
 
(не показано 7 промежуточных версий 2 участников)
Строка 161: Строка 161:
     out = out .. p.buildixablerecipes(frame)
     out = out .. p.buildixablerecipes(frame)
     return out
     return out
end
function p.getPagesInCategory()
    local categoryName = "Викиделы"  -- Задайте название категории здесь
    local categoryPages = {}
   
    for page in mw.parse.categoryPages(categoryName) do
        table.insert(categoryPages, page.title)
    end
    if #categoryPages == 0 then
        return "Нет страниц в категории '" .. categoryName .. "'."
    end
    local result = "Страницы в категории '" .. categoryName .. "':\n"
    for _, title in ipairs(categoryPages) do
        result = result .. "* [[ " .. title .. " ]]\n"
    end
    return result
end
end


Строка 350: Строка 370:
      
      
     out = frame:preprocess("{{Recipe Box" ..
     out = frame:preprocess("{{Recipe Box" ..
        "|name={{#invoke:Entity Lookup|getname|" .. recipe["effects"][1]["Entity"] .. "}}" ..
         "|component-1=" .. input ..
         "|component-1=" .. input ..
        "|name= " ..
         "|transformer={{Recipe Transformers|mixableRecipes}}" ..
         "|transformer={{Recipe Transformers|mixableRecipes}}" ..
         "|result=" .. result .. "}}")
         "|result=" .. result .. "}}")
Строка 401: Строка 421:
--    return out
--    return out
-- end
-- end


return p
return p