Difference between revisions of "Template:Hair space/doc"

From blackwiki
Jump to navigation Jump to search
imported>Frietjes
imported>Funandtrvl
(→‎See also: already in navbox)
 
(28 intermediate revisions by 13 users not shown)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
 
<!-- Categories at the bottom of this page, please; interwikis at Wikidata. -->
 
<!-- Categories at the bottom of this page, please; interwikis at Wikidata. -->
 +
{{Template shortcut|hsp|hairsp|px1}}
  
{{tl|Hsp}} produces the "hair space" character ([[Unicode]] hexadecimal alias {{border|&amp;#x200A;}}{{\}}{{border|U+200A}}), a space character that is slightly thinner than the "[[thin space]]" character (see below and [[Whitespace character]]).
+
{{tl|Hair space}} produces the [[Unicode]] character {{unichar|200a|hair space|html=|nlink=}}, a space character that is slightly thinner than the [[thin space]]character (see below and [[Whitespace character]]). It is forced to be non-breaking, since this is the desired behavior in most uses of this template. If a parameter is supplied, it is sandwiched on both sides with hair space characters (only the first is non-breaking).
  
The template may be used with or without a parameter. If used with a parameter &endash;&nbsp;i.e. as {{tlf|hsp|''[some text/content]''}}&nbsp;&endash; it adds a hair space before and after it.
+
==Comparisons==
 +
{{Space comparison}}
  
===Comparisons===
+
==TemplateData==
{| class="wikitable"
+
{{TemplateData header}}
|-
+
<templatedata>
! Name / size      || →Instance← || {{sans-serif|Example code and ...}}               || output
+
{
|-
+
"params": {
| ''none''          || →←        || <nowiki>Some text<ref>...</ref></nowiki>          || Some text{{fake ref}}
+
"1": {
|-
+
"label": "text to wrap in hair-spaces",
| Hair              || →{{hsp}}←  || <nowiki>Some text{{hsp}}<ref>...</ref></nowiki>    || Some text{{hsp}}{{fake ref}}
+
"description": "optional word to surround with hair spaces",
|-
+
"type": "line"
| Thin              || →{{tsp}}←  || <nowiki>Some text{{tsp}}<ref>...</ref></nowiki>    || Some text{{tsp}}{{fake ref}}
+
},
|-
+
"before": {
| Standard{{sup|a}} || →&nbsp;←  || <nowiki>Some text&amp;nbsp;<ref>...</ref></nowiki> || Some text&nbsp;{{fake ref}}
+
"label": "optional text before",
|-
+
"description": "optional word before the hair spaced param 1",
|}{{raise|{{smaller|&nbsp;{{sup|a}} Provided here by a [[non-breaking space]] ({{mono|105%|&amp;nbsp;}}).}}}}
+
"type": "line"
 +
},
 +
"after": {
 +
"label": "optional text after",
 +
"description": "optional word or text after the hair-spaced text",
 +
"type": "line"
 +
}
 +
},
 +
"description": "Inserts a very thin \"hair space\" unicode character, if no parameters are provided. If {{para|1}} is, that text is wrapped on each side with a hair space.",
 +
"format": "inline"
 +
}
 +
</templatedata>
  
===See also===
+
==See also==
{{colbegin||10em}}
+
{{Inline spacing templates}}
* {{tl|px1}}
 
* {{tl|px2}}
 
* {{tl|thinsp}}
 
* {{tl|sp}}
 
* {{tl|nbsp}}
 
* {{tl|space}}
 
* {{tl|nwsp}}
 
* {{tl|zwnbsp}}
 
{{colend}}
 
  
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox |
+
<includeonly>{{Sandbox other|
 
| <!-- Categories below this line, please: -->
 
| <!-- Categories below this line, please: -->
 
[[Category:Inline spacing templates]]
 
[[Category:Inline spacing templates]]
 +
[[Category:Character templates]]
 
}}</includeonly>
 
}}</includeonly>

Latest revision as of 19:35, 10 September 2020

{{Hair space}} produces the Unicode character Template:Unichar, a space character that is slightly thinner than the “thin space” character (see below and Whitespace character). It is forced to be non-breaking, since this is the desired behavior in most uses of this template. If a parameter is supplied, it is sandwiched on both sides with hair space characters (only the first is non-breaking).

Comparisons

Template:Space comparison

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.

TemplateData for Hair space

Inserts a very thin "hair space" unicode character, if no parameters are provided. If {{para|1}} is, that text is wrapped on each side with a hair space.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
text to wrap in hair-spaces1

optional word to surround with hair spaces

Lineoptional
optional text beforebefore

optional word before the hair spaced param 1

Lineoptional
optional text afterafter

optional word or text after the hair-spaced text

Lineoptional

See also