Module:List

-- Creates a formatted list from comma separated items. -- Module author: "The JoTS" --

local FORMATS = require("Module:List/custom") local MODES = require("Module:List/modes")

local function list(mode) return function(frame) --     local f = {...} --     local frame = #f == 1 and f[1] or {args={...}} local list    = frame.args[1] local custom  = frame.args[2] local args    = { frame.args[3], frame.args[4], frame.args[5] } local frm_list = list:gsub("([^,]+),?%s*",           custom and custom ~= ""            and function(str)                return MODES[mode]( FORMATS[custom](str, args) ); end            or MODES[mode])

return frm_list end end

return { main               = list "main", nolist             = list "nolist", with_links         = list "with_links", with_bulleted_links = list "with_bulleted_links", with_bullets       = list "with_bullets" }