Template:Tl/doc: Difference between revisions

From OBA Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
Line 17: Line 17:
{| class="wikitable"
{| class="wikitable"
! Code
! Code
! Result
|-
|-
| <code><nowiki>{{Tl|Void}}</nowiki></code>
| <code><nowiki>{{Tl|Void}}</nowiki></code>
| {{[[Template:Void|Void]]}}
|-
|-
| <code><nowiki>{{Tl2|X1}}</nowiki></code>
| <code><nowiki>{{Tl2|X1}}</nowiki></code>
| <tt><nowiki>{{</nowiki>[[{{{LANG|}}}{{{SISTER|}}}{{ns:Template}}:X1|X1]]<nowiki>}}</nowiki></tt>
|-
|-
| <code><nowiki>{{Tl2|SISTER=M:|3x}}</nowiki></code>
| <code><nowiki>{{Tl2|SISTER=M:|3x}}</nowiki></code>
| <tt><nowiki>{{</nowiki>[[{{{LANG|}}}M:{{ns:Template}}:3x|3x]]<nowiki>}}</nowiki></tt>
|-
|-
| <code><nowiki>{{Tl2|SISTER=wikibooks|LANG=de:|WP}}</nowiki></code>
| <code><nowiki>{{Tl2|SISTER=wikibooks|LANG=de:|WP}}</nowiki></code>
| <tt><nowiki>{{</nowiki>[http://de.wikibooks.org/wiki/Vorlage:WP WP]<nowiki>}}</nowiki></tt><!---
<!---
----- This is currently a fraudulent output result... the template code needs modified to work
----- This is currently a fraudulent output result... the template code needs modified to work
----- per this plan, then this /doc file fixed up to match whatever the correct syntax actually is.
----- per this plan, then this /doc file fixed up to match whatever the correct syntax actually is.
Line 38: Line 34:
|-
|-
| <code><nowiki>{{Tl|1==)}}</nowiki></code>
| <code><nowiki>{{Tl|1==)}}</nowiki></code>
| {{Tl|1==)}}
|}
|}



Latest revision as of 14:17, 5 April 2012

{{#invoke:Message box|mbox}}


The template link template is a simple macro template used to display a template name as a link surrounded by braces, thus showing how the template name would be used in code. Its primary use is in instruction and documentation. A short example is that the code:

{{Tl|Example}}
generates
{{Example}}

More complex variations are described below.

Example

Code
{{Tl|Void}}
{{Tl2|X1}}
{{Tl2|SISTER=M:|3x}}
{{Tl2|SISTER=wikibooks|LANG=de:|WP}}
{{Tl|1==)}}

See also

Template linking templates
Link Style Linked Unlinked Linked with subst: Linked including braces Linked with alternative text
Text Style main|code=on}} option -- <syntaxhighlight lang="text" class="" id="" style="" inline="1">nolink=yes</syntaxhighlight> <syntaxhighlight lang="text" class="" id="" style="" inline="1">subst=yes</syntaxhighlight> <syntaxhighlight lang="text" class="" id="" style="" inline="1">braceinside=yes</syntaxhighlight> <syntaxhighlight lang="text" class="" id="" style="" inline="1">alttext=FOO</syntaxhighlight>
Normal -- main|code=on}}, {{#Invoke:Template link general|main|code=on}}; {{#Invoke:Template link general|main|code=on}} main|code=on}} main|code=on}}, {{#Invoke:Template link general|main|code=on}} main|code=on}} main|code=on}}
Teletype <syntaxhighlight lang="text" class="" id="" style="" inline="1">tt=yes</syntaxhighlight> main|code=on}} main|code=on}} main|code=on}}
Bold <syntaxhighlight lang="text" class="" id="" style="" inline="1">bold=yes</syntaxhighlight> main|code=on}}
Bold Teletype <syntaxhighlight lang="text" class="" id="" style="" inline="1">bold=yes|tt=yes</syntaxhighlight> main|code=on}}
Italic Teletype <syntaxhighlight lang="text" class="" id="" style="" inline="1">italic=yes|tt=yes</syntaxhighlight> main|code=on}}
Code <syntaxhighlight lang="text" class="" id="" style="" inline="1">code=yes</syntaxhighlight> main|code=on}}
NOTE: {{#Invoke:Template link general|main|code=on}} is the most general, allowing any combination of the above options.