Module:Icon/data/doc
This is the documentation page for Module:Icon/data
This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing. |
This module stores icon data for Module:Icon.
Adding icons
To add a new icon, add a table in the following format:
<syntaxhighlight lang="lua"> code = { image = "My image name.xyz", tooltip = "My tooltip text", }, </syntaxhighlight>
If you want to add aliases for the code, use the following format instead: <syntaxhighlight lang="lua"> code = { aliases = {"alias1", "alias2"}, image = "My image name.xyz", tooltip = "My tooltip text", }, </syntaxhighlight>
If any of the text you add has double quotes in, you will need to escape it with backslashes like this: <syntaxhighlight lang="lua" class="" id="" style="" inline="1">"My \"quoted\" image.svg"</syntaxhighlight>.
Please make sure that any codes and aliases that you add don't match any existing codes or aliases. If they do, one of them will be overwritten with the other (and it's not possible to say for certain which will be overwritten with which).
You can omit the tooltip text if you want, but it is recommended that you add it.
Removing icons
Removing icons is fairly easy. Just remove the relevant entry from the data table. You can't remove the _DEFAULT entry, as Module:Icon relies on it being there.