Module:Category1

From Derivative
Revision as of 13:41, 21 July 2017 by Testuser (talk | contribs) (Created page with "local str = {} local function tableToString(t) local key local value local result result = '' for key, value in pairs(t) do if (tonumber(key) ~=...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation for this module may be created at Module:Category1/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