Module:Cat
From XenReference
Documentation for this module may be created at Module:Cat/doc
local getArgs = require('Module:Arguments').getArgs
local p = {}
-- Turns arguments into a string "[[Category:Cat1]][[Category:Cat2]]..."
-- Expects category names separated by newlines
function p.toCategories(frame)
local args = getArgs(frame)
local unparsed = args[1]
local cats = ""
for cat in unparsed:gmatch('([^\n]+)') do
cats = cats .. "[[Category:" .. cat .. "]]"
end
return cats
end
return p
