Template:Nowraplinks end

From EVE University Wiki
Revision as of 09:56, 23 August 2023 by Evon R'al (talk | contribs) (Create template.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Template documentation (for the above template, sometimes hidden or invisible)
Description
This template prevent word wraps (line breaks) inside links which contains spaces, hyphens ("-"), or, in some browsers, parentheses. The size of the nowrapped text becomes the minimum width of that link and that can negatively influence the ability of the page to adapt to smaller screens, or alternate representations of the content.while allowing wraps between links and in normal text.
This template can be used on its own or in conjunction with {{Nowraplinks end}}. Which is particularly useful when used around a large block of text or a list of links (it is easier to find "Nowraplinks end" then to find the correct closing brackets "}}".
Dependencies
Uses
nowraplink class in MediaWiki:Common.css
Used by
The nowraplinks class is used by:
{{Navbox}}
{{Sidebar}}
{{ShipsMatrix}}
thus automatically handling most wrapping problems in those templates.
Syntax
{{Nowraplinks|<content>}}
Parameters
content
A block of text that contains one or more links.
{{Nowraplinks}} the text with the links {{Nowraplinks end}}
Advanced usage
Most of the functionality in this template is implemented as a CSS class in common.css. That class can be used together with pretty much any HTML tag or any box to prevent links to word wrap. For instance like this:
<div class="nowraplinks"> Lots of text and links </div>
Or like this:
<span class="nowraplinks"> Lots of text and links </span>
If the nowraplinks class is applied in the header of a table it will prevent line wrapping of links in all cells in the table. Note that in a table header there usually is a need to apply several classes. Then the class names should be separated by spaces in the class tag, not by commas or semicolons. Like this:
{| class="wikitable nowraplinks"
|
[[This link will not wrap]]{{·}} 
[[This link also won't wrap]]{{·}} 
[[And so on]]{{·}} 
But this sentence might word wrap.
|
[[This link will not wrap]]{{·}} 
[[This link also won't wrap]]{{·}} 
[[And so on]]{{·}} 
But this sentence might word wrap.
|}

It will render this:

To really see the nowrap effect on the links above you can drag the width of your web browser window so it becomes smaller and smaller.
Sample
{{Nowraplinks|This is bunch of text with a link: [[Copying from Industry Hangars]] with spaces.}}
gives...
This is bunch of text with a link: Copying from Industry Hangars with spaces.
To really see the nowrap effect on the link above you can drag the width of your web browser window so it becomes smaller and smaller.
Technical details
{{Nowraplinks}} works by constructing a span with the CSS class "nowraplinks" which has the styles listed in MediaWiki:Common.css.
See also
* wikipedia:Template:Nowraplinks
Visit Template:Nowraplinks end/doc to edit this text! (How does this work?) (Refresh this text - why?)