Template:·/doc: Difference between revisions
m ar link |
m Text replacement - "\[\[Category:([^|]+)\|{{PAGENAME}}\]\]" to "Category:$1" |
||
(57 intermediate revisions by 39 users not shown) | |||
Line 1: | Line 1: | ||
{{Documentation subpage}} |
{{Documentation subpage}} |
||
{{high-use|90,000+}} |
|||
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> |
|||
{{tsh|dot|middot|,}} |
|||
__NOTOC__ |
__NOTOC__ |
||
This is the '''bold middot''' template, it looks like this: " '''·''' ". |
This is the '''bold middot''' template, it looks like this: " '''·''' ". It works similarly to the html+wiki markup sequence [<code>'''&nbsp;<nowiki><b>&middot;</b></nowiki>''' </code>]. That is, a [[non-breaking space]], a bolded middot and a normal space. |
||
This template is used when you want something smaller than a [[Template:•|bullet]] "•", or [[Template:spaced ndash|ndash]] "–". |
|||
It works similarly to the html+wiki markup sequence "<code>'''&nbsp;<nowiki>'''&middot;'''</nowiki>''' </code>". That is, a [[non-breaking space]], a bolded middot and a normal space. |
|||
This template's use for dotted lists is now '''deprecated'''. Use {{Tl|Flatlist}} or <code>class="hlist"</code> instead; see [[w:WP:HLIST|WP:HLIST]]. |
|||
{{tl|dot}} redirects here and can be used as an alternative name for this template. |
|||
This template is usually used for dotted lists, such as for link lists in navigation boxes. (For lists that have a font-size 80% or less of normal font-size, the bold middot "'''·'''" becomes too small. Then use the [[Template:•|bullet]] "•" instead.) |
|||
{| class="wikitable" style="border: none; background: none;" |
|||
This template is used when you want something smaller than a [[Template:•|bullet]] "•", [[Template:Ndash|ndash]] "–" or [[Template:Mdash|mdash]] "—". |
|||
|<center>Here's an example of how it's used</center> |
|||
|- |
|||
| <p>Normally, in a real box these items would be links, but this is an example.</p> Item1{{dot}} A{{dot}} B{{dot}} Item2{{dot}} Item3{{dot}} Item4{{dot}} Item5{{dot}} extra item{{dot}} E{{dot}} 1{{dot}} 2{{dot}} 3{{dot}} 4{{dot}} 5{{dot}} 6{{dot}} 7{{dot}} {{nowrap|item that won't attach to prior line unless it fits in the remaining space{{dot}}}} Q{{dot}} A slightly longer item{{dot}} KK{{dot}} An obviously really even longer item that the dash will hang at its end{{dot}} Item6{{dot}} C{{dot}} Item7{{dot}} Item8{{dot}} Item9{{dot}} Item10{{dot}} Item11{{dot}} Item12{{dot}} D{{dot}} Item13{{dot}} Item14{{dot}} Item15{{dot}} Item16{{dot}} Item17{{dot}} Item18 <p>The space on the end makes sure the dot doesn't touch the edge of the box, either</p> |
|||
|} |
|||
Template Dot is not really intended to be used in article text; it's intended for use in other templates, tables, lists and other equivalent things, in order to include a separator between items such as in infoboxes. It's also to be consistent so that the article editor can use their choice of '''<nowiki>{{</nowiki>bull}}''', '''<nowiki>{{</nowiki>dot}}''', '''<nowiki>{{</nowiki>middot}}''', or '''<nowiki>{{</nowiki>spaced ndash}}''' and not have to insert the {{bull}}, {{dot}}, {{middot}}, or {{spaced ndash}} symbol, they can use any of these as a simple macro. The idea being that if you have a table with a list of items, you can insert a bolded middot (or the other symbols) between items that will appear correct, in that the items always have just one separator between them, and when a list crawls to the next line, the dash hangs onto the prior item instead of rolling over to the next line. Notice on the end of this box, the dot symbol "'''·'''" hangs on the end of the last item that will fit on the line indicating that additional items follow on the next line as part of this list, but the item only stays on the line if the item and the dot will fit. See the column on the right. In code it's ''' Item1<nowiki>{{</nowiki>dot}} Item2<nowiki>{{</nowiki>dot}} Item3<nowiki>{{</nowiki>dot}} Item4<nowiki>{{</nowiki>dot}} Item5<nowiki>{{</nowiki>dot}}''' etc. (with some smaller items squeezed in to show that the list doesn't have to be the same number of items per line) but in the box they all fold perfectly once it runs out of space on the line to fit the next item and the symbol following. |
|||
=== Normal usage === |
|||
The recommended usage is to use ''no'' space before the template and one space after the template, like this: |
|||
== Technical details == |
|||
<nowiki>[[Salt]]{{·}} [[Pepper]]</nowiki> |
|||
The space before the dot is a [[non-breaking space]]. That means it will not line break and will not collapse together with normal spaces that come before the template. |
|||
The space after the dot is a normal space. That means it wraps (allows line breaks) and it will collapse together with normal spaces that come after the template to form one single space. |
|||
The template can also be used with no space after it, but then the code does not wrap in the edit window thus making editing harder. Like this: |
|||
Under some circumstances dotted link lists misbehave. They might get unexpected line wraps or they might expand outside the box they are enclosed in. The how-to guide [[Wikipedia:Line-break handling]] explains when that happens and how to fix it. |
|||
<nowiki>[[Salt]]{{·}}[[Pepper]]</nowiki> |
|||
== Parameters == |
|||
Both examples will render one space on each side of the dot, like this: |
|||
<TemplateData>{ |
|||
:[[Salt]] '''·''' [[Pepper]] |
|||
"description": "Display a bold spaced middle dot (smaller than bullet)", |
|||
"params": {} |
|||
}</TemplateData> |
|||
== Redirects == |
|||
If it line breaks then the line break will come ''after'' the dot, not before, like this: |
|||
* {{tl2|,}} |
|||
:[[Salt]] '''·''' |
|||
* {{tl2|dot}} |
|||
:[[Pepper]] |
|||
* {{tl2|middot}} |
|||
== Dot sizes == |
|||
For long dotted lists each list item can be put on its own line, with no spaces between each item and the template. Like this: |
|||
{{Dot size}} |
|||
<pre><nowiki> |
|||
[[Salt]]{{·}} |
|||
[[Pepper]]{{·}} |
|||
[[Curry]]{{·}} |
|||
[[Saffron]]</nowiki></pre> |
|||
== See also == |
|||
(It doesn't matter if there are no or some spaces at the end of the lines, after the templates.) |
|||
There are several similar templates: |
|||
As before it will render one space on each side of the dots, like this: |
|||
:[[Salt]] '''·''' [[Pepper]] '''·''' [[Curry]] '''·''' [[Saffron]] |
|||
And if it line breaks then the line break will come ''after'' one of the dots, not before, like this: |
|||
:[[Salt]] '''·''' [[Pepper]] '''·''' |
|||
:[[Curry]] '''·''' [[Saffron]] |
|||
When using the template to separate words in italics (typically lists of artworks in [[Template:navbox|navboxes]]), put it ''within the italics'' to display with proper spacing on both sides. Compare: |
|||
<nowiki>''[[Salt]]''{{·}} ''[[Pepper]]''</nowiki> |
|||
<nowiki>''[[Salt]]{{·}} [[Pepper]]''</nowiki> |
|||
<!-- This smaller text size is necessary for the first example to "fail" as intended. --> |
|||
<div style="font-size:90%"> |
|||
:''[[Salt]]''{{·}} ''[[Pepper]]'' |
|||
:''[[Salt]]{{·}} [[Pepper]]'' |
|||
</div> |
|||
(This also improves code brevity and clarity.) |
|||
=== Usage issues === |
|||
Putting one or more spaces before the template will cause it to render differently, like these examples: |
|||
<nowiki>[[Salt]] {{·}}[[Pepper]]</nowiki> |
|||
<nowiki>[[Salt]] {{·}}[[Pepper]]</nowiki> |
|||
<nowiki>[[Salt]] {{·}} [[Pepper]]</nowiki> |
|||
<nowiki>[[Salt]] {{·}} [[Pepper]]</nowiki> |
|||
Then it will render with ''two'' spaces before the dot, and one after, like this: |
|||
:[[Salt]] '''·''' [[Pepper]] |
|||
And if it line breaks it might break ''before'' the dot, like this: |
|||
:[[Salt]] |
|||
:'''·''' [[Pepper]] |
|||
Alternatively an <code>&nbsp;</code> can be added before and after the template to create extra padding around the middot. |
|||
=== Technical details === |
|||
The space before the dot is a [[non-breaking space]]. That means it will not line break and will not collapse together with normal spaces that come before the template. |
|||
The space after the dot is a normal space. That means it wraps (allows line breaks) and it will collapse together with normal spaces that come after the template to form one single space. |
|||
Under some circumstances dotted link lists misbehave. They might get unexpected line wraps or they might expand outside the box they are enclosed in. The how-to guide [[Wikipedia:Line break handling]] explains when that happens and how to fix it. |
|||
=== Dot size reference list === |
|||
{| style="text-align:center; background:transparent;" |
|||
| style="width:1.7em;" | <small>·</small> |
|||
| align="left" | <small> middot |
|||
|- |
|||
| · |
|||
| align="left" | middot |
|||
|- |
|||
| <small>'''·'''</small> |
|||
| align="left" | <small> bold middot |
|||
|- |
|||
| '''·''' |
|||
| align="left" | bold middot |
|||
|- |
|||
| <small>•</small> |
|||
| align="left" | <small> bullet |
|||
|- |
|||
| • |
|||
| align="left" | bullet |
|||
|- |
|||
| '''•''' |
|||
| align="left" | bold bullet |
|||
|- |
|||
| – |
|||
| align="left" | ndash |
|||
|- |
|||
| — |
|||
| align="left" | mdash |
|||
|} |
|||
=== See also === |
|||
There are several other templates with similar functionality: |
|||
* {{tn|•}} – Bullet "•" is mostly used for dotted lists that use small font sizes. |
* {{tn|•}} – Bullet "•" is mostly used for dotted lists that use small font sizes. |
||
* {{tl|ndash}} – Ndash "–" is a short dash. |
* {{tl|spaced ndash}} – Ndash "–" is a short dash. |
||
* {{tl|mdash}} – Mdash "—" is a long dash. |
|||
* {{tn|\}} – For the occasional slash "/" in lists. |
* {{tn|\}} – For the occasional slash "/" in lists. |
||
* {{tl2|-!}} – Spaced pipe "|" |
|||
When making dotted lists you might need to handle proper word wrapping (line breaking): |
|||
* {{tl|nowraplinks}} – Prevents wraps inside links and only allows wraps between the links and in normal text, very useful for link lists and easy to use. |
|||
* {{tl|nowrap begin}} – Prevents wraps in both text and links. For the really tricky wrapping cases when you need full control, for instance in very complex link lists. |
|||
* [[Wikipedia:Line break handling]] – The how-to guide detailing how to handle line wrapping on Wikipedia. |
|||
<includeonly> |
<includeonly> |
||
[[Category:Wikipedia formatting and function templates |
[[Category:Wikipedia formatting and function templates]] |
||
[[ar:قالب:•]] |
|||
[[ca:Plantilla:·]] |
|||
[[cy:Nodyn:·]] |
|||
[[da:Skabelon:·]] |
|||
[[eo:Ŝablono:·]] |
|||
[[es:Plantilla:·]] |
|||
[[fr:Modèle:·]] |
|||
[[hi:साँचा:·]] |
|||
[[hsb:Předłoha:·]] |
|||
[[hu:Sablon:·]] |
|||
[[id:Templat:·]] |
|||
[[it:Template:·]] |
|||
[[he:תבנית:·]] |
|||
[[ja:Template:·]] |
|||
[[ku:Şablon:·]] |
|||
<!-- [[lt:Šablonas:·]] doesn't include the --> |
|||
[[lv:Veidne:·]] |
|||
[[ms:Templat:·]] |
|||
[[nl:Sjabloon:·]] |
|||
[[nn:Mal:·]] |
|||
<!-- [[no:Mal:·]] doesn't include the --> |
|||
[[pt:Predefinição:·]] |
|||
[[ro:Format:·]] |
|||
[[simple:Template:·]] |
|||
[[sl:Predloga:·]] |
|||
[[sq:Stampa:·]] |
|||
[[su:Citakan:·]] |
|||
[[sv:Mall:·]] |
|||
[[tr:Şablon:·]] |
|||
[[vi:Tiêu bản:·]] |
|||
[[uk:Шаблон:·]] |
|||
</includeonly> |
</includeonly> |
Latest revision as of 16:22, July 15, 2022
This is a documentation subpage for Template:·. It may contain usage information, categories and other content that is not part of the original template page. |
This template is used on 90,000+ pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
This is the bold middot template, it looks like this: " · ". It works similarly to the html+wiki markup sequence [ <b>·</b>
]. That is, a non-breaking space, a bolded middot and a normal space.
This template is used when you want something smaller than a bullet "•", or ndash "–".
This template's use for dotted lists is now deprecated. Use {{Flatlist}} or class="hlist"
instead; see WP:HLIST.
Normally, in a real box these items would be links, but this is an example. Item1 · A · B · Item2 · Item3 · Item4 · Item5 · extra item · E · 1 · 2 · 3 · 4 · 5 · 6 · 7 · item that won't attach to prior line unless it fits in the remaining space · Q · A slightly longer item · KK · An obviously really even longer item that the dash will hang at its end · Item6 · C · Item7 · Item8 · Item9 · Item10 · Item11 · Item12 · D · Item13 · Item14 · Item15 · Item16 · Item17 · Item18The space on the end makes sure the dot doesn't touch the edge of the box, either |
Template Dot is not really intended to be used in article text; it's intended for use in other templates, tables, lists and other equivalent things, in order to include a separator between items such as in infoboxes. It's also to be consistent so that the article editor can use their choice of {{bull}}, {{dot}}, {{middot}}, or {{spaced ndash}} and not have to insert the Template:Bull, · , Template:Middot, or Template:Spaced ndash symbol, they can use any of these as a simple macro. The idea being that if you have a table with a list of items, you can insert a bolded middot (or the other symbols) between items that will appear correct, in that the items always have just one separator between them, and when a list crawls to the next line, the dash hangs onto the prior item instead of rolling over to the next line. Notice on the end of this box, the dot symbol "·" hangs on the end of the last item that will fit on the line indicating that additional items follow on the next line as part of this list, but the item only stays on the line if the item and the dot will fit. See the column on the right. In code it's Item1{{dot}} Item2{{dot}} Item3{{dot}} Item4{{dot}} Item5{{dot}} etc. (with some smaller items squeezed in to show that the list doesn't have to be the same number of items per line) but in the box they all fold perfectly once it runs out of space on the line to fit the next item and the symbol following.
Technical details
The space before the dot is a non-breaking space. That means it will not line break and will not collapse together with normal spaces that come before the template.
The space after the dot is a normal space. That means it wraps (allows line breaks) and it will collapse together with normal spaces that come after the template to form one single space.
Under some circumstances dotted link lists misbehave. They might get unexpected line wraps or they might expand outside the box they are enclosed in. The how-to guide Wikipedia:Line-break handling explains when that happens and how to fix it.
Parameters
Display a bold spaced middle dot (smaller than bullet)
Parameter | Description | Type | Status | |||
---|---|---|---|---|---|---|
No parameters specified |
Redirects
Dot sizes
See also
There are several similar templates:
- Template:Tn – Bullet "•" is mostly used for dotted lists that use small font sizes.
- {{spaced ndash}} – Ndash "–" is a short dash.
- Template:Tn – For the occasional slash "/" in lists.
- Template:Tl2 – Spaced pipe "|"