<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mbwiki.stairwaygames.work/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AIcons</id>
	<title>Module:Icons - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mbwiki.stairwaygames.work/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AIcons"/>
	<link rel="alternate" type="text/html" href="https://mbwiki.stairwaygames.work/w/index.php?title=Module:Icons&amp;action=history"/>
	<updated>2026-04-07T17:53:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://mbwiki.stairwaygames.work/w/index.php?title=Module:Icons&amp;diff=5692&amp;oldid=prev</id>
		<title>Admin coral island: Created page with &quot;local p = {}  local iconData = mw.loadData(&#039;Module:Icons/data&#039;) local iconConfig = require(&#039;Module:Icons/config&#039;)  -- 	Does both checks as a function rather than writing longform each time and 	also checks a table value&#039;s existence  --% Completes a null or empty check on a variable.  local function exists(object, child) 	if object ~= nil and object ~= &#039;&#039; then 		if child ~= nil then 			if object[child] ~= nil and object[child] ~= &#039;&#039; then 				return true 			else 				re...&quot;</title>
		<link rel="alternate" type="text/html" href="https://mbwiki.stairwaygames.work/w/index.php?title=Module:Icons&amp;diff=5692&amp;oldid=prev"/>
		<updated>2023-08-04T02:49:05Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local p = {}  local iconData = mw.loadData(&amp;#039;Module:Icons/data&amp;#039;) local iconConfig = require(&amp;#039;Module:Icons/config&amp;#039;)  --[[ 	Does both checks as a function rather than writing longform each time and 	also checks a table value&amp;#039;s existence ]] --% Completes a null or empty check on a variable.  local function exists(object, child) 	if object ~= nil and object ~= &amp;#039;&amp;#039; then 		if child ~= nil then 			if object[child] ~= nil and object[child] ~= &amp;#039;&amp;#039; then 				return true 			else 				re...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
local iconData = mw.loadData(&amp;#039;Module:Icons/data&amp;#039;)&lt;br /&gt;
local iconConfig = require(&amp;#039;Module:Icons/config&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
	Does both checks as a function rather than writing longform each time and&lt;br /&gt;
	also checks a table value&amp;#039;s existence&lt;br /&gt;
]]&lt;br /&gt;
--% Completes a null or empty check on a variable. &lt;br /&gt;
local function exists(object, child)&lt;br /&gt;
	if object ~= nil and object ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		if child ~= nil then&lt;br /&gt;
			if object[child] ~= nil and object[child] ~= &amp;#039;&amp;#039; then&lt;br /&gt;
				return true&lt;br /&gt;
			else&lt;br /&gt;
				return false&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			return true&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
	If we don&amp;#039;t trim spaces shortcode checks will fail, copied from &lt;br /&gt;
	http://lua-users.org/wiki/StringTrim&lt;br /&gt;
]]&lt;br /&gt;
--% Trims whitespace from a string&lt;br /&gt;
local function trim(s)&lt;br /&gt;
   return s:match&amp;#039;^()%s*$&amp;#039; and &amp;#039;&amp;#039; or s:match&amp;#039;^%s*(.*%S)&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--Default settings&lt;br /&gt;
