Для документации этого модуля может быть создана страница Модуль:Песочница/Pok/doc

local p = {}

function p.main(frame)
    local args = frame.args

    local id = args[1]
    if not id then
        return "Ошибка: не указан обязательный параметр id."
    end

    local itemStack = frame:preprocess(string.format('{{#invoke:Prototypes/Хранилище/Предмет|main|framing|stack|%s}}', id))
    local itemContained = frame:preprocess(string.format('{{#invoke:Prototypes/Хранилище/Предмет|main|framing|contained|%s}}', id))
    local itemSlot = frame:preprocess(string.format('{{#invoke:Prototypes/Хранилище/Предмет|main|framing|slot|%s}}', id))
    local itemChem = frame:preprocess(string.format('{{СollapsibleMenu|color=#3e7c82|{{#invoke:Prototypes/Хранилище/Предмет|main|chem|%s}}}}', id))
    
    local itemName = frame:preprocess("{{#invoke:Entity Lookup|getname|" .. id .. "}}")

    local prefix = args[2] or ""
    local label = args["label"]
    if label == nil then
        label = itemName
    end

    local image
    local size = args["size"] or "32px"
    if args["image"] then
        image = string.format("[[Файл:%s|%s]]", args["image"], size)
    else
        image = string.format("[[Файл:%s.png|%s]]", id, size)
    end

    local labelOutput = label
    if args["link"] then
        local linkTarget = args["link"]
        if linkTarget == "" then
            linkTarget = itemName
        end
        if label ~= "" then
            labelOutput = string.format("[[%s|%s]]", linkTarget, label)
        else
            labelOutput = ""
        end
    end

    local result = image .. " "
    if args["repository"] then
        result = result .. itemStack .. " " .. labelOutput .. " " .. itemContained .. " " .. itemSlot .. " " .. itemChem
    else
        result = result .. prefix .. " " .. labelOutput
    end

    return frame:preprocess("<span>" .. result .. "</span>")
end

return p