Template:Tlx/doc: Difference between revisions

From Xen
Jump to navigationJump to search
(Created page with "{{documentation subpage}} ==Usage== Code: <pre> * {{tlx|example|parameter1|parameter2...}} * {{tlx|SISTER=W:|example|parameter1|parameter2...}} </pre> Result: * {{tlx|example|pa…")
 
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 5: Line 5:
<pre>
<pre>
* {{tlx|example|parameter1|parameter2...}}
* {{tlx|example|parameter1|parameter2...}}
* {{tlx|SISTER=W:|example|parameter1|parameter2...}}
* {{tlx|SISTER=wikipedia:|example|parameter1|parameter2...}}
</pre>
</pre>
Result:
Result:
* {{tlx|example|parameter1|parameter2...}}
* {{tlx|example|parameter1|parameter2...}}
* {{tlx|SISTER=W:|example|parameter1|parameter2...}}
* {{tlx|SISTER=wikipedia:|example|parameter1|parameter2...}}


This template creates example usage syntax for a template, and links the name to the template page. The "SISTER" parameter specifies an interwiki prefix to link to another wiki.
This template creates example usage syntax for a template, and links the name to the template page. The "SISTER" parameter specifies an interwiki prefix to link to another wiki.
Line 19: Line 19:
! Remark
! Remark
|-
|-
|{{Tlx|SISTER=W:|Tlx|x0}}
|{{Tlx|SISTER=wikipedia:|Tlx|x0}}
|{{Tlx|SISTER=W:|x0}}
|{{Tlx|SISTER=wikipedia:|x0}}
||&#160;
||&#160;
|-
|-
|{{Tlx|SISTER=W:|Tlx|x1|one}}
|{{Tlx|SISTER=wikipedia:|Tlx|x1|one}}
|{{Tlx|SISTER=W:|x1|one}}
|{{Tlx|SISTER=wikipedia:|x1|one}}
||&#160;
||&#160;
|-
|-
|{{Tlx|SISTER=W:|Tlx|x2|one|two}}
|{{Tlx|SISTER=wikipedia:|Tlx|x2|one|two}}
|{{Tlx|SISTER=W:|x2|one|two}}
|{{Tlx|SISTER=wikipedia:|x2|one|two}}
||&#160;
||&#160;
|-
|-
|{{Tlx|SISTER=W:|Tlx|x3|1<tt>&#124;</tt>2<tt>&#124;</tt>3}}
|{{Tlx|SISTER=wikipedia:|Tlx|x3|1<tt>&#124;</tt>2<tt>&#124;</tt>3}}
|{{Tlx|SISTER=W:|x3|1|2|3}}
|{{Tlx|SISTER=wikipedia:|x3|1|2|3}}
||&#160;
||&#160;
|-
|-
|{{Tlx|SISTER=W:|Tlx|x4|1<tt>&#124;</tt>2<tt>&#124;</tt>3|4}}
|{{Tlx|SISTER=wikipedia:|Tlx|x4|1<tt>&#124;</tt>2<tt>&#124;</tt>3|4}}
|{{Tlx|SISTER=W:|x4|1|2|3|4}}
|{{Tlx|SISTER=wikipedia:|x4|1|2|3|4}}
|up to 7 parameters, then ...
|up to 7 parameters, then ...
|-
|-
|{{Tlx|SISTER=W:|Tlx|x4|1<tt>&#124;</tt>2<tt>&#124;</tt>3&amp;#124;4}}
|{{Tlx|SISTER=wikipedia:|Tlx|x4|1<tt>&#124;</tt>2<tt>&#124;</tt>3&amp;#124;4}}
|{{Tlx|SISTER=W:|x4|1|2|3&#124;4}}
|{{Tlx|SISTER=wikipedia:|x4|1|2|3&#124;4}}
|align="right"|<tt>&amp;#124;</tt> for more
|align="right"|<tt>&amp;#124;</tt> for more
|-
|-
|{{Tlx|SISTER=W:|Tlx|x1|x&#61;u}}
|{{Tlx|SISTER=wikipedia:|Tlx|x1|x&#61;u}}
|{{Tlx|SISTER=W:|x1|x=u}}
|{{Tlx|SISTER=wikipedia:|x1|x=u}}
|'''=''' won't work
|'''=''' won't work
|-
|-
|{{Tlx|SISTER=W:|Tlx|x1|x&amp;#61;u}}
|{{Tlx|SISTER=wikipedia:|Tlx|x1|x&amp;#61;u}}
|{{Tlx|SISTER=W:|x1|x&#61;u}}
|{{Tlx|SISTER=wikipedia:|x1|x&#61;u}}
|align="right"|<tt>&amp;#61;</tt> is okay
|align="right"|<tt>&amp;#61;</tt> is okay
|-
|-
|{{Tlx|SISTER=W:|Tlx|x1|&lt;nowiki&gt;x&#61;u&lt;/nowiki&gt;}}
|{{Tlx|SISTER=wikipedia:|Tlx|x1|&lt;nowiki&gt;x&#61;u&lt;/nowiki&gt;}}
|{{Tlx|SISTER=W:|x1|<nowiki>x=u</nowiki>}}
|{{Tlx|SISTER=wikipedia:|x1|<nowiki>x=u</nowiki>}}
|align="right"|sticky nowiki is okay
|align="right"|sticky nowiki is okay
|-
|-
|{{Tlx|SISTER=W:|Tlx|x2|&#160;|two}}
|{{Tlx|SISTER=wikipedia:|Tlx|x2|&#160;|two}}
|{{Tlx|SISTER=W:|x2| |two}}
|{{Tlx|SISTER=wikipedia:|x2| |two}}
|empty won't work
|empty won't work
|-
|-
|{{Tlx|SISTER=W:|Tlx|x2|&amp;#32;|two}}
|{{Tlx|SISTER=wikipedia:|Tlx|x2|&amp;#32;|two}}
|{{Tlx|SISTER=W:|x2|&#32;|two}}
|{{Tlx|SISTER=wikipedia:|x2|&#32;|two}}
|align="right"|<tt>&amp;#32;</tt> is okay
|align="right"|<tt>&amp;#32;</tt> is okay
|-
|-
|{{Tlx|SISTER=W:|Tlx|x2|&amp;nbsp;|two}}
|{{Tlx|SISTER=wikipedia:|Tlx|x2|&amp;nbsp;|two}}
|{{Tlx|SISTER=W:|x2|&nbsp;|two}}
|{{Tlx|SISTER=wikipedia:|x2|&nbsp;|two}}
|align="right"|<tt>&amp;nbsp;</tt> is okay
|align="right"|<tt>&amp;nbsp;</tt> is okay
|-
|-
|{{Tlx|SISTER=W:|Tlx|x2| &amp;#124; two}}
|{{Tlx|SISTER=wikipedia:|Tlx|x2| &amp;#124; two}}
|{{Tlx|SISTER=W:|x2| &#124; two}}
|{{Tlx|SISTER=wikipedia:|x2| &#124; two}}
|align="right"|<tt>&amp;#124;</tt> is okay
|align="right"|<tt>&amp;#124;</tt> is okay
|-
|-
|| {{Tlx|SISTER=W:|Tlx|x2| {&#123;!&#125;} two}}
|| {{Tlx|SISTER=wikipedia:|Tlx|x2| {&#123;!&#125;} two}}
|| {{Tlx|SISTER=W:|x2| {{!}} two}}
|| {{Tlx|SISTER=wikipedia:|x2| {{!}} two}}
|align="right"|{{Tlx|SISTER=W:|!}} is dubious
|align="right"|{{Tlx|SISTER=wikipedia:|!}} is dubious
|-
|-
|| {{Tlx|SISTER=W:|Tlx|x2|<nowiki>2=</nowiki>|<nowiki>3=two</nowiki>}}
|| {{Tlx|SISTER=wikipedia:|Tlx|x2|<nowiki>2=</nowiki>|<nowiki>3=two</nowiki>}}
|| {{Tlx|SISTER=W:|x2|2=|3=two}}
|| {{Tlx|SISTER=wikipedia:|x2|2=|3=two}}
|empty really doesn't work
|empty really doesn't work
|-
|-
|| {{Tlx|SISTER=W:|Tlx|x2|<nowiki>2=one</nowiki>|two}}
|| {{Tlx|SISTER=wikipedia:|Tlx|x2|<nowiki>2=one</nowiki>|two}}
|| {{Tlx|SISTER=W:|x2|2=one|two}}
|| {{Tlx|SISTER=wikipedia:|x2|2=one|two}}
|'''two''' clobbers '''2=one'''
|'''two''' clobbers '''2=one'''
|-
|-
|| {{Tlx|SISTER=W:|Tlx|x2|<nowiki>3=two</nowiki>|<nowiki>2=one</nowiki>}}
|| {{Tlx|SISTER=wikipedia:|Tlx|x2|<nowiki>3=two</nowiki>|<nowiki>2=one</nowiki>}}
|| {{Tlx|SISTER=W:|x2|3=two|2=one}}
|| {{Tlx|SISTER=wikipedia:|x2|3=two|2=one}}
|align="right"|right to left okay
|align="right"|right to left okay
|}
|}
Line 93: Line 93:


===Behaviour===
===Behaviour===
* Up to 7 pass parameters (numbered) for the specified template are displayed as 'placeholders', and more parameters are shown as "<tt>|</tt>''...''", for details see the [[w:Talk:Tlx/doc|the Wikipedia talk page]].
* Up to 7 pass parameters (numbered) for the specified template are displayed as 'placeholders', and more parameters are shown as "<tt>|</tt>''...''", for details see the [[wikipedia:Talk:Tlx/doc|the Wikipedia talk page]].
* If given no additional parameters except ''<code>'template name' (<nowiki>{{{1}}}</nowiki>),</code>'' it displays a simple link wrapped in braces (similar to {{[[template:tl|tl]]}}).
* If given no additional parameters except ''<code>'template name' (<nowiki>{{{1}}}</nowiki>),</code>'' it displays a simple link wrapped in braces (similar to {{[[template:tl|tl]]}}).

Latest revision as of 12:32, 5 December 2011

Usage

Code:

* {{tlx|example|parameter1|parameter2...}}
* {{tlx|SISTER=wikipedia:|example|parameter1|parameter2...}}

Result:

  • {{example|parameter1|parameter2...}}
  • {{example|parameter1|parameter2...}}

This template creates example usage syntax for a template, and links the name to the template page. The "SISTER" parameter specifies an interwiki prefix to link to another wiki.

Examples

Code Result Remark
{{Tlx|x0}} {{x0}}  
{{Tlx|x1|one}} {{x1|one}}  
{{Tlx|x2|one|two}} {{x2|one|two}}  
{{Tlx|x3|1|2|3}} {{x3|1|2|3}}  
{{Tlx|x4|1|2|3|4}} {{x4|1|2|3|4}} up to 7 parameters, then ...
{{Tlx|x4|1|2|3&#124;4}} {{x4|1|2|3|4}} &#124; for more
{{Tlx|x1|x=u}} {{x1}} = won't work
{{Tlx|x1|x&#61;u}} {{x1|x=u}} &#61; is okay
{{Tlx|x1|<nowiki>x=u</nowiki>}} {{x1|x=u}} sticky nowiki is okay
{{Tlx|x2| |two}} {{x2|two}} empty won't work
{{Tlx|x2|&#32;|two}} {{x2| |two}} &#32; is okay
{{Tlx|x2|&nbsp;|two}} {{x2| |two}} &nbsp; is okay
{{Tlx|x2| &#124; two}} {{x2| | two}} &#124; is okay
{{Tlx|x2| {{!}} two}} {{x2| | two}} {{!}} is dubious
{{Tlx|x2|2=|3=two}} {{x2|two}} empty really doesn't work
{{Tlx|x2|2=one|two}} {{x2|two}} two clobbers 2=one
{{Tlx|x2|3=two|2=one}} {{x2|one|two}} right to left okay

Technical documentation

Naming

The name is derived from "Template list expanded".

Behaviour

  • Up to 7 pass parameters (numbered) for the specified template are displayed as 'placeholders', and more parameters are shown as "|...", for details see the the Wikipedia talk page.
  • If given no additional parameters except 'template name' ({{{1}}}), it displays a simple link wrapped in braces (similar to {{tl}}).