Munurin millum rættingarnar hjá "Module:Icon/data/doc"

Frá Wikipedia, hin frælsa alfrøðin
Content deleted Content added
Stovnaði síðu við "Hetta modulið goymir dáta fyri Module:Icon. == Adding icons == To add a new icon, add a table in the following format: <source lang="lua"> code = { image = "My..."
 
Xqbot (kjak | íkøst)
s Bot: Erstatt forældet <source> -tag og parameteren "enclose" [https://lists.wikimedia.org/pipermail/wikitech-ambassadors/2020-April/002284.html]
 
Linja 5: Linja 5:
To add a new icon, add a table in the following format:
To add a new icon, add a table in the following format:


<source lang="lua">
<syntaxhighlight lang="lua">
code = {
code = {
image = "My image name.xyz",
image = "My image name.xyz",
tooltip = "My tooltip text",
tooltip = "My tooltip text",
},
},
</syntaxhighlight>
</source>


If you want to add aliases for the code, use the following format instead:
If you want to add aliases for the code, use the following format instead:
<source lang="lua">
<syntaxhighlight lang="lua">
code = {
code = {
aliases = {"alias1", "alias2"},
aliases = {"alias1", "alias2"},
Linja 19: Linja 19:
tooltip = "My tooltip text",
tooltip = "My tooltip text",
},
},
</syntaxhighlight>
</source>


If any of the text you add has double quotes in, you will need to escape it with backslashes like this: {{code|"My \"quoted\" image.svg"|lua}}.
If any of the text you add has double quotes in, you will need to escape it with backslashes like this: {{code|"My \"quoted\" image.svg"|lua}}.

Seinasta endurskoðan sum var 22. apr 2020 kl. 16:37

Hetta modulið goymir dáta fyri Module:Icon.

Adding icons[rætta wikitekst]

To add a new icon, add a table in the following format:

	code = {
		image = "My image name.xyz",
		tooltip = "My tooltip text",
	},

If you want to add aliases for the code, use the following format instead:

	code = {
		aliases = {"alias1", "alias2"},
		image = "My image name.xyz",
		tooltip = "My tooltip text",
	},

If any of the text you add has double quotes in, you will need to escape it with backslashes like this:

"My \"quoted\" image.svg"

.

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[rætta wikitekst]

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.