Jump to content

ഫലകം:Ndash/doc

വിക്കിപീഡിയ, ഒരു സ്വതന്ത്ര വിജ്ഞാനകോശം.

This is the ndash template, it looks like this " – ".

It works similarly to the HTML markup sequence " – ". That is, a non-breaking space, a short dash (known as an en dash) and a normal space.

{{–}} and {{endash}} redirect here and can be used as alternative names for this template.

This template is used when you want something stronger than a bold middot "·" or a bullet "•", but shorter than an mdash "—". (An en dash is half the width of an em dash.)

For horizontal lists use {{Flatlist}} or class="hlist" instead (see WP:HLIST).

The recommended usage is to use no space before the template and one space after the template, like this:

[[Salt]]{{ndash}} [[Pepper]]

It will render one space on each side of the dash, like this:

SaltPepper

If it line breaks then the line break will come after the dash, not before, like this:

Salt
Pepper

If it line breaks then the line break will come after one of the dashes, not before, like this:

SaltPepper
CurrySaffron
Here's an example of how it's used
Template Ndash 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}}, {{mdash}}, {{middot}}, or {{ndash}} and not have to insert the  • ,  · , —,  · , or – 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 spaced short dash (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 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 dash will fit. See the column on the right. In code it's Item1{{ndash}} Item2{{ndash}} Item3{{ndash}} Item4{{ndash}} Item5{{ndash}} 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 dash following.

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– Item18

The space on the end makes sure the dash doesn't touch the edge of the box, either

If the template is used slightly wrong it will in some cases still behave well. For instance if there are no or several spaces after the template. Like these examples:

[[Salt]]{{ndash}}[[Pepper]]
[[Salt]]{{ndash}}   [[Pepper]]

Both of them will render exactly as before, with just one space on each side of the dash, like this:

SaltPepper

And it will still only line break after the dash, like this:

Salt
Pepper

But putting one or more spaces before the template will cause problems, like these examples:

[[Salt]] {{ndash}}[[Pepper]]
[[Salt]]   {{ndash}}[[Pepper]]
[[Salt]] {{ndash}} [[Pepper]]
[[Salt]]   {{ndash}}   [[Pepper]]

Then it will render with two spaces before the dash, and one after, like this:

Salt  – Pepper

And if it line breaks it might break before the dash, like this:

Salt
 – Pepper

Also, this template should not routinely be used in regular article text and certainly not where an em-dash would be more appropriate. As a rule, this template should not be used between clauses of a sentence.

Because Wikipedia suppresses the contents of templates in tool tip preview when the user hovers the pointer over a Wikilink, one should avoid using the Ndash template in an article's lead section. Using the template will cause a confusing blank space to appear in the tool tip preview instead of the expected en-dash character. Instead, use  – or  – , and be sure to add the trailing space.

Technical details

[തിരുത്തുക]

The space before the dash 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 dash 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.

· small middot
· middot
· small bold middot
· bold middot
small bullet
bullet
bold bullet
en dash
em dash


There are several other templates with similar functionality:

  • {{·}} – Bold middot "·"
  • {{•}} – Bullet "•"
  • − – Minus "−" is a mathematical symbol
  • {{mdash}} – Mdash "—" is an em dash, a longer dash


"https://ml.wikipedia.org/w/index.php?title=ഫലകം:Ndash/doc&oldid=1821527" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്