Template:Dash/doc

From Xenharmonic Wiki
Jump to navigation Jump to search

This template converts a sequence separated by commas and spaces into one separated by dashes.

Parameters

{{{1}}}
Accepts one unnamed parameter, which is the list to be converted.
s
Specifies what space to be used. Can be set to the standard space, thin space, or hair ("extra thin") space.
d
Specifies what dash to use, with options for short, medium, and long dashes, plus left and right arrows.
d2
Second dash separator for bidirectional lists.

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)
s=nbsp Non-breaking space (U+00A0 NO-BREAK SPACE)
s=nnbsp Non-breaking space (U+202F NARROW NO-BREAK 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= Regular hyphen (U+002D - HYPHEN-MINUS)
d=short
d=long Em dash (U+2014 — EM DASH)
d=med En dash (U+2013 – EN DASH)
d=larr Left arrow (U+2190 ← LEFTWARDS ARROW)
d=rarr Right arrow (U+2192 → RIGHTWARDS ARROW)

Examples

You type You get
{{dash|A, B, C, D, E, F, G, H|s=space|d=long}}
A — B — C — D — E — F — G — H
{{dash|A, B, C, D, E, F, G, H|s=thin|d=long}}
A — B — C — D — E — F — G — H
{{dash|A, B, C, D, E, F, G, H|s=hair|d=long}}
A — B — C — D — E — F — G — H
{{dash|A, B, C, D, E, F, G, H|s=space|d=med}}
A – B – C – D – E – F – G – H
{{dash|A, B, C, D, E, F, G, H|s=thin|d=med}}
A – B – C – D – E – F – G – H
{{dash|A, B, C, D, E, F, G, H|s=hair|d=med}}
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
{{dash|F, C, G, D, A,, E,, B|s=hair|d=larr|d2=rarr}}
F ← C ← G ← D ← A → E → B

See also