-- Create a table of icons to display on the template test case page
require('strict')
local p = local m_iconData = mw.loadData("Module:Icon/data")local m_iconSandboxData = mw.loadData("Module:Icon/data/sandbox")
local function mergeTables(...) local ret = for _, t in ipairs do for k, v in pairs(t) do ret[k] = v end end return retend
local function reconstituteAliases(iconDataCollection) local ret = for code, iconData in pairs(iconDataCollection) do local outputData = ret[iconData.canonicalCode] or if code ~= iconData.canonicalCode then table.insert(outputData.aliases, code) end ret[iconData.canonicalCode] = outputData end return retend
local function makeTableData(iconDataCollection) local ret = for code, iconData in pairs(reconstituteAliases(iconDataCollection)) do if code ~= '_DEFAULT' then table.insert(ret,) end end table.sort(ret, function(t1, t2) return t1.code < t2.code end ) for _, t in ipairs(ret) do table.sort(t.aliases) end return retend
function p.testcases(frame) local tableData = makeTableData(mergeTables(m_iconData, m_iconSandboxData)) local ret = ') return table.concat(ret, '\n')end
function p.main(frame) local tableData = makeTableData(m_iconData) local ret = ') return table.concat(ret, '\n')end
return p