Difference between revisions of "Template:Tlg/doc"

From Summertime Saga Wiki
Jump to: navigation, search
m
m (Examples)
 
(9 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
With the exception of alttext, {{tlg|code=yes|nolink=yes|tlg}} named parameters are toggles that are either omitted (default) or activated (by being assigned a value such as "on", "yes", "true", "include", etc.). They may be included in any order:
 
With the exception of alttext, {{tlg|code=yes|nolink=yes|tlg}} named parameters are toggles that are either omitted (default) or activated (by being assigned a value such as "on", "yes", "true", "include", etc.). They may be included in any order:
  
; {{para|brace}} : Include braces as part of the template link.
+
; {{para|bold}} : Renders the template link/name in bold.
; {{para|braceinside}} : Include innermost braces as part of the template link.
 
; {{para|bold}}, {{para|boldlink}}, {{para|boldname}} : Renders the template link/name in bold.
 
 
; {{para|code}} : Display output using HTML {{tag|code}} tags (monospaced font)
 
; {{para|code}} : Display output using HTML {{tag|code}} tags (monospaced font)
 
; {{para|plaincode}} : Use {{tag|code|params=style="border:none; background:transparent;"}}.
 
; {{para|plaincode}} : Use {{tag|code|params=style="border:none; background:transparent;"}}.
 
; {{para|kbd}} : Display output using HTML {{tag|kbd}} tags (monospaced font).
 
; {{para|kbd}} : Display output using HTML {{tag|kbd}} tags (monospaced font).
; {{para|italic}}, {{para|italics}} : Display any parameters accompanying the template link/name in italic.
+
; {{para|italic}} : Display any parameters accompanying the template link/name in italic.
 
; {{para|nolink}} : Don’t render the template name as a link.
 
; {{para|nolink}} : Don’t render the template name as a link.
 
; {{para|nowrap}} : Prevent the insertion of line breaks (word wrap) in the output.
 
; {{para|nowrap}} : Prevent the insertion of line breaks (word wrap) in the output.
 
; {{para|nowrapname}} : Prevent word wrapping in the output of template name/link (parameters will wrap if needed).
 
; {{para|nowrapname}} : Prevent word wrapping in the output of template name/link (parameters will wrap if needed).
 
; {{para|subst}} : Include a {{code|subst:}} prefix before the template link/name.
 
; {{para|subst}} : Include a {{code|subst:}} prefix before the template link/name.
; {{para||alttext|{{var|[text]}}}} : Use {{var|[text]}} as the label for the template link.
+
; {{para||alttext|{{var|text}}}} : Use {{var|text}} as the label for the template link.
  
 
=== Unnamed (positional) ===
 
=== Unnamed (positional) ===
Line 29: Line 27:
 
! Markup
 
! Markup
 
! Renders as
 
! Renders as
! Remarks
+
! Notes
|-
 
| {{tlg|code=yes|nolink=yes|tlg|Termometro}}
 
| {{tlg|Termometro}}
 
| {{error|Termometro}} template does not exist.
 
|-
 
| {{tlg|code=yes|nolink=yes|tlg|ok}}
 
| {{tlg|button}}
 
| Button template does exist
 
|-
 
| {{tlg|code=yes|nolink=yes|tlg|convert|<nowiki>&lt;nowiki>14|m|ftin|abbr=out|sp=us&lt;/nowiki></nowiki>}}
 
| {{tlg|convert|<nowiki>14|m|ftin|abbr=out|sp=us</nowiki>}}
 
| Unlimited parameters as one {{tag|nowiki|link=yes}}
 
 
|-
 
|-
 
| {{tlg|code=yes|nolink=yes|tlg|Template}}
 
| {{tlg|code=yes|nolink=yes|tlg|Template}}
 
| {{tlg|Template}}
 
| {{tlg|Template}}
|
+
| “Template” template does exist.
 
|-
 
|-
 
| {{tlg|code=yes|nolink=yes|tlg|templatE}}
 
| {{tlg|code=yes|nolink=yes|tlg|templatE}}
 
| {{tlg|templatE}}
 
| {{tlg|templatE}}
| template names are case‐sensitive
+
| The template names are case‐sensitive.
 
|-
 
|-
 
| {{tlg|code=yes|nolink=yes|tlg|template}}
 
| {{tlg|code=yes|nolink=yes|tlg|template}}
 
| {{tlg|template}}
 
| {{tlg|template}}
| first letter is case‐insensitive though
+
| The first letter is {{em|not}} case‐sensitive though.
 
|-
 
|-
 
| {{tlg|code=yes|nolink=yes|tlg|template|code{{=}}on}}
 
| {{tlg|code=yes|nolink=yes|tlg|template|code{{=}}on}}
 
| {{tlg|template|code=on}}
 
| {{tlg|template|code=on}}
| {{tag|code|open}} style
+
| Use {{tag|code|open}} style.
 
|-
 
|-
 
| {{tlg|code=yes|nolink=yes|tlg|template|plaincode{{=}}on}}
 
| {{tlg|code=yes|nolink=yes|tlg|template|plaincode{{=}}on}}
 
| {{tlg|template|plaincode=on}}
 
| {{tlg|template|plaincode=on}}
| plaincode style
+
| Use plaincode style.
 
|-
 
|-
 
| {{tlg|code=yes|nolink=yes|tlg|template|kbd{{=}}on}}
 
| {{tlg|code=yes|nolink=yes|tlg|template|kbd{{=}}on}}
 
| {{tlg|template|kbd=on}}
 
| {{tlg|template|kbd=on}}
| {{tag|kbd|open}} style
+
| Use {{tag|kbd|open}} style.
 
|-
 
|-
 
| {{tlg|code=yes|nolink=yes|tlg|template|bold{{=}}on}}
 
| {{tlg|code=yes|nolink=yes|tlg|template|bold{{=}}on}}
 
| {{tlg|template|bold=on}}
 
| {{tlg|template|bold=on}}
| bold link or name
+
| Display link or name in bold.
 
|-
 
|-
 
| {{tlg|code=yes|nolink=yes|tlg|template|one|italic{{=}}on}}
 
| {{tlg|code=yes|nolink=yes|tlg|template|one|italic{{=}}on}}
 
| {{tlg|template|one|italic=on}}
 
| {{tlg|template|one|italic=on}}
| parameter/s in italics
+
| Display parameters in italics.
 
|-
 
|-
 
| {{tlg|code=yes|nolink=yes|tlg|template|nolink{{=}}on}}
 
| {{tlg|code=yes|nolink=yes|tlg|template|nolink{{=}}on}}
 
| {{tlg|template|nolink=on}}
 
| {{tlg|template|nolink=on}}
|
+
| Do not link the template name presented
 
|-
 
|-
 
| {{tlg|code=yes|nolink=yes|tlg|template|subst{{=}}on}}
 
| {{tlg|code=yes|nolink=yes|tlg|template|subst{{=}}on}}
Line 83: Line 69:
 
|
 
|
 
|-
 
|-
| {{tlg|code=yes|nolink=yes|tlg|template|brace{{=}}on}}
+
| {{tlg|code=yes|nolink=yes|tlg|template|alttext{{=}}template link}}
| {{tlg|template|brace=on}}
+
| {{tlg|template|alttext=template link}}
| all braces in link
 
|-
 
| {{tlg|code=yes|nolink=yes|tlg|template|braceinside{{=}}on}}
 
| {{tlg|template|braceinside=on}}
 
| inside braces in link
 
|-
 
| {{tlg|code=yes|nolink=yes|tlg|template|alttext{{=}}x0 link}}
 
| {{tlg|template|alttext=x0 link}}
 
 
|
 
|
 
|-
 
|-
Line 99: Line 77:
 
| Multiple parameter settings can be combined.
 
| Multiple parameter settings can be combined.
 
|-
 
|-
| {{tlg|code=yes|nolink=yes|tlg|x1|one}}
+
| {{tlg|code=yes|nolink=yes|tlg|template|one}}
| {{tlg|x1|one}}
+
| {{tlg|template|one}}
 
|
 
|
 
|-
 
|-
| {{tlg|code=yes|nolink=yes|tlg|x2|one|two}}
+
| {{tlg|code=yes|nolink=yes|tlg|template|one|two}}
| {{tlg|x2|one|two}}
+
| {{tlg|template|one|two}}
 
|
 
|
 
|-
 
|-
| {{tlg|code=yes|nolink=yes|tlg|x2|bold{{=}}on|code{{=}}on|one|two}}
+
| {{tlg|code=yes|nolink=yes|tlg|template|bold{{=}}on|code{{=}}on|one|two}}
| {{tlg|x2|bold=on|code=on|one|two}}
+
| {{tlg|template|bold=on|code=on|one|two}}
| Can combine named and anonymous parameters
+
| Named and unnamed parameters can be combined…
 
|-
 
|-
| {{tlg|code=yes|nolink=yes|tlg|x2|one|two|bold{{=}}on|code{{=}}on}}
+
| {{tlg|code=yes|nolink=yes|tlg|template|one|two|bold{{=}}on|code{{=}}on}}
| {{tlg|x2|one|two|bold=on|code=on}}
+
| {{tlg|template|one|two|bold=on|code=on}}
| … in any order …
+
| … in any order…
 
|-
 
|-
| {{tlg|code=yes|nolink=yes|tlg|x2|one|code{{=}}on|two|bold{{=}}on|three}}
+
| {{tlg|code=yes|nolink=yes|tlg|template|one|code{{=}}on|two|bold{{=}}on|three}}
| {{tlg|x2|one|code=on|two|bold=on|three}}
+
| {{tlg|template|one|code=on|two|bold=on|three}}
| … even intermixed …
+
| … even intermixed…
 
|-
 
|-
| {{tlg|code=yes|nolink=yes|tlg|x2|one|code{{=}}on|two|bold{{=}}on|three|italic{{=}}on}}
+
| {{tlg|code=yes|nolink=yes|tlg|template|one|code{{=}}on|two|bold{{=}}on|three|italic{{=}}on}}
| {{tlg|x2|one|code=on|two|bold=on|three|italic=on}}
+
| {{tlg|template|one|code=on|two|bold=on|three|italic=on}}
 
| … with many different configurations.
 
| … with many different configurations.
 
|-
 
|-
| {{tlg|code=yes|nolink=yes|tlg|x3|1|2|3|4|5|6|7|8|9&#124;10}}
+
| {{tlg|code=yes|nolink=yes|tlg|template|1|2|3|4|5|6|7|8|9&#124;10}}
| {{tlg|x3|1|2|3|4|5|6|7|8|9|10}}
+
| {{tlg|template|1|2|3|4|5|6|7|8|9|10}}
 
|
 
|
 
|-
 
|-
| {{tlg|code=yes|nolink=yes|tlg|x4|1|2|3|4|5|6|7|8|9&#124;10&#124;11}}
+
| {{tlg|code=yes|nolink=yes|tlg|template|1|2|3|4|5|6|7|8|9&#124;10&#124;11}}
| {{tlg|x4|1|2|3|4|5|6|7|8|9|10|11}}
+
| {{tlg|template|1|2|3|4|5|6|7|8|9|10|11}}
| up to 10 parameters, then
+
| Up to 10 parameters, then ellipsis.
|-
 
| {{tlg|code=yes|nolink=yes|tlg|x5|1|2|3|4|5|6|7|8|9&#124;10&amp;#124;11}}
 
| {{tlg|x5|1|2|3|4|5|6|7|8|9|10&#124;11}}
 
| {{code|&amp;#124;}} for more
 
 
|-
 
|-
 
| {{tlg|code=yes|nolink=yes|tlg}}
 
| {{tlg|code=yes|nolink=yes|tlg}}
 
| {{tlg}}
 
| {{tlg}}
| with no arguments, the current page name is substituted
+
| With no arguments, the current page name is substituted
 
|-
 
|-
| {{tlg|code=yes|nolink=yes|tlg|x1|x&#61;u}}
+
| {{tlg|code=yes|nolink=yes|tlg|template|x&#61;u}}
| {{tlg|x1|x=u}}
+
| {{tlg|template|x=u}}
| {{tlg|code=yes|nolink=yes|{{=}}}} won’t work
+
| Equals sign “=won’t work
 
|-
 
|-
| {{tlg|code=yes|nolink=yes|tlg|x1|x&amp;#61;u}}
+
| {{tlg|code=yes|nolink=yes|tlg|template|x&amp;#61;u}}
| {{tlg|x1|x&#61;u}}
+
| {{tlg|template|x&#61;u}}
| {{code|&amp;#61;}} is okay
+
| {{code|&amp;#61;}} Unicode is okay
 
|-
 
|-
| {{tlg|code=yes|nolink=yes|tlg|x1|x<nowiki>{{=}}</nowiki>u}}
+
| {{tlg|code=yes|nolink=yes|tlg|template|x<nowiki>{{=}}</nowiki>u}}
| {{tlg|x1|x{{=}}u}}
+
| {{tlg|template|x{{=}}u}}
| {{tlg|code=yes|nolink=yes|{{=}}}} is okay
+
| {{tlg|{{=}}}} template is okay
 
|-
 
|-
| {{tlg|code=yes|nolink=yes|tlg|x1|x&lt;nowiki&gt;&#61;&lt;/nowiki&gt;u}}
+
| {{tlg|code=yes|nolink=yes|tlg|template|x&lt;nowiki&gt;&#61;&lt;/nowiki&gt;u}}
| {{tlg|x1|x<nowiki>=</nowiki>u}}
+
| {{tlg|template|x<nowiki>=</nowiki>u}}
| sticky nowiki is okay
+
| {{tag|nowiki}} tag is okay
 
|-
 
|-
| {{tlg|code=yes|nolink=yes|tlg|x2|<nowiki />|two|<nowiki />|<nowiki />}}
+
| {{tlg|code=yes|nolink=yes|tlg|template|<nowiki />|two|<nowiki />|<nowiki />}}
| {{tlg|x2||two||}}
+
| {{tlg|template||two||}}
| empty parameters work too, even at the end
+
| Empty parameters work, even at the end.
|-
 
| {{tlg|code=yes|nolink=yes|tlg|x2|3{{=}}two|2{{=}}one}}
 
| {{tlg|x2|3=two|2=one}}
 
| right to left okay
 
 
|}
 
|}
  
Line 167: Line 137:
 
|+ Wrapping of long names (default)
 
|+ Wrapping of long names (default)
 
|-
 
|-
! style="width:50%;" | Markup
+
! Markup
! Renders as
+
! style="width:15em;" | Renders as
 
|-
 
|-
| {{tlg|code=yes|nolink=yes|tlg|long template name that would wrap to new line|this is a long value for the 1st parameter that would wrap}}
+
| {{tlg|code=yes|nolink=yes|tlg|nolink{{=}}yes|long template name that would wrap to new line|this is a long value for the 1st parameter that would wrap}}
| {{tlg|long template name that would wrap to new line|this is a long value for the 1st parameter that would wrap}}
+
| {{tlg|nolink=yes|long template name that would wrap to new line|this is a long value for the 1st parameter that would wrap}}
 
|}
 
|}
  
 
{| class="wikitable"
 
{| class="wikitable"
|+ Wrapping of long names (<kbd>nowrap=on</kbd>)
+
|+ Wrapping of long names ({{para|nowrap|yes}})
 
|-
 
|-
! style="width:50%;" | Markup
+
! Markup
! Renders as
+
! style="width:15em;" | Renders as
 
|-
 
|-
| {{tlg|code=yes|nolink=yes|tlg|nowrap{{=}}on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}}
+
| {{tlg|code=yes|nolink=yes|tlg|nowrap{{=}}yes|nolink{{=}}yes|long template name that would wrap to new line|long value for the 1st parameter that would wrap}}
| {{tlg|nowrap=on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}}
+
| {{tlg|nowrap=yes|nolink=yes|long template name that would wrap to new line|long value for the 1st parameter that would wrap}}
 
|}
 
|}
  
 
{| class="wikitable"
 
{| class="wikitable"
|+ Wrapping of long names (<kbd>nowrapname=on</kbd>)
+
|+ Wrapping of long names ({{para|nowrapname|yes}}</kbd>)
 
|-
 
|-
! style="width:50%;" | Markup
+
! Markup
! Renders as
+
! style="width:15em;" | Renders as
 
|-
 
|-
| {{tlg|code=yes|nolink=yes|tlg|nowrapname{{=}}on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}}
+
| {{tlg|code=yes|nolink=yes|tlg|nowrapname{{=}}yes|nolink{{=}}yes|long template name that would wrap to new line|long value for the 1st parameter that would wrap}}
| {{tlg|nowrapname=on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}}
+
| {{tlg|nowrapname=yes|nolink=yes|long template name that would wrap to new line|long value for the 1st parameter that would wrap}}
 
|}
 
|}
  
 
[[Category:Templates]][[Category:Templates documentation]]
 
[[Category:Templates]][[Category:Templates documentation]]

Latest revision as of 21:30, 22 July 2020

The template {{tlg}} (abbreviating “[t]emplate [l]ink (with) [g]eneral (options)”) is a generalised “template link” template.

Parameters

Named

With the exception of alttext, {{tlg}} named parameters are toggles that are either omitted (default) or activated (by being assigned a value such as "on", "yes", "true", "include", etc.). They may be included in any order:

|bold= 
Renders the template link/name in bold.
|code= 
Display output using HTML <code>…</code> tags (monospaced font)
|plaincode= 
Use <code style="border:none; background:transparent;">…</code>.
|kbd= 
Display output using HTML <kbd>…</kbd> tags (monospaced font).
|italic= 
Display any parameters accompanying the template link/name in italic.
|nolink= 
Don’t render the template name as a link.
|nowrap= 
Prevent the insertion of line breaks (word wrap) in the output.
|nowrapname= 
Prevent word wrapping in the output of template name/link (parameters will wrap if needed).
|subst= 
Include a subst: prefix before the template link/name.
|alttext 
Use text as the label for the template link.

Unnamed (positional)

{{tlg}} may take up to ten unnamed parameters accompanying the template link (or name).

Examples

Markup Renders as Notes
{{tlg|Template}} {{Template}} “Template” template does exist.
{{tlg|templatE}} {{templatE}} The template names are case‐sensitive.
{{tlg|template}} {{template}} The first letter is not case‐sensitive though.
{{tlg|template|code=on}} {{template}} Use <code> style.
{{tlg|template|plaincode=on}} {{template}} Use plaincode style.
{{tlg|template|kbd=on}} {{template}} Use <kbd> style.
{{tlg|template|bold=on}} {{template}} Display link or name in bold.
{{tlg|template|one|italic=on}} {{template|one}} Display parameters in italics.
{{tlg|template|nolink=on}} {{template}} Do not link the template name presented
{{tlg|template|subst=on}} {{subst:template}}
{{tlg|template|alttext=template link}} {{template link}}
{{tlg|template|bold=on|code=on|brace=on}} {{template}} Multiple parameter settings can be combined.
{{tlg|template|one}} {{template|one}}
{{tlg|template|one|two}} {{template|one|two}}
{{tlg|template|bold=on|code=on|one|two}} {{template|one|two}} Named and unnamed parameters can be combined…
{{tlg|template|one|two|bold=on|code=on}} {{template|one|two}} … in any order…
{{tlg|template|one|code=on|two|bold=on|three}} {{template|one|two|three}} … even intermixed…
{{tlg|template|one|code=on|two|bold=on|three|italic=on}} {{template|one|two|three}} … with many different configurations.
{{tlg|template|1|2|3|4|5|6|7|8|9|10}} {{template|1|2|3|4|5|6|7|8|9|10}}
{{tlg|template|1|2|3|4|5|6|7|8|9|10|11}} {{template|1|2|3|4|5|6|7|8|9|10|…}} Up to 10 parameters, then ellipsis.
{{tlg}} {{Template:Tlg/doc}} With no arguments, the current page name is substituted
{{tlg|template|x=u}} {{template}} Equals sign “=” won’t work
{{tlg|template|x&#61;u}} {{template|x=u}} &amp;#61; Unicode is okay
{{tlg|template|x{{=}}u}} {{template|x=u}} {{=}} template is okay
{{tlg|template|x<nowiki>=</nowiki>u}} {{template|x=u}} <nowiki>…</nowiki> tag is okay
{{tlg|template||two||}} {{template||two||}} Empty parameters work, even at the end.
Wrapping of long names (default)
Markup Renders as
{{tlg|nolink=yes|long template name that would wrap to new line|this is a long value for the 1st parameter that would wrap}} {{long template name that would wrap to new line|this is a long value for the 1st parameter that would wrap}}
Wrapping of long names (|nowrap=yes)
Markup Renders as
{{tlg|nowrap=yes|nolink=yes|long template name that would wrap to new line|long value for the 1st parameter that would wrap}} {{long template name that would wrap to new line|long value for the 1st parameter that would wrap}}
Wrapping of long names (|nowrapname=yes)
Markup Renders as
{{tlg|nowrapname=yes|nolink=yes|long template name that would wrap to new line|long value for the 1st parameter that would wrap}} {{long template name that would wrap to new line|long value for the 1st parameter that would wrap}}