(새 문서: <onlyinclude><templatestyles src="Template:Nowrap/styles.css"/><span class="nowrap">{{{1}}}</span></onlyinclude> {{Documentation}} <!-- Add categories to the /doc subpage and interwik...) |
|||
1번째 줄: | 1번째 줄: | ||
− | < | + | {{Documentation subpage}} |
− | {{ | + | <!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> |
− | < | + | {{Uses TemplateStyles|Template:Nowrap/styles.css}} |
+ | |||
+ | {{tlx|Nowrap}} or {{tlx|nowrap}} stops wrapping of specific text. It prevents word wraps (line breaks) within text or inside a link which contains spaces, hyphens ("-"), or, in some browsers, parentheses. The size of the nowrapped text becomes the minimum width of that paragraph and that can negatively influence the ability of the page to adapt to smaller screens, or alternate representations of the content. | ||
+ | |||
+ | == Usage == | ||
+ | :: <code><nowiki>{{Nowrap|these words stay together}}</nowiki></code> | ||
+ | :: <code><nowiki>{{Nowrap|a, b, c, or d.}}</nowiki></code> | ||
+ | :: <code><nowiki>{{Nowrap| merry-go-round }}</nowiki></code> | ||
+ | :: <code><nowiki>{{Nowrap| [[4-part harmony]] }}</nowiki></code> | ||
+ | :: <code><nowiki>{{Nowrap| [[Cascading Style Sheets|CSS]] }}</nowiki></code> | ||
+ | :: <code><nowiki>{{Nowrap| [[#Examples|Examples section]] }}</nowiki></code> | ||
+ | |||
+ | === Examples === | ||
+ | {| class=wikitable | ||
+ | |"<code>They held <nowiki>{{Nowrap|10 kg (22 lb)}}</nowiki> in total.</code>" | ||
+ | <br/> May render like this: | ||
+ | :They held {{Nowrap|10 kg (22 lb)}} <br/>in total. | ||
+ | <br/> Or like this: | ||
+ | :They held <br/>10 kg (22 lb) in total. | ||
+ | <br/> But ''not'' render like this: | ||
+ | :They held 10 kg (22 <br/>lb) in total. | ||
+ | |||
+ | | "<code>He encountered <nowiki>{{Nowrap|a tiger}}</nowiki> in the woods.</code>" | ||
+ | <br/> May render like this: | ||
+ | :He encountered a tiger <br/>in the woods. | ||
+ | <br/> Or like this: | ||
+ | :He encountered <br/>a tiger in the woods. | ||
+ | <br/> But ''not'' like this: | ||
+ | :He encountered a <br/>tiger in the woods. | ||
+ | |} | ||
+ | |||
+ | === Handling equal-sign or bar === | ||
+ | [[Help:Templates|Templates]] have problems with parameter data that contains equal-signs "<code>=</code>" or vertical bars "<code>|</code>" (pipes). Note that this does not apply if the equal-sign "<code>=</code>" or vertical bar "<code>|</code>" is inside a wikilink or another template. However, there are workarounds: | ||
+ | |||
+ | For text that includes an equal-sign "=", precede the text with <code>1=</code>, use a triple-brace unnamed parameter <code><nowiki>{{{|=}}}</nowiki></code>, or the <code><nowiki>{{=}}</nowiki></code> template. For example: | ||
+ | :<code><nowiki>{{Nowrap|</nowiki>1=2 + 2 = 4}}</code>, <br /><code><nowiki>{{Nowrap|2 + 2 {{{|=}}} 4}}</nowiki></code>, or <br /><code><nowiki>{{Nowrap|2 + 2 {{=}} 4}}</nowiki></code> | ||
+ | |||
+ | which all render as this: | ||
+ | :{{Nowrap|1=2 + 2 = 4}}. | ||
+ | |||
+ | For text that includes a vertical bar "|", escape the bar(s) with "<code><nowiki>&#124;</nowiki></code>" or "<code><nowiki>{{!}}</nowiki></code>". For instance, put two bars "|6|" like this: | ||
+ | :<code><nowiki>{{Nowrap|</nowiki>&#124;6&#124; < 7}}</code> or <code><nowiki>{{Nowrap|{{!}}6{{!}} < 7}}</nowiki></code> | ||
+ | |||
+ | Which renders this: | ||
+ | :{{Nowrap||6| < 7}} | ||
+ | |||
+ | == Technical details == | ||
+ | |||
+ | The actual code that does the job is this HTML {{tag|span|open|link=yes}} tag that applies a class to the text inside the template: | ||
+ | |||
+ | <syntaxhighlight lang="html"> | ||
+ | <span class="nowrap">This text will not wrap</span> | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | The class <code>nowrap</code> receives the CSS property <syntaxhighlight lang="css" inline>white-space: nowrap;</syntaxhighlight> in {{Blue|MediaWiki:Common.css}}. | ||
+ | |||
+ | == TemplateData == | ||
+ | {{TemplateData header}} | ||
+ | <templatedata> | ||
+ | { | ||
+ | "description": { | ||
+ | "en": "Prevents word wraps (line breaks) within text or inside a link which contains spaces or hyphens (-).", | ||
+ | "cs": "Zabraňuje zalamování slov (zalomení řádků) v textu nebo uvnitř odkazu, který obsahuje mezery nebo spojovníky (-)." | ||
+ | }, | ||
+ | "format": "inline", | ||
+ | "params": { | ||
+ | "1": { | ||
+ | "label": { | ||
+ | "en": "Text", | ||
+ | "cs": "Text" | ||
+ | }, | ||
+ | "description": { | ||
+ | "en": "Text or link to be protected.", | ||
+ | "cs": "Text nebo odkaz, který má být chráněn." | ||
+ | }, | ||
+ | "type": "string", | ||
+ | "required": true | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </templatedata> | ||
+ | <includeonly>{{Sandbox other|| | ||
+ | <!-- Categories below this line; interwikis at Wikidata --> | ||
+ | [[Category:Formatting templates]] | ||
+ | }}</includeonly> |
2023년 2월 27일 (월) 17:54 기준 최신판
틀:Documentation subpage 틀:Uses TemplateStyles
틀:Tlx or 틀:Tlx stops wrapping of specific text. It prevents word wraps (line breaks) within text or inside a link which contains spaces, hyphens ("-"), or, in some browsers, parentheses. The size of the nowrapped text becomes the minimum width of that paragraph and that can negatively influence the ability of the page to adapt to smaller screens, or alternate representations of the content.
Usage[편집]
{{Nowrap|these words stay together}}
{{Nowrap|a, b, c, or d.}}
{{Nowrap| merry-go-round }}
{{Nowrap| [[4-part harmony]] }}
{{Nowrap| [[Cascading Style Sheets|CSS]] }}
{{Nowrap| [[#Examples|Examples section]] }}
Examples[편집]
"They held {{Nowrap|10 kg (22 lb)}} in total. "
틀:Tlx or 틀:Tlx stops wrapping of specific text. It prevents word wraps (line breaks) within text or inside a link which contains spaces, hyphens ("-"), or, in some browsers, parentheses. The size of the nowrapped text becomes the minimum width of that paragraph and that can negatively influence the ability of the page to adapt to smaller screens, or alternate representations of the content. Usage[편집]
Examples[편집]
Handling equal-sign or bar[편집]Templates have problems with parameter data that contains equal-signs " For text that includes an equal-sign "=", precede the text with
which all render as this:
For text that includes a vertical bar "|", escape the bar(s) with "
Which renders this:
Technical details[편집]The actual code that does the job is this HTML 틀:Tag tag that applies a class to the text inside the template: <span class="nowrap">This text will not wrap</span> The class TemplateData[편집]Prevents word wraps (line breaks) within text or inside a link which contains spaces or hyphens (-).
틀:Sandbox other
|
"He encountered {{Nowrap|a tiger}} in the woods. "
|
Handling equal-sign or bar[편집]
Templates have problems with parameter data that contains equal-signs "=
" or vertical bars "|
" (pipes). Note that this does not apply if the equal-sign "=
" or vertical bar "|
" is inside a wikilink or another template. However, there are workarounds:
For text that includes an equal-sign "=", precede the text with 1=
, use a triple-brace unnamed parameter {{{|=}}}
, or the {{=}}
template. For example:
{{Nowrap|1=2 + 2 = 4}}
,{{Nowrap|2 + 2 {{{|=}}} 4}}
, or{{Nowrap|2 + 2 {{=}} 4}}
which all render as this:
틀:Tlx or 틀:Tlx stops wrapping of specific text. It prevents word wraps (line breaks) within text or inside a link which contains spaces, hyphens ("-"), or, in some browsers, parentheses. The size of the nowrapped text becomes the minimum width of that paragraph and that can negatively influence the ability of the page to adapt to smaller screens, or alternate representations of the content.
Usage[편집]
{{Nowrap|these words stay together}}
{{Nowrap|a, b, c, or d.}}
{{Nowrap| merry-go-round }}
{{Nowrap| [[4-part harmony]] }}
{{Nowrap| [[Cascading Style Sheets|CSS]] }}
{{Nowrap| [[#Examples|Examples section]] }}
Examples[편집]
"They held {{Nowrap|10 kg (22 lb)}} in total. "
|
"He encountered {{Nowrap|a tiger}} in the woods. "
|
Handling equal-sign or bar[편집]
Templates have problems with parameter data that contains equal-signs "=
" or vertical bars "|
" (pipes). Note that this does not apply if the equal-sign "=
" or vertical bar "|
" is inside a wikilink or another template. However, there are workarounds:
For text that includes an equal-sign "=", precede the text with 1=
, use a triple-brace unnamed parameter {{{|=}}}
, or the {{=}}
template. For example:
{{Nowrap|1=2 + 2 = 4}}
,{{Nowrap|2 + 2 {{{|=}}} 4}}
, or{{Nowrap|2 + 2 {{=}} 4}}
which all render as this:
- 재귀적인 틀이 발견되었습니다: 틀:Nowrap.
For text that includes a vertical bar "|", escape the bar(s) with "|
" or "{{!}}
". For instance, put two bars "|6|" like this:
{{Nowrap||6| < 7}}
or{{Nowrap|{{!}}6{{!}} < 7}}
Which renders this:
- 재귀적인 틀이 발견되었습니다: 틀:Nowrap
Technical details[편집]
The actual code that does the job is this HTML 틀:Tag tag that applies a class to the text inside the template:
<span class="nowrap">This text will not wrap</span>
The class nowrap
receives the CSS property white-space: nowrap;
in 틀:Blue.
TemplateData[편집]
Prevents word wraps (line breaks) within text or inside a link which contains spaces or hyphens (-).
변수 | 설명 | 형식 | 상태 | |
---|---|---|---|---|
Text | 1 | Text or link to be protected. | 문자열 | 필수 |
For text that includes a vertical bar "|", escape the bar(s) with "|
" or "{{!}}
". For instance, put two bars "|6|" like this:
{{Nowrap||6| < 7}}
or{{Nowrap|{{!}}6{{!}} < 7}}
Which renders this:
틀:Tlx or 틀:Tlx stops wrapping of specific text. It prevents word wraps (line breaks) within text or inside a link which contains spaces, hyphens ("-"), or, in some browsers, parentheses. The size of the nowrapped text becomes the minimum width of that paragraph and that can negatively influence the ability of the page to adapt to smaller screens, or alternate representations of the content.
Usage[편집]
{{Nowrap|these words stay together}}
{{Nowrap|a, b, c, or d.}}
{{Nowrap| merry-go-round }}
{{Nowrap| [[4-part harmony]] }}
{{Nowrap| [[Cascading Style Sheets|CSS]] }}
{{Nowrap| [[#Examples|Examples section]] }}
Examples[편집]
"They held {{Nowrap|10 kg (22 lb)}} in total. "
|
"He encountered {{Nowrap|a tiger}} in the woods. "
|
Handling equal-sign or bar[편집]
Templates have problems with parameter data that contains equal-signs "=
" or vertical bars "|
" (pipes). Note that this does not apply if the equal-sign "=
" or vertical bar "|
" is inside a wikilink or another template. However, there are workarounds:
For text that includes an equal-sign "=", precede the text with 1=
, use a triple-brace unnamed parameter {{{|=}}}
, or the {{=}}
template. For example:
{{Nowrap|1=2 + 2 = 4}}
,{{Nowrap|2 + 2 {{{|=}}} 4}}
, or{{Nowrap|2 + 2 {{=}} 4}}
which all render as this:
- 재귀적인 틀이 발견되었습니다: 틀:Nowrap.
For text that includes a vertical bar "|", escape the bar(s) with "|
" or "{{!}}
". For instance, put two bars "|6|" like this:
{{Nowrap||6| < 7}}
or{{Nowrap|{{!}}6{{!}} < 7}}
Which renders this:
- 재귀적인 틀이 발견되었습니다: 틀:Nowrap
Technical details[편집]
The actual code that does the job is this HTML 틀:Tag tag that applies a class to the text inside the template:
<span class="nowrap">This text will not wrap</span>
The class nowrap
receives the CSS property white-space: nowrap;
in 틀:Blue.
TemplateData[편집]
Prevents word wraps (line breaks) within text or inside a link which contains spaces or hyphens (-).
변수 | 설명 | 형식 | 상태 | |
---|---|---|---|---|
Text | 1 | Text or link to be protected. | 문자열 | 필수 |
Technical details[편집]
The actual code that does the job is this HTML 틀:Tag tag that applies a class to the text inside the template:
<span class="nowrap">This text will not wrap</span>
The class nowrap
receives the CSS property white-space: nowrap;
in 틀:Blue.
TemplateData[편집]
Prevents word wraps (line breaks) within text or inside a link which contains spaces or hyphens (-).
변수 | 설명 | 형식 | 상태 | |
---|---|---|---|---|
Text | 1 | Text or link to be protected. | 문자열 | 필수 |