Module:Wallinfo/idSets

local data = mw.loadData( 'Module:Wallinfo/idSets/data' ) -- loading data

local trim = mw.text.trim -- cache local currentFrame local getArg = function(key) local value = currentFrame.args[key] if not value then return nil end value = trim(value) if value == '' then return nil else return value end end

return { -- for template getSet = function(frame) currentFrame = frame -- cache local setname = getArg(1) local needSort = getArg(2) if not data[setname] then return end local str if needSort then local IDs = {} for k,v in pairs(data[setname]) do				if k ~= "default" then table.insert(IDs, k)				end end table.sort(IDs) for i,v in ipairs(IDs) do				if str then str = str .. ', ' .. v				else str = v				end end else for k,v in pairs(data[setname]) do				if k ~= "default" then if str then str = str .. ', ' .. k					else str = k					end end end end return str end,

}