Template:Dash/doc: Difference between revisions
Jump to navigation
Jump to search
ArrowHead294 (talk | contribs) Created page with "<includeonly><hr><small>Documentation transcluded from /doc</small></includeonly> This template converts a sequence separated by spaces into one separated by dashes. ===..." |
ArrowHead294 (talk | contribs) mNo edit summary |
||
Line 10: | Line 10: | ||
! You get | ! You get | ||
|- | |- | ||
| <code> | | <code>s=</code> | ||
| rowspan="2" | Regular space | | rowspan="2" | Regular space | ||
|- | |- | ||
| <code> | | <code>s=space</code> | ||
|- | |- | ||
| <code> | | <code>s=thin</code> | ||
| Thin space (U+2009 <span style="font-size: 10px;">THIN SPACE</span>) | | Thin space (U+2009 <span style="font-size: 10px;">THIN SPACE</span>) | ||
|- | |- | ||
| <code> | | <code>s=hair</code> | ||
| Hair space (U+200A <span style="font-size: 10px;">HAIR SPACE</span>) | | Hair space (U+200A <span style="font-size: 10px;">HAIR SPACE</span>) | ||
|} | |} | ||
Line 28: | Line 28: | ||
! You get | ! You get | ||
|- | |- | ||
| <code> | | <code>d=</code> | ||
| <span>-</span> | | rowspan="2" | <span>-</span> | ||
|- | |- | ||
| <code> | | <code>d=short</code> | ||
|- | |||
| <code>d=long</code> | |||
| Em dash (U+2014 — <span style="font-size: 10px;">EM DASH</span>) | | Em dash (U+2014 — <span style="font-size: 10px;">EM DASH</span>) | ||
|- | |- | ||
| <code> | | <code>d=med</code> | ||
| En dash (U+2013 – <span style="font-size: 10px;">EN DASH</span>) | | En dash (U+2013 – <span style="font-size: 10px;">EN DASH</span>) | ||
|} | |} | ||
Line 43: | Line 45: | ||
! You get | ! You get | ||
|- | |- | ||
| <syntaxhighlight lang="text">{{dash|A, B, C, D, E, F, G, H| | | <syntaxhighlight lang="text">{{dash|A, B, C, D, E, F, G, H|s=space|d=mdash}}</syntaxhighlight> | ||
| {{dash|A, B, C, D, E, F, G, H| | | {{dash|A, B, C, D, E, F, G, H|s=space|d=mdash}} | ||
|- | |- | ||
| <syntaxhighlight lang="text">{{dash|A, B, C, D, E, F, G, H| | | <syntaxhighlight lang="text">{{dash|A, B, C, D, E, F, G, H|s=thin|d=mdash}}</syntaxhighlight> | ||
| {{dash|A, B, C, D, E, F, G, H| | | {{dash|A, B, C, D, E, F, G, H|s=thin|d=mdash}} | ||
|- | |- | ||
| <syntaxhighlight lang="text">{{dash|A, B, C, D, E, F, G, H| | | <syntaxhighlight lang="text">{{dash|A, B, C, D, E, F, G, H|s=hair|d=mdash}}</syntaxhighlight> | ||
| {{dash|A, B, C, D, E, F, G, H| | | {{dash|A, B, C, D, E, F, G, H|s=hair|d=mdash}} | ||
|- | |- | ||
| <syntaxhighlight lang="text">{{dash|A, B, C, D, E, F, G, H| | | <syntaxhighlight lang="text">{{dash|A, B, C, D, E, F, G, H|s=space|d=ndash}}</syntaxhighlight> | ||
| {{dash|A, B, C, D, E, F, G, H| | | {{dash|A, B, C, D, E, F, G, H|s=space|d=ndash}} | ||
|- | |- | ||
| <syntaxhighlight lang="text">{{dash|A, B, C, D, E, F, G, H| | | <syntaxhighlight lang="text">{{dash|A, B, C, D, E, F, G, H|s=thin|d=ndash}}</syntaxhighlight> | ||
| {{dash|A, B, C, D, E, F, G, H| | | {{dash|A, B, C, D, E, F, G, H|s=thin|d=ndash}} | ||
|- | |- | ||
| <syntaxhighlight lang="text">{{dash|A, B, C, D, E, F, G, H| | | <syntaxhighlight lang="text">{{dash|A, B, C, D, E, F, G, H|s=hair|d=ndash}}</syntaxhighlight> | ||
| {{dash|A, B, C, D, E, F, G, H| | | {{dash|A, B, C, D, E, F, G, H|s=hair|d=ndash}} | ||
|- | |- | ||
| <syntaxhighlight lang="text">{{dash|A, B, C, D, E, F, G, H| | | <syntaxhighlight lang="text">{{dash|A, B, C, D, E, F, G, H|s=space|d=}}</syntaxhighlight> | ||
| {{dash|A, B, C, D, E, F, G, H| | | {{dash|A, B, C, D, E, F, G, H|s=space|d=}} | ||
|- | |- | ||
| <syntaxhighlight lang="text">{{dash|A, B, C, D, E, F, G, H| | | <syntaxhighlight lang="text">{{dash|A, B, C, D, E, F, G, H|s=thin|d=}}</syntaxhighlight> | ||
| {{dash|A, B, C, D, E, F, G, H| | | {{dash|A, B, C, D, E, F, G, H|s=thin|d=}} | ||
|- | |- | ||
| <syntaxhighlight lang="text">{{dash|A, B, C, D, E, F, G, H| | | <syntaxhighlight lang="text">{{dash|A, B, C, D, E, F, G, H|s=hair|d=}}</syntaxhighlight> | ||
| {{dash|A, B, C, D, E, F, G, H| | | {{dash|A, B, C, D, E, F, G, H|s=hair|d=}} | ||
|} | |} | ||
<noinclude>[[Category:Template documentation]]</noinclude> | <noinclude>[[Category:Template documentation]]</noinclude> |
Revision as of 01:36, 13 May 2024
This template converts a sequence separated by spaces into one separated by dashes.
Usage
The list to be converted is passed as one unnamed argument, using a comma and one or more spaces (,
) as the separator.
To adjust spacing between list elements and dashes, use the spaces
parameter (defaults to the regular space character).
You pass | You get |
---|---|
s=
|
Regular space |
s=space
| |
s=thin
|
Thin space (U+2009 THIN SPACE) |
s=hair
|
Hair space (U+200A HAIR SPACE) |
The dash used can be the regular hyphen-minus, an em dash, or an en dash. This is done with the sep
parameter.
You pass | You get |
---|---|
d=
|
- |
d=short
| |
d=long
|
Em dash (U+2014 — EM DASH) |
d=med
|
En dash (U+2013 – EN DASH) |
Examples
You type | You get |
---|---|
{{dash|A, B, C, D, E, F, G, H|s=space|d=mdash}}
|
A - B - C - D - E - F - G - H |
{{dash|A, B, C, D, E, F, G, H|s=thin|d=mdash}}
|
A - B - C - D - E - F - G - H |
{{dash|A, B, C, D, E, F, G, H|s=hair|d=mdash}}
|
A - B - C - D - E - F - G - H |
{{dash|A, B, C, D, E, F, G, H|s=space|d=ndash}}
|
A - B - C - D - E - F - G - H |
{{dash|A, B, C, D, E, F, G, H|s=thin|d=ndash}}
|
A - B - C - D - E - F - G - H |
{{dash|A, B, C, D, E, F, G, H|s=hair|d=ndash}}
|
A - B - C - D - E - F - G - H |
{{dash|A, B, C, D, E, F, G, H|s=space|d=}}
|
A - B - C - D - E - F - G - H |
{{dash|A, B, C, D, E, F, G, H|s=thin|d=}}
|
A - B - C - D - E - F - G - H |
{{dash|A, B, C, D, E, F, G, H|s=hair|d=}}
|
A - B - C - D - E - F - G - H |