Template:Species link/doc: Difference between revisions

From Against the Storm Official Wiki
(Refactored the documentation into a subpage)
 
(updating documentation to reflect parameter name standardization)
 
(2 intermediate revisions by the same user not shown)
Line 24: Line 24:
! Parameter !! Type !! Description
! Parameter !! Type !! Description
|-
|-
| iconsize || string || one of the following: <code>small</code>, <code>medium</code>, <code>large</code>, <code>huge</code>. You may also write <code>none</code> to skip the icon. The default is <code>small</code>, which is text-height for use in paragraphs. If you do not name this parameter, it must come second.
| size || string || The size of the icon to display. Choose one of the following:
* <code>none</code>
* <code>small</code>
* <code>medium</code>
* <code>large</code>
* <code>huge</code>
The default is <code>small</code>, which is text-height for use in paragraphs. If you do not name this parameter with <code>size=</code>, it must come second.
|-
|-
| display || string || if you include <code>display=notext</code>, only the icon will be rendered. There are currently no other options for this parameter.
| display || string || if you include <code>display=notext</code>, only the icon will be rendered. There are currently no other options for this parameter.
Line 37: Line 43:




<pre>{{Species link|human|iconsize=medium}}</pre>
<pre>{{Species link|human|size=medium}}</pre>
Yields a slightly larger icon, suitable for easy recognition in tables:
Yields a slightly larger icon, suitable for easy recognition in tables:


{{Species link|human|iconsize=medium}}
{{Species link|human|size=medium}}




Line 50: Line 56:
=== Other examples ===
=== Other examples ===


<pre>{{Species link|species=Harpy|iconsize=small|display=notext}}</pre>
<pre>{{Species link|species=Harpy|size=small|display=notext}}</pre>
Yields just a linked icon {{Species link|species=Harpy|iconsize=small|display=notext}} for the Harpies. Use this sparingly, because it is not as accessible, and in paragraphs the icons can be hard to distinguish. This is good in tables where the icon functions as a reminder than an important factor. An example where this is useful is in the infoboxes of buildings which feature specialization as an important factor, and the species icon is shown next to the specialization as just a quick reminder.
Yields just a linked icon {{Species link|species=Harpy|size=small|display=notext}} for the Harpies. Use this sparingly, because it is not as accessible, and in paragraphs the icons can be hard to distinguish. This is good in tables where the icon functions as a reminder than an important factor. An example where this is useful is in the infoboxes of buildings which feature specialization as an important factor, and the species icon is shown next to the specialization as just a quick reminder.


<pre>{{Species link|Foxes|iconsize=gigantic}}</pre>
 
Providing an icon size that is not recognized does not return an error. Instead, the template shows the default, small icon size: {{Species link|Foxes|iconsize=gigantic}}
<pre>{{Species link|human|none}}</pre>
Yields just the text link, {{Species link|human|none}}, suitable for when mentioning more than one time in the same paragraph to avoid cluttering the paragraph with icons. (This is preferable to using a regular wiki link, so the styling matches, even if it appears to have the same styling right now.)
 
 
<pre>{{Species link|Foxes|size=gigantic}}</pre>
Providing an icon size that is not recognized does not return an error. Instead, the template shows the default, small icon size: {{Species link|Foxes|size=gigantic}}


=== Errors ===
=== Errors ===

Latest revision as of 02:38, 15 October 2024

Overview

Creates a link to a species' page.

Parameters

Species

The name of the species is the only required parameter. Use the name of the species as it appears in game. A missing or misspelled species name will result in an error.

If you do not wish to write the code species=, you may skip that, but you must specify the name of the species before any other parameters.

Parameter Type Description
species string The name of the species, as it appears in the game, either singular or plural.

Output overrides

All of these parameters are optional and change how the link is formatted.

Parameter Type Description
size string The size of the icon to display. Choose one of the following:
  • none
  • small
  • medium
  • large
  • huge

The default is small, which is text-height for use in paragraphs. If you do not name this parameter with size=, it must come second.

display string if you include display=notext, only the icon will be rendered. There are currently no other options for this parameter.

Examples

Basic usage

{{Species link|species=Humans}}

Yields Humans Humans, a text-height icon that flows well in paragraphs without impacting line height.


{{Species link|human|size=medium}}

Yields a slightly larger icon, suitable for easy recognition in tables:

Humans Humans


{{Species link|human|large}}

Yields a larger icon, suitable for tables featuring the species as an important factor:

Humans Humans

Other examples

{{Species link|species=Harpy|size=small|display=notext}}

Yields just a linked icon Harpies for the Harpies. Use this sparingly, because it is not as accessible, and in paragraphs the icons can be hard to distinguish. This is good in tables where the icon functions as a reminder than an important factor. An example where this is useful is in the infoboxes of buildings which feature specialization as an important factor, and the species icon is shown next to the specialization as just a quick reminder.


{{Species link|human|none}}

Yields just the text link, Humans, suitable for when mentioning more than one time in the same paragraph to avoid cluttering the paragraph with icons. (This is preferable to using a regular wiki link, so the styling matches, even if it appears to have the same styling right now.)


{{Species link|Foxes|size=gigantic}}

Providing an icon size that is not recognized does not return an error. Instead, the template shows the default, small icon size: Foxes Foxes

Errors

The following are error messages generated by calling the template incorrectly.

{{Species link}}

With no arguments: Lua error in Module:SpeciesLink at line 58: You must specify the name of the species. Please see the template documentation for how to use the parameters.

{{Species link|Centaurs}}

Naming a species that doesn't exist in the game: Lua error in Module:SpeciesLink at line 41: You specified an invalid species name. Please see the template documentation for how to use the parameters.