local semanticWiki = false -- Module control&lt;br /&gt;
local semanticPlatforms = true -- Function platforms()&lt;br /&gt;
local platformMaintenanceEnabled = true&lt;br /&gt;
local platformMaintenanceCategory = &amp;#039;Platforms needed&amp;#039;&lt;br /&gt;
local docTableClasses = &amp;#039;article-table&amp;#039;&lt;br /&gt;
local iconSizeDefault = &amp;#039;x14px&amp;#039;&lt;br /&gt;
local falloverIcon = &amp;#039;Icon question.png&amp;#039;&lt;br /&gt;
local maintenanceCategoryEnabled = false&lt;br /&gt;
local maintenanceCategory = &amp;#039;Template with invalid icons&amp;#039;&lt;br /&gt;
local iconFrameClass = &amp;#039;dev-icon-frame&amp;#039;&lt;br /&gt;
local imageClassList = {&lt;br /&gt;
	[&amp;#039;light&amp;#039;] = &amp;#039;dev-icon-light&amp;#039;,&lt;br /&gt;
	[&amp;#039;dark&amp;#039;] = &amp;#039;dev-icon-dark&amp;#039;,&lt;br /&gt;
	[&amp;#039;general&amp;#039;] = &amp;#039;dev-icon-general&amp;#039;&lt;br /&gt;
}&lt;br /&gt;
local sizeList = {&lt;br /&gt;
    [&amp;quot;small&amp;quot;]           = &amp;quot;x10px&amp;quot;,&lt;br /&gt;
    [&amp;quot;medium&amp;quot;]          = &amp;quot;x14px&amp;quot;,&lt;br /&gt;
    [&amp;quot;normal&amp;quot;]          = &amp;quot;x14px&amp;quot;,&lt;br /&gt;
    [&amp;quot;big&amp;quot;]             = &amp;quot;x20px&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
--Start checking for wiki defined settings and replace the defaults&lt;br /&gt;
&lt;br /&gt;
--Any settings in here only need checking if wiki is semantic enabled.&lt;br /&gt;
if exists(iconConfig, &amp;#039;semanticWiki&amp;#039;) then&lt;br /&gt;
	semanticWiki = iconConfig.semanticWiki&lt;br /&gt;
	if exists(iconConfig, &amp;#039;semanticPlatforms&amp;#039;) then&lt;br /&gt;
		semanticPlatforms = iconConfig.semanticPlatforms&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--For documentation()&lt;br /&gt;
if exists(iconConfig, &amp;#039;docTableClasses&amp;#039;) then&lt;br /&gt;
	docTableClasses = iconConfig.docTableClasses&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--Default icon size if not passed through in function calls&lt;br /&gt;
if exists(iconConfig, &amp;#039;iconSizeDefault&amp;#039;) then&lt;br /&gt;
	iconSizeDefault = iconConfig.iconSizeDefault&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[ Added &lt;br /&gt;
	Class control table to handle light/dark themes. This was originally put &lt;br /&gt;
	into the frontend template, when class handling should be back end. &lt;br /&gt;
	Adding the [&amp;#039;class&amp;#039;] = &amp;#039;light&amp;#039; or [&amp;#039;class&amp;#039;] = &amp;#039;dark&amp;#039; parameter to a icon&amp;#039;s&lt;br /&gt;
	dataset on Module:Icons/data will enable it to access a class if needed.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
if exists(iconConfig, &amp;#039;imageClassList&amp;#039;) then&lt;br /&gt;
	imageClassList = iconConfig.imageClassList&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--If the icon is invalid, use this image for the icon&lt;br /&gt;
if exists(iconConfig, &amp;#039;falloverIcon&amp;#039;) then&lt;br /&gt;
	falloverIcon = iconConfig.falloverIcon&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
if exists(iconConfig, &amp;#039;maintenanceCategoryEnabled&amp;#039;) then&lt;br /&gt;
	maintenanceCategory = iconConfig.maintenanceCategoryEnabled&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- If we don&amp;#039;t want a maintenance category we don&amp;#039;t need to set this&lt;br /&gt;
if maintenanceCategoryEnabled then&lt;br /&gt;
	if exists(iconConfig, &amp;#039;maintenanceCategory&amp;#039;) then&lt;br /&gt;
		maintenanceCategory = iconConfig.maintenanceCategory&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
if exists(iconConfig, &amp;#039;platformMaintenanceEnabled&amp;#039;) then&lt;br /&gt;
	maintenanceCategory = iconConfig.platformMaintenanceEnabled&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
if platformMaintenance then&lt;br /&gt;
	if exists(iconConfig, &amp;#039;platformMaintenanceCategory&amp;#039;) then &lt;br /&gt;
		platformMaintenanceCategory = iconConfig[&amp;#039;platformMaintenanceCategory&amp;#039;]&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
	Shared function for generating icons, this is used to by p.icons (invoke) &lt;br /&gt;
	and p.moduleIcons (require/mw.load)&lt;br /&gt;
]]&lt;br /&gt;
local function _generateIcons(iconList, iconSetting, iconLinks, tipOverride, &lt;br /&gt;
		iconCustomClass, iconSize, series)&lt;br /&gt;
    if exists(iconSetting) then &lt;br /&gt;
		iconSetting = trim(iconSetting)&lt;br /&gt;
        if exists(iconSize, iconSetting) then&lt;br /&gt;
            iconSetting = iconSize[iconSetting]&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        iconSetting = iconSizeDefault&lt;br /&gt;
    end&lt;br /&gt;
    -- This is for calls from other Lua modules as the above will result in nil&lt;br /&gt;
    if not exists(iconSetting) then&lt;br /&gt;
    	if exists(iconSize) then&lt;br /&gt;
			iconSetting = iconSize&lt;br /&gt;
		else&lt;br /&gt;
			iconSetting = iconSizeDefault&lt;br /&gt;
		end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if exists(iconLinks) then&lt;br /&gt;
        iconLinks = mw.text.split(iconLinks, &amp;quot;,&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
        &lt;br /&gt;
    if exists(tipOverride) then&lt;br /&gt;
        tipOverride = mw.text.split(tipOverride, &amp;quot;,&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if exists(iconCustomClass)then&lt;br /&gt;
    	iconCustomClass = &amp;#039;|class=&amp;#039; .. tostring(iconCustomClass);&lt;br /&gt;
    else&lt;br /&gt;
    	iconCustomClass = &amp;#039;&amp;#039;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local result = &amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
    for k, v in ipairs(iconList) do&lt;br /&gt;
        local newIcon = iconData[trim(v)]&lt;br /&gt;
        local currentIcon&lt;br /&gt;
        local currentTip&lt;br /&gt;
        if exists(newIcon) and (newIcon[series] or not series) then&lt;br /&gt;
            currentIcon = newIcon.icon&lt;br /&gt;
            if exists(tipOverride, k) then&lt;br /&gt;
                currentTip = tipOverride[k]&lt;br /&gt;
            else&lt;br /&gt;
                if exists(iconLinks, k) then&lt;br /&gt;
                    currentTip = iconLinks[k]&lt;br /&gt;
                else&lt;br /&gt;
                    currentTip = newIcon.tip&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            currentIcon = falloverIcon&lt;br /&gt;
            currentTip = &amp;quot;Unrecognized icon name&amp;quot;&lt;br /&gt;
            if maintenanceCategoryEnabled then&lt;br /&gt;
            	result = result .. &amp;#039;[[Category:&amp;#039;.. maintenanceCategory .. &amp;#039;]]&amp;#039;&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        &lt;br /&gt;
        --Create wikitext icon&lt;br /&gt;
		local dataLine = &amp;#039;[[File:&amp;#039; .. currentIcon .. &amp;#039;|&amp;#039; .. iconSetting &lt;br /&gt;
			.. &amp;#039;|link=&amp;#039;&lt;br /&gt;
        if exists(iconLinks, k) then&lt;br /&gt;
             dataLine = dataLine .. iconLinks[k]&lt;br /&gt;
        else&lt;br /&gt;
        	if exists(newIcon, Link) then&lt;br /&gt;
        		dataLine= dataLine .. newIcon.link&lt;br /&gt;
        	end&lt;br /&gt;
        end&lt;br /&gt;
        if currentTip ~= nil then&lt;br /&gt;
            dataLine = dataLine .. &amp;#039;|&amp;#039; .. currentTip&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        dataLine = dataLine .. iconCustomClass .. &amp;#039;]]&amp;#039;&lt;br /&gt;
&lt;br /&gt;
		local createTip = mw.html.create(&amp;#039;span&amp;#039;)&lt;br /&gt;
        	createTip:addClass(iconFrameClass)&lt;br /&gt;
        	:attr(&amp;#039;title&amp;#039;, currentTip)&lt;br /&gt;
        	:wikitext(dataLine)&lt;br /&gt;
        result = result .. tostring(createTip)&lt;br /&gt;
        &lt;br /&gt;
        if k &amp;lt; #iconList then&lt;br /&gt;
        	result = result .. &amp;quot; &amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--% Call for other modules to create standarised icons&lt;br /&gt;
function p.moduleIcons(iconList, iconSetting, iconLinks, tipOverride,&lt;br /&gt;
						iconClass, iconSize, series)&lt;br /&gt;
	iconList = mw.text.split(iconList, &amp;#039;,&amp;#039;)&lt;br /&gt;
	if iconData and iconConfig then&lt;br /&gt;
		return _generateIcons(iconList, iconSetting, iconLinks, tipOverride, &lt;br /&gt;
							iconClass, iconSize, series)&lt;br /&gt;
	elseif iconData then&lt;br /&gt;
		return &amp;#039;&amp;lt;span style=&amp;quot;color: red; background: grey&amp;quot;&amp;gt;&amp;#039; ..&lt;br /&gt;
			&amp;#039;[[Module:Icons/config]] requires configuration.&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
	elseif iconConfig then&lt;br /&gt;
		return &amp;#039;&amp;lt;span style=&amp;quot;color: red; background: grey&amp;quot;&amp;gt;&amp;#039; ..&lt;br /&gt;
			&amp;#039;[[Module:Icons/data]] requires configuration.&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;#039;&amp;lt;span style=&amp;quot;color: red; background: grey&amp;quot;&amp;gt;&amp;#039; ..&lt;br /&gt;
			&amp;#039;[[Module:Icons/config]] and [[Module:Icons/data]]&amp;#039; ..&lt;br /&gt;
			&amp;#039;requires configuration.&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--% Creates a string icons of consistent size within a span wrapper&lt;br /&gt;
--@ iconList (string) The icon short codes to process, each must be split with a comma&lt;br /&gt;
--@ iconSetting (string)[opt] A text value of size that is checked to return an actual size&lt;br /&gt;
--@ iconLinks (string)[opt] A list of articles for the icons to link to, each is split by a comma and maps exactly to iconList&lt;br /&gt;
--@ tipOverride [opt] (string) A list of tooltip text to replace the icon defaults, maps exactly to iconList&lt;br /&gt;
--@ iconClass [opt] (string) Any additional CSS classes to be assigned to icons&lt;br /&gt;
--@ iconSize [opt] (string) Takes a single defined size and sets it against the icons. Overrides iconSetting&lt;br /&gt;
--@ series [opt] (string) Only renders an icon if not set or the icon has the series parameter set&lt;br /&gt;
function p.Icons(frame) &lt;br /&gt;
	--[[All icons are now lower case to reduce script errors from &lt;br /&gt;
	incorrectly entering the icon code in a different case to the list]]&lt;br /&gt;
	if iconData and iconConfig then&lt;br /&gt;
    	local args = require(&amp;#039;Dev:Arguments&amp;#039;).getArgs(frame)&lt;br /&gt;
    	local iconList = mw.text.split(string.lower(args[1]), &amp;#039;,&amp;#039;)&lt;br /&gt;
    	local iconSetting = args[&amp;#039;setting&amp;#039;]&lt;br /&gt;
    	local iconLinks = args[&amp;#039;links&amp;#039;]&lt;br /&gt;
    	local tipOverride = args[&amp;#039;tooltips&amp;#039;]&lt;br /&gt;
    	local iconClass = args[&amp;#039;class&amp;#039;]&lt;br /&gt;
    	local iconSize = args[&amp;#039;size&amp;#039;] or sizeList&lt;br /&gt;
    	local series =  args[&amp;#039;series&amp;#039;]&lt;br /&gt;
&lt;br /&gt;
    	return _generateIcons(iconList, iconSetting, iconLinks, tipOverride, &lt;br /&gt;
    		iconClass, iconSize, series)    &lt;br /&gt;
    elseif iconData then&lt;br /&gt;
		return &amp;#039;&amp;lt;span style=&amp;quot;color: red; background: grey&amp;quot;&amp;gt;&amp;#039; ..&lt;br /&gt;
			&amp;#039;[[Module:Icons/config]] requires configuration.&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
	elseif iconConfig then&lt;br /&gt;
		return &amp;#039;&amp;lt;span style=&amp;quot;color: red; background: grey&amp;quot;&amp;gt;&amp;#039; ..&lt;br /&gt;
			&amp;#039;[[Module:Icons/data]] requires configuration.&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;#039;&amp;lt;span style=&amp;quot;color: red; background: grey&amp;quot;&amp;gt;&amp;#039; ..&lt;br /&gt;
			&amp;#039;[[Module:Icons/config]] and [[Module:Icons/data]]&amp;#039; ..&lt;br /&gt;
			&amp;#039;requires configuration.&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--% Creates a list of valid game platforms. &lt;br /&gt;
-- If the wiki has Semantic Mediawiki installed, this can also assign a property&lt;br /&gt;
-- (&amp;lt;nowiki&amp;gt;[[Has platforms::]]&amp;lt;/nowiki&amp;gt;) to the icons.&lt;br /&gt;
--@ 1 (string) A string of game short codes, each split by a comma.&lt;br /&gt;
&lt;br /&gt;
function p.platforms(frame)&lt;br /&gt;
	--[[All icons are now lower case to reduce script errors from &lt;br /&gt;
	incorrectly entering the icon code in a different case to the list]]&lt;br /&gt;
    local args = require(&amp;#039;Dev:Arguments&amp;#039;).getArgs(frame)&lt;br /&gt;
    local icons = args[1]&lt;br /&gt;
    local result = &amp;#039;&amp;#039;&lt;br /&gt;
	if icons then&lt;br /&gt;
		icons = mw.text.split(string.lower(icons), &amp;#039;,&amp;#039;)&lt;br /&gt;
    	for k, v in ipairs(icons) do&lt;br /&gt;
        	local currentIcon = iconData[trim(v)]&lt;br /&gt;
&lt;br /&gt;
	        if exists(currentIcon, &amp;#039;platform&amp;#039;) then&lt;br /&gt;
    	    	--Only required on semantic enabled wikis &lt;br /&gt;
        	    local createSM&lt;br /&gt;
        		if semanticWiki and semanticPlatforms then&lt;br /&gt;
			    	createSM = mw.html.create(&amp;#039;span&amp;#039;)&lt;br /&gt;
					createSM:css(&amp;#039;display&amp;#039;, &amp;#039;none&amp;#039;)&lt;br /&gt;
					    :wikitext(&amp;#039;[[Has platform::&amp;#039; .. currentIcon.tip .. &amp;#039;]]&amp;#039;)&lt;br /&gt;
    	        else&lt;br /&gt;
        	        createSM = &amp;#039;&amp;#039;&lt;br /&gt;
            	end&lt;br /&gt;
&lt;br /&gt;
	            local createPlatform = mw.html.create(&amp;#039;span&amp;#039;)&lt;br /&gt;
    	        	createPlatform:addClass(iconFrameClass)&lt;br /&gt;
        	    		:attr(&amp;#039;title&amp;#039;, currentIcon.tip)&lt;br /&gt;
            			:wikitext(&amp;#039;[[File:&amp;#039; &lt;br /&gt;
            				.. currentIcon.icon &lt;br /&gt;
            				.. &amp;#039;|alt=&amp;#039;&lt;br /&gt;
            				.. currentIcon.tip&lt;br /&gt;
            				.. &amp;#039;|x14px|link=]]&amp;#039;)&lt;br /&gt;
	            		:allDone()&lt;br /&gt;
    	        	-- prepends any semantic properties to the start of the icon&lt;br /&gt;
        	    	result = result .. tostring(createSM) &lt;br /&gt;
            			.. tostring(createPlatform)&lt;br /&gt;
	            if k &amp;lt; #icons then&lt;br /&gt;
    	            result = result .. &amp;quot; &amp;quot;&lt;br /&gt;
        	    end&lt;br /&gt;
	        end&lt;br /&gt;
	    end&lt;br /&gt;
	end&lt;br /&gt;
    --[[&lt;br /&gt;
    	If there are no valid platform codes in the list the function defaults &lt;br /&gt;
    	to an on page indicator with optional category.&lt;br /&gt;
    ]]&lt;br /&gt;
    if not exists(result) then&lt;br /&gt;
        result = &amp;#039;&amp;lt;sup&amp;gt;[Platforms needed]&amp;lt;/sup&amp;gt;&amp;#039;&lt;br /&gt;
        if platformMaintenanceEnabled then&lt;br /&gt;
         result = result .. &amp;#039;[[Category:&amp;#039; .. platformMaintenanceCategory &lt;br /&gt;
        	.. &amp;#039;]]&amp;#039;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--% Self generating function that displays all available icons and their short codes in a table set.&lt;br /&gt;
function p.documentation()&lt;br /&gt;
    local keys = {}&lt;br /&gt;
    for k in pairs(iconData) do&lt;br /&gt;
        table.insert(keys, k)&lt;br /&gt;
    end&lt;br /&gt;
 &lt;br /&gt;
    table.sort(keys)&lt;br /&gt;
    local result = mw.html.create(&amp;#039;table&amp;#039;)&lt;br /&gt;
    result:addClass(docTableClasses)&lt;br /&gt;
   		:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
   			:tag(&amp;#039;th&amp;#039;)&lt;br /&gt;
   				:wikitext(&amp;#039;prefix&amp;#039;)&lt;br /&gt;
   				:done()&lt;br /&gt;
   			:tag(&amp;#039;th&amp;#039;)&lt;br /&gt;
   				:wikitext(&amp;#039;Icon&amp;#039;)&lt;br /&gt;
   				:done()&lt;br /&gt;
   			:tag(&amp;#039;th&amp;#039;)&lt;br /&gt;
   				:wikitext(&amp;#039;prefix&amp;#039;)&lt;br /&gt;
   				:done()&lt;br /&gt;
   			:tag(&amp;#039;th&amp;#039;)&lt;br /&gt;
   				:wikitext(&amp;#039;Icon&amp;#039;)&lt;br /&gt;
   				:done()&lt;br /&gt;
   			:tag(&amp;#039;th&amp;#039;)&lt;br /&gt;
   				:wikitext(&amp;#039;prefix&amp;#039;)&lt;br /&gt;
   				:done()&lt;br /&gt;
   			:tag(&amp;#039;th&amp;#039;)&lt;br /&gt;
   				:wikitext(&amp;#039;Icon&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
    local columns = 3&lt;br /&gt;
    local tableRow&lt;br /&gt;
    for k,v in ipairs(keys) do&lt;br /&gt;
        local set = (k - 1) % columns + 1&lt;br /&gt;
    	if set == 1 then&lt;br /&gt;
    		tableRow = result:tag(&amp;#039;tr&amp;#039;)	&lt;br /&gt;
    	end&lt;br /&gt;
    	&lt;br /&gt;
    	tableRow:tag(&amp;#039;td&amp;#039;)&lt;br /&gt;
    		:wikitext(v)&lt;br /&gt;
&lt;br /&gt;
		local i = iconData[v]&lt;br /&gt;
        local newFile&lt;br /&gt;
        if exists(i) and i.class ~= nil then&lt;br /&gt;
        	newFile = mw.html.create(&amp;#039;span&amp;#039;)&lt;br /&gt;
        		:addClass(imageClassList[i.class])&lt;br /&gt;
        		:wikitext(&amp;#039;[[File:&amp;#039; .. i.icon .. &amp;#039;|x25px]]&amp;#039;)&lt;br /&gt;
        elseif exists(i.icon) then&lt;br /&gt;
        	newFile = mw.html.create(&amp;#039;span&amp;#039;)&lt;br /&gt;
        		:wikitext(&amp;#039;[[File:&amp;#039; .. i.icon .. &amp;#039;|x25px]]&amp;#039;)&lt;br /&gt;
        end&lt;br /&gt;
        &lt;br /&gt;
        tableRow:tag(&amp;#039;td&amp;#039;)&lt;br /&gt;
        	:node(newFile)&lt;br /&gt;
    end&lt;br /&gt;
 &lt;br /&gt;
    return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--% Maintenance function for sorting long icon Data lists. Results are passed to parser profile data for copying&lt;br /&gt;
function p.sortList()&lt;br /&gt;
	local keys = {}&lt;br /&gt;
	for k in pairs(iconData) do&lt;br /&gt;
		table.insert(keys, k)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	table.sort(keys)&lt;br /&gt;
	local result = &amp;#039;return {&amp;#039;&lt;br /&gt;
	for k,v in ipairs(keys) do&lt;br /&gt;
		local ins = iconData[v]&lt;br /&gt;
		result = result .. &amp;#039;\n\t[\&amp;#039;&amp;#039; .. string.gsub(v, &amp;#039;\&amp;#039;&amp;#039;, &amp;#039;\\\&amp;#039;&amp;#039;) .. &amp;#039;\&amp;#039;] = {&amp;#039;&lt;br /&gt;
			.. &amp;#039;\n\t\t[\&amp;#039;icon\&amp;#039;]  = \&amp;#039;&amp;#039; .. string.gsub(ins.icon, &amp;#039;\&amp;#039;&amp;#039;, &amp;#039;\\\&amp;#039;&amp;#039;) &lt;br /&gt;
			.. &amp;#039;\&amp;#039;,&amp;#039;&lt;br /&gt;
		if ins.link then&lt;br /&gt;
			result = result .. &amp;#039;\n\t\t[\&amp;#039;link\&amp;#039;] = \&amp;#039;&amp;#039; &lt;br /&gt;
				.. string.gsub(ins.link, &amp;#039;\&amp;#039;&amp;#039;, &amp;#039;\\\&amp;#039;&amp;#039;)  .. &amp;#039;\&amp;#039;,&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if ins.tip then&lt;br /&gt;
			result = result .. &amp;#039;\n\t\t[\&amp;#039;tip\&amp;#039;] = \&amp;#039;&amp;#039; &lt;br /&gt;
				.. string.gsub(ins.tip, &amp;#039;\&amp;#039;&amp;#039;, &amp;#039;\\\&amp;#039;&amp;#039;)  .. &amp;#039;\&amp;#039;,\n\t},&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if ins.platform then&lt;br /&gt;
			result = result .. &amp;#039;\n\t\t[\&amp;#039;platform\&amp;#039;] = \&amp;#039;&amp;#039; &lt;br /&gt;
				.. string.gsub(ins.platform, &amp;#039;\&amp;#039;&amp;#039;, &amp;#039;\\\&amp;#039;&amp;#039;)  .. &amp;#039;\&amp;#039;,\n\t},&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if ins.alt then&lt;br /&gt;
			result = result .. &amp;#039;\n\t\t[\&amp;#039;alt\&amp;#039;] = \&amp;#039;&amp;#039; &lt;br /&gt;
				.. string.gsub(ins.alt, &amp;#039;\&amp;#039;&amp;#039;, &amp;#039;\\\&amp;#039;&amp;#039;)  .. &amp;#039;\&amp;#039;,\n\t},&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	result = result .. &amp;#039;\n}&amp;#039;&lt;br /&gt;
	mw.log(result)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Admin coral island</name></author>
	</entry>
</feed>