Module:Icons/doc

A library of functions for displaying icons on pages or within other templates. For best performance, a chain of icons (sit in a row with nothing between) should be done with a single call.

Functions
This module relies on the  and   contained within Module:Util. All function calls from this module are prefixed with  e.g..

_generate
This function is internal only and the main workhorse for  and. This function builds the function list. The first task is determining the size of the icons.

In wikitext mark up the rough equivalent would be:

The next step is to break the comma separated lists into a table:

This would be the equivalent of using multiple { {#explode:}} functions and variables to store each item as its own.

Once the data has been pre-processed a loop is used to run through each item in the list to generate the icon collection:

Line 2 checks the data list at Module:Icons/data for the data relating to the icon short code and returns a result or  (does not exist) Depending on if a result was found the code continues, if there is no match a dummy icon is supplied at lines 14/15 and a maintenance category added at line 16.

If a match is found, the next task is to check if the tooltip is being overwritten, if it isn't being overwrite, it will then check if an page alternative link has been supplied, otherwise fall back to the default tooltip.

The wikitext equivalent would be

Now the correct icon, tooltip and link have been obtained, lines 21-31 build the image file in the format.

Lines 33-37 create the  which contains the icon and inserts the icon inside. When rendered this will appear as.

Finally lines 39-41 check if the item being created is the last in the list to be created. If not it will add a space at the end of the string so there is space between the icons on the page once completed.

Invocation Parameters
The invocation parameters are passed through from  or. The variables align between these three functions and the below should be taken as an explanation for all three.

===

Available icons
In addition, all abbreviations supported by Abb can be used to produce an icon for the corresponding game.