Module:Category

From Derivative
Jump to navigation Jump to search

Documentation for this module may be created at Module:Category/doc

local str = {}

local function tableToString(t)
    local key
    local value
    local result

    result = ''

    for key, value in pairs(t) do
        if (tonumber(key) ~= nil) then
            result = result .. '[[Category:' .. value .. ']]\n' 
        else
            result = result .. '[[Category:' .. value .. ']]\n' 
        end
    end
 
    return result
end

function str.list(frame)
    return tableToString(frame.args)
end

return str