[unchecked revision] | [unchecked revision] |
(Move doc from template page.) |
m (Improve documentation.) |
||
Line 1: | Line 1: | ||
{{doc/start}} | {{doc/start}} | ||
<templatedata> | |||
{ | |||
"params": { | |||
"abbr": { | |||
"label": "Unit abbreviation", | |||
"description": "Case sensitive abbreviation of a unit of measure. If the abbreviation contains a forward slash \"/\" it may be replaced with the character \"p\".", | |||
"example": "m/s, mps, GHz, ppm, kg, m2, kWh", | |||
"type": "string", | |||
"required": true | |||
} | |||
}, | |||
"description": "Add a tooltip to an abbreviation of a unit of measure showing the actual name of the unit.", | |||
"format": "inline", | |||
"paramOrder": [ | |||
"abbr" | |||
] | |||
} | |||
</templatedata> | |||
== Usage == | == Usage == | ||
{{tlx|Template Sandbox/Demian/Unit|''abbr''}} | |||
== New units == | |||
Recognized units are defined and documented in [[Module:Sandbox/Demian/Unit/data]]. | |||
== Examples == | == Examples == | ||
Line 23: | Line 45: | ||
|} | |} | ||
Note that the abbreviation is case sensitive and special symbols are | Note that the abbreviation is case sensitive and if the unit contains special symbols they are displayed correctly: | ||
{| class="wikitable" | {| class="wikitable" | ||
|+ Various units. | |+ Various units. | ||
Line 58: | Line 80: | ||
== Modules == | == Modules == | ||
This template is using the following Modules: | This template is using the following Modules: | ||
*[[Module:Sandbox/Demian/Unit]] | *[[Module:Sandbox/Demian/Unit]] | ||
{{doc/end}} | {{doc/end}} |
Revision as of 00:32, 26 February 2022
Add a tooltip to an abbreviation of a unit of measure showing the actual name of the unit.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Unit abbreviation | abbr | Case sensitive abbreviation of a unit of measure. If the abbreviation contains a forward slash "/" it may be replaced with the character "p".
| String | required |
Usage
{{Template Sandbox/Demian/Unit|abbr}}
New units
Recognized units are defined and documented in Module:Sandbox/Demian/Unit/data.
Examples
Note that the abbreviation is case sensitive and if the unit contains special symbols they are displayed correctly:
If a unit definition is not found, the abbreviation (or text) is returned unchanged.
Code | Result |
---|---|
{{Template Sandbox/Demian/Unit|things}} |
Template:Template Sandbox/Demian/Unit |
{{Template Sandbox/Demian/Unit|something/other}} |
Template:Template Sandbox/Demian/Unit |
{{Template Sandbox/Demian/Unit|players per hour}} |
Template:Template Sandbox/Demian/Unit |
Modules
This template is using the following Modules: