Module:Convert/extra/doc: Difference between revisions

Content deleted Content added
No edit summary
 
(4 intermediate revisions by 4 users not shown)
Line 1:
{{high-use|212}}
This module can be used to quickly add a new unit for use with {{tl|convert}}. When satisfied that a unit is working correctly, ask at [[Module talk:Convert]] for the unit to be moved to the permanent list of units.
 
See [[Template:Convert/unit sandbox]] for a good way to prepare unit definitions that can be copied into this page.
 
The following extracts from [[Module:Convert/data]] show examples that could be used to define a new unit. Any number of spaces can be used where blanks are shown in the following.
 
{{collapse top|title=Examples for additions to <ttcode>Module:Convert/extra</ttcode> <small>{{nobold|1=(For the actual module code see [[#EndOfDoc|below]])</small>}}|bg=#CEF2E0|b-color=#A3BFB1|bg2=#F5FFFA|expand=true}}
 
<syntaxhighlight lang="lua" highlight="1">
-- These are EXAMPLES on the documentation page. Scroll down to see the module content.
Line 58 ⟶ 63:
-- {{convert|125|g/m3|lk=on|disp=unit}} → [[density|grams per cubic metre]]
["g/m3"] = {
per = { "g", "m3" },
utype = "density",
default = "lb/cuyd",
link = "density",
},
-- Characters "$" and "£" are recognized as currency symbols.
Line 89 ⟶ 94:
}
</syntaxhighlight>
 
{{collapse bottom}}
 
{| class="wikitable"
! Field !! Description
Line 115 ⟶ 122:
| <code>link</code> || Article title used when <code>lk=on</code> is in effect; not required if it is the same as <code>name1</code>.
|}
 
{{anchor|EndOfDoc}}
<noinclude>
[[Category:Module documentation pages]]
</noinclude>