Module:Storm categories/doc: Difference between revisions

Content deleted Content added
doc new func
update docs
Line 1:
{{Module rating|beta}}
{{ombox|text=In order to conform to [[Wikipedia:Manual of Style/Accessibility#Color]] guidelines, do not use these colors in conjunction with links. This is necessary to avoid problems related to lack of contrast.}}
This template is used to control a multitude of tropical cyclone-related templates: {{t|storm colour}}, {{t|tc nom list}}, {{t|storm sortkey}}, and {{t|tropical cyclone status icons}}. It acts as a centralized ___location for storm categories to avoid discrepancies between templates, allowing for the same ID to be used across all related templates.
 
Data is located in the following submodules:
* [[Module:Tropical cyclone categories/categories]] for fully-detailed storm categories
* [[Module:Tropical cyclone categories/colors]] for color-only IDs
* [[Module:Tropical cyclone categories/icons]] for icon-only IDs
 
== Usage ==
This module exports three functions for templates: <code>p.color</code>, <code>p.name</code>, <code>p.sortkey</code>, and <code>p.icon</code>. It also provides <code>p._color</code>, <code>p._name</code>, <code>p._sortkey</code>, and <code>p._icon</code> for use in other modules.
Line 40 ⟶ 47:
The sortkey is a number that aids in sorting categories. Using the sortkey, it is possible to automatically sort a table of tropical cyclones given their category code. Due to the ambiguous nature of sortkeys, tables may be sorted incorrectly if values from other basins were used. For categories that span multiple basins, however, (e.g. <code>depression</code> and <code>storm</code>) they are given the lowest possible sortkeys in order to achieve maximum compatibility.
 
{{#ifeq:{{BASEPAGENAME}}|Tropical cyclone categories|
This sortkey is used in {{T|storm sortkey}} and {{T|Tropical cyclone season effects (cyclone)}}, a subtemplate of {{T|Tropical cyclone season effects}}.
}}
 
The sortkey format is as follows. Note that not all values between the given ranges were used. The arrangement of these were determined by their positions in the {{T|Storm colour}} template.