Difference between revisions of "Template:Infobox person/height/doc"
imported>Zyxw (add links) |
imported>Zyxw (update usage and examples) |
||
| Line 9: | Line 9: | ||
== Usage == | == Usage == | ||
| + | |||
| + | <pre> | ||
| + | {{Infobox | ||
| + | ... | ||
| + | | label# = Height | ||
| + | | data# = {{#if: {{{height|}}} | {{Infobox person/height|{{{height}}}}} }} | ||
| + | ... | ||
| + | }} | ||
| + | </pre> | ||
| + | |||
| + | == Examples == | ||
[[Metre]]s: | [[Metre]]s: | ||
| − | * | + | |
| − | * | + | * {{Para|height|1 metre}} → {{Infobox person/height|1 metre}} |
| − | * | + | * {{Para|height|1meter}} → {{Infobox person/height|1meter}} |
| − | * | + | * {{Para|height|1&nbsp;meter}} → {{Infobox person/height|1 meter}} |
| − | * | + | * {{Para|height|1.57 metres}} → {{Infobox person/height|1.57 metres}} |
| − | * | + | * {{Para|height|1.57 meters}} → {{Infobox person/height|1.57 meters}} |
| − | * | + | * {{Para|height|1.57 m}} → {{Infobox person/height|1.57 m}} |
| + | * {{Para|height|1.57 ms}} → {{Infobox person/height|1.57 ms}} | ||
[[Centimetre]]s: | [[Centimetre]]s: | ||
| − | * | + | |
| − | * | + | * {{Para|height|1 centimetre}} → {{Infobox person/height|1 centimetre}} |
| − | * | + | * {{Para|height|1centimeter}} → {{Infobox person/height|1centimeter}} |
| − | * | + | * {{Para|height|1&nbsp;centimeter}} → {{Infobox person/height|1 centimeter}} |
| − | * | + | * {{Para|height|157 centimetres}} → {{Infobox person/height|157 centimetres}} |
| − | * | + | * {{Para|height|157 centimeters}} → {{Infobox person/height|157 centimeters}} |
| − | * | + | * {{Para|height|157 cm}} → {{Infobox person/height|157 cm}} |
| + | * {{Para|height|157 cms}} → {{Infobox person/height|157 cms}} | ||
[[Foot (unit)|Feet]]: | [[Foot (unit)|Feet]]: | ||
| − | * | + | |
| − | * | + | * {{Para|height|1 foot}} → {{Infobox person/height|1 foot}} |
| − | * | + | * {{Para|height|2 feet}} → {{Infobox person/height|2 feet}} |
| + | * {{Para|height|2 ft}} → {{Infobox person/height|2 ft}} | ||
[[Inch]]es: | [[Inch]]es: | ||
| − | * | + | |
| − | * | + | * {{Para|height|1 inch}} → {{Infobox person/height|1 inch}} |
| − | * | + | * {{Para|height|2 inches}} → {{Infobox person/height|2 inches}} |
| − | * | + | * {{Para|height|2 in}} → {{Infobox person/height|2 in}} |
| + | * {{Para|height|2 ins}} → {{Infobox person/height|2 ins}} | ||
[[Human height|Feet and inches]]: | [[Human height|Feet and inches]]: | ||
| − | |||
| − | |||
| − | |||
| − | + | * {{Para|height|5 feet 2 inches}} → {{Infobox person/height|5 feet 2 inches}} | |
| − | * | + | * {{Para|height|5feet 2inches}} → {{Infobox person/height|5feet 2inches}} |
| − | * | + | * {{Para|height|5&nbsp;feet 2&nbsp;inches}} → {{Infobox person/height|5 feet 2 inches}} |
| − | + | ||
| − | * | + | Text and/or [[Help:Footnotes|footnotes (references)]] after height: |
| + | |||
| + | * {{Para|height|5 feet 2 inches (2012)}} → {{Infobox person/height|5 feet 2 inches (2012)}} | ||
| + | * {{Para|height|5 feet 2 inches<nowiki><ref>citation goes here</ref></nowiki>}} → {{Infobox person/height|5 feet 2 inches<ref>citation goes here</ref>}} | ||
| + | * {{Para|height|5 feet 2 inches (2012)<nowiki><ref>{{cite news|title=title|work=work}}</ref></nowiki>}} → {{Infobox person/height|5 feet 2 inches (2012)<ref>{{cite news|title=title|work=work}}</ref>}} | ||
| + | : '''Example references''' | ||
<references /> | <references /> | ||
| − | {{tl|Convert}} templates | + | {{tl|Convert}} templates, without and with [[wikilink]]ed unit names: |
| − | * | + | |
| − | * | + | * {{Para|height|<nowiki>{{Convert|5|ft|2|in|cm|abbr=off}}</nowiki>}} → {{Infobox person/height|{{Convert|5|ft|2|in|cm|abbr=off}}}} |
| − | * | + | * {{Para|height|<nowiki>{{Convert|5|ft|2|in|cm|abbr=off|lk=on}}</nowiki>}} → {{Infobox person/height|{{Convert|5|ft|2|in|cm|abbr=off|lk=on}}}} |
| − | * | + | ** {{nowiki template demo|format=inline|prefix=output of convert template: |showcode=no|output=nowiki|code=<nowiki>{{Convert|5|ft|2|in|cm|abbr=off|lk=on}}</nowiki>}} |
| − | * < | + | * {{Para|height|<nowiki>{{Convert|5|ft|2|in|abbr=off}}</nowiki>}} → {{Infobox person/height|{{Convert|5|ft|2|in|abbr=off}}}} |
| − | * | + | * {{Para|height|<nowiki>{{Convert|5|ft|2|in|abbr=off|lk=on}}</nowiki>}} → {{Infobox person/height|{{Convert|5|ft|2|in|abbr=off|lk=on}}}} |
| − | * | + | ** {{nowiki template demo|format=inline|prefix=output of convert template: |showcode=no|output=nowiki|code=<nowiki>{{Convert|5|ft|2|in|abbr=off|lk=on}}</nowiki>}} |
| − | * | + | * {{Para|height|<nowiki>{{Convert|157|cm|ftin|abbr=off}}</nowiki>}} → {{Infobox person/height|{{Convert|157|cm|ftin|abbr=off}}}} |
| + | * {{Para|height|<nowiki>{{Convert|157|cm|ftin|abbr=off|lk=on}}</nowiki>}} → {{Infobox person/height|{{Convert|157|cm|ftin|abbr=off|lk=on}}}} | ||
| + | ** {{nowiki template demo|format=inline|prefix=output of convert template: |showcode=no|output=nowiki|code=<nowiki>{{Convert|157|cm|ftin|abbr=off|lk=on}}</nowiki>}} | ||
| + | * {{Para|height|<nowiki>{{Convert|1.57|m|abbr=off}}</nowiki>}} → {{Infobox person/height|{{Convert|1.57|m|abbr=off}}}} | ||
| + | * {{Para|height|<nowiki>{{Convert|1.57|m|abbr=off|lk=on}}</nowiki>}} → {{Infobox person/height|{{Convert|1.57|m|abbr=off|lk=on}}}} | ||
| + | ** {{nowiki template demo|format=inline|prefix=output of convert template: |showcode=no|output=nowiki|code=<nowiki>{{Convert|1.57|m|abbr=off|lk=on}}</nowiki>}} | ||
== Exceptions == | == Exceptions == | ||
| Line 65: | Line 87: | ||
Does not replace numbers in manually entered conversions, but does replace unit names with abbreviations (examples intentionally show incorrect conversions): | Does not replace numbers in manually entered conversions, but does replace unit names with abbreviations (examples intentionally show incorrect conversions): | ||
| − | * | + | * {{Para|height|5 feet 2 inches (1.00 metres)}} → {{Infobox person/height|5 feet 2 inches (1.00 metres)}} |
| − | * | + | * {{Para|height|5 feet 2 inches (100 centimetres)}} → {{Infobox person/height|5 feet 2 inches (100 centimetres)}} |
| − | * | + | * {{Para|height|1.57 metres (5 feet 5 inches)}} → {{Infobox person/height|1.57 metres (5 feet 5 inches)}} |
| − | * | + | * {{Para|height|157 centimetres (5 feet 5 inches)}} → {{Infobox person/height|157 centimetres (5 feet 5 inches)}} |
Does not replace numeric output of conversion templates such as {{tl|convert}} or {{tl|height}}, but does replace unit names with abbreviations (examples have different precision than usual): | Does not replace numeric output of conversion templates such as {{tl|convert}} or {{tl|height}}, but does replace unit names with abbreviations (examples have different precision than usual): | ||
| − | * | + | * {{Para|height|<nowiki>{{Convert|5|ft|2|in|m|3|abbr=off}}</nowiki>}} → {{Infobox person/height|{{Convert|5|ft|2|in|m|3|abbr=off}}}} |
** output of convert template: {{Convert|5|ft|2|in|m|3|abbr=off}} | ** output of convert template: {{Convert|5|ft|2|in|m|3|abbr=off}} | ||
| − | * | + | * {{Para|height|<nowiki>{{Convert|5|ft|2|in|cm|sigfig=4|abbr=off}}</nowiki>}} → {{Infobox person/height|{{Convert|5|ft|2|in|cm|sigfig=4|abbr=off}}}} |
** output of convert template: {{Convert|5|ft|2|in|cm|sigfig=4|abbr=off}} | ** output of convert template: {{Convert|5|ft|2|in|cm|sigfig=4|abbr=off}} | ||
| − | * | + | * {{Para|height|<nowiki>{{Convert|1.57|m|ftin|1|abbr=off}}</nowiki>}} → {{Infobox person/height|{{Convert|1.57|m|ftin|1|abbr=off}}}} |
** output of convert template: {{Convert|1.57|m|ftin|1|abbr=off}} | ** output of convert template: {{Convert|1.57|m|ftin|1|abbr=off}} | ||
| − | * | + | * {{Para|height|<nowiki>{{Convert|157|cm|ftin|1|abbr=off}}</nowiki>}} → {{Infobox person/height|{{Convert|157|cm|ftin|1|abbr=off}}}} |
** output of convert template: {{Convert|157|cm|ftin|1|abbr=off}} | ** output of convert template: {{Convert|157|cm|ftin|1|abbr=off}} | ||
| − | * | + | * {{Para|height|<nowiki>{{Height|m=1.57|frac=4|abbr=no}}</nowiki>}} → {{Infobox person/height|{{Height|m=1.57|frac=4|abbr=no}}}} |
| − | ** output of | + | ** output of height template: {{Height|m=1.57|frac=4|abbr=no}} |
| − | * | + | * {{Para|height|<nowiki>{{Height|cm=157|frac=4|abbr=no}}</nowiki>}} → {{Infobox person/height|{{Height|cm=157|frac=4|abbr=no}}}} |
| − | ** output of | + | ** output of height template: {{Height|cm=157|frac=4|abbr=no}} |
Period at end of abbreviation displays after the conversion: | Period at end of abbreviation displays after the conversion: | ||
| − | * | + | * {{Para|height|1.52 m.}} → {{Infobox person/height|1.52 m.}} |
| − | * | + | * {{Para|height|152 cm.}} → {{Infobox person/height|152 cm.}} |
| − | * | + | * {{Para|height|5 ft.}} → {{Infobox person/height|5 ft.}} |
| − | * | + | * {{Para|height|60 in.}} → {{Infobox person/height|60 in.}} |
| − | * | + | * {{Para|height|5 ft 0 in.}} → {{Infobox person/height|5 ft 0 in.}} |
| − | Multiple unit conversions | + | Multiple unit conversions don't work if input contains periods or commas: |
| − | * | + | * {{Para|height|5 ft. 2 in}} → {{Infobox person/height|5 ft. 2 in}} |
| − | * | + | * {{Para|height|5 ft, 2 in}} → {{Infobox person/height|5 ft, 2 in}} |
Does not recognize symbols for feet and inches: | Does not recognize symbols for feet and inches: | ||
| − | * | + | * {{Para|height|5' 2"}} → {{Infobox person/height|5' 2"}} |
| − | * | + | * {{Para|height|5′ 2″}} → {{Infobox person/height|5′ 2″}} |
| − | * | + | * {{Para|height|157cm (5' 2")}} → {{Infobox person/height|157cm (5' 2")}} |
| − | * | + | * {{Para|height|157cm (5′ 2″)}} → {{Infobox person/height|157cm (5′ 2″)}} |
| − | * | + | * {{Para|height|1.57m (5' 2")}} → {{Infobox person/height|1.57m (5' 2")}} |
| − | * | + | * {{Para|height|1.57m (5′ 2″)}} → {{Infobox person/height|1.57m (5′ 2″)}} |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
<includeonly>{{Sandbox other|| | <includeonly>{{Sandbox other|| | ||
Revision as of 08:25, 25 May 2020
| This is a documentation subpage for Template:Infobox person/height. It contains usage information, categories and other content that is not part of the original template page. |
| This is for use in templates. For articles, please use {{Convert}} or {{Height}}. |
| This template uses Lua: |
This template is used to automatically add conversions of height measurements displayed by Template:Infobox person and other infoboxes with a |height= parameter.
Usage
{{Infobox
...
| label# = Height
| data# = {{#if: {{{height|}}} | {{Infobox person/height|{{{height}}}}} }}
...
}}
Examples
|height=1 metre→ 1 m (3 ft 3 in)|height=1meter→ 1 m (3 ft 3 in)|height=1 meter→ 1 m (3 ft 3 in)|height=1.57 metres→ 1.57 m (5 ft 2 in)|height=1.57 meters→ 1.57 m (5 ft 2 in)|height=1.57 m→ 1.57 m (5 ft 2 in)|height=1.57 ms→ 1.57 m (5 ft 2 in)
|height=1 centimetre→ 1 cm (0 in)|height=1centimeter→ 1 cm (0 in)|height=1 centimeter→ 1 cm (0 in)|height=157 centimetres→ 157 cm (5 ft 2 in)|height=157 centimeters→ 157 cm (5 ft 2 in)|height=157 cm→ 157 cm (5 ft 2 in)|height=157 cms→ 157 cm (5 ft 2 in)
Feet:
|height=1 foot→ 1 ft (30 cm)|height=2 feet→ 2 ft (61 cm)|height=2 ft→ 2 ft (61 cm)
|height=1 inch→ 1 in (3 cm)|height=2 inches→ 2 in (5 cm)|height=2 in→ 2 in (5 cm)|height=2 ins→ 2 in (5 cm)
|height=5 feet 2 inches→ 5 ft 2 in (157 cm)|height=5feet 2inches→ 5 ft 2 in (157 cm)|height=5 feet 2 inches→ 5 ft 2 in (157 cm)
Text and/or footnotes (references) after height:
|height=5 feet 2 inches (2012)→ 5 ft 2 in (157 cm) (2012)|height=5 feet 2 inches<ref>citation goes here</ref>→ 5 ft 2 in (157 cm)[1]|height=5 feet 2 inches (2012)<ref>{{cite news|title=title|work=work}}</ref>→ 5 ft 2 in (157 cm) (2012)[2]
- Example references
{{Convert}} templates, without and with wikilinked unit names:
|height={{Convert|5|ft|2|in|cm|abbr=off}}→ 5 ft 2 in (157 cm)|height={{Convert|5|ft|2|in|cm|abbr=off|lk=on}}→ 5 ft 2 in (157 cm)|height={{Convert|5|ft|2|in|abbr=off}}→ 5 ft 2 in (1.57 m)|height={{Convert|5|ft|2|in|abbr=off|lk=on}}→ 5 ft 2 in (1.57 m)|height={{Convert|157|cm|ftin|abbr=off}}→ 157 cm (5 ft 2 in)|height={{Convert|157|cm|ftin|abbr=off|lk=on}}→ 157 cm (5 ft 2 in)|height={{Convert|1.57|m|abbr=off}}→ 1.57 m (5 ft 2 in)|height={{Convert|1.57|m|abbr=off|lk=on}}→ 1.57 m (5 ft 2 in)
Exceptions
Does not replace numbers in manually entered conversions, but does replace unit names with abbreviations (examples intentionally show incorrect conversions):
|height=5 feet 2 inches (1.00 metres)→ 5 ft 2 in (1.00 m)|height=5 feet 2 inches (100 centimetres)→ 5 ft 2 in (100 cm)|height=1.57 metres (5 feet 5 inches)→ 1.57 m (5 ft 5 in)|height=157 centimetres (5 feet 5 inches)→ 157 cm (5 ft 5 in)
Does not replace numeric output of conversion templates such as {{convert}} or {{height}}, but does replace unit names with abbreviations (examples have different precision than usual):
|height={{Convert|5|ft|2|in|m|3|abbr=off}}→ 5 ft 2 in (1.575 m)- output of convert template: 5 feet 2 inches (1.575 metres)
|height={{Convert|5|ft|2|in|cm|sigfig=4|abbr=off}}→ 5 ft 2 in (157.5 cm)- output of convert template: 5 feet 2 inches (157.5 centimetres)
|height={{Convert|1.57|m|ftin|1|abbr=off}}→ 1.57 m (5 ft 1.8 in)- output of convert template: 1.57 metres (5 feet 1.8 inches)
|height={{Convert|157|cm|ftin|1|abbr=off}}→ 157 cm (5 ft 1.8 in)- output of convert template: 157 centimetres (5 feet 1.8 inches)
|height={{Height|m=1.57|frac=4|abbr=no}}→ 1.57 m (5 ft 1 3⁄4 in)- output of height template: 1.57 metres (5 feet 1 3⁄4 inches)
|height={{Height|cm=157|frac=4|abbr=no}}→ 157 cm (5 ft 1 3⁄4 in)- output of height template: 157 centimetres (5 feet 1 3⁄4 inches)
Period at end of abbreviation displays after the conversion:
|height=1.52 m.→ 1.52 m (5 ft 0 in)|height=152 cm.→ 152 cm (5 ft 0 in)|height=5 ft.→ 5 ft (152 cm)|height=60 in.→ 60 in (152 cm)|height=5 ft 0 in.→ 5 ft 0 in (152 cm)
Multiple unit conversions don't work if input contains periods or commas:
|height=5 ft. 2 in→ 5 ft 2 in (157 cm)|height=5 ft, 2 in→ 5 ft 2 in (157 cm)
Does not recognize symbols for feet and inches:
|height=5' 2"→ 5' 2"|height=5′ 2″→ 5′ 2″|height=157cm (5' 2")→ 157 cm (5 ft 2 in) (5' 2")|height=157cm (5′ 2″)→ 157 cm (5 ft 2 in) (5′ 2″)|height=1.57m (5' 2")→ 1.57 m (5 ft 2 in) (5' 2")|height=1.57m (5′ 2″)→ 1.57 m (5 ft 2 in) (5′ 2″)