Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Tlc/doc: Difference between revisions

Template page
Trying even more newbie friendly documentation. But really, this is a template that should be used by template programmers...
Some additions to the doc.
Line 8: Line 8:
When showing a template name with brackets in documentation you have to escape the brackets in some way so it doesn't become a call to the template. Instead of using <code>&lt;nowiki>&lt;/nowiki></code> tags you can write it simpler and shorter by using these templates.  
When showing a template name with brackets in documentation you have to escape the brackets in some way so it doesn't become a call to the template. Instead of using <code>&lt;nowiki>&lt;/nowiki></code> tags you can write it simpler and shorter by using these templates.  


:{{tlc|tlc|name|parameters}} renders {{tlc|name|parameters}}
Here is how these templates look. Code to the left and actual rendering to the right:
:{{tlc|tld|name|parameters}} renders {{tld|name|parameters}}
 
:{{tlc|tlf|name|parameters}} renders {{tlf|name|parameters}}
:{{tlc|tlc|name|parameters}} = {{tlc|name|parameters}}
:{{tlc|tld|name|parameters}} = {{tld|name|parameters}}
:{{tlc|tlf|name|parameters}} = {{tlf|name|parameters}}


These templates work similarly to {{tl|tl}} and {{tlx|tlx}}, but they don't make the template name into a link. When writing documentation you might want to avoid a lot of unnecessary links, since it decreases readability. So on the first occurrence of a template name use {{tl|tl}} or {{tlx|tlx}}, and then use {{tlc|tlc}}, {{tld|tld}} or {{tlf|tlf}}.
These templates work similarly to {{tl|tl}} and {{tlx|tlx}}, but they don't make the template name into a link. When writing documentation you might want to avoid a lot of unnecessary links, since it decreases readability. So on the first occurrence of a template name use {{tl|tl}} or {{tlx|tlx}}, and then use {{tlc|tlc}}, {{tld|tld}} or {{tlf|tlf}}.
Line 40: Line 42:
=== See also ===
=== See also ===


* {{tl|tld}}
* {{tl|tlc}} – Not linked, several parameters and text in <code>&lt;code>&lt;/code></code> style.
* {{tl|tlf}}
* {{tl|tld}} – Not linked, several parameters and <tt>teletype</tt> text style.
* {{tl|tlf}} – Not linked, several parameters and normal text style.


* {{tl|tlx}}
* {{tl|tl}} –  Template link, no parameters.
* {{tl|tl}}
* {{tl|tlx}} – Template link, several parameters and interwiki links, wide text style.
* {{tl|tn}} – Same as tl, but shows the braces as part of the link.


<includeonly>
<includeonly>

Revision as of 22:05, 27 March 2008

This is the {{tlc}} template.

This page is also the documentation for {{Tld}} and {{Tlf}} that work almost exactly the same.

When showing a template name with brackets in documentation you have to escape the brackets in some way so it doesn't become a call to the template. Instead of using <nowiki></nowiki> tags you can write it simpler and shorter by using these templates.

Here is how these templates look. Code to the left and actual rendering to the right:

{{tlc|name|parameters}} = {{name|parameters}}
{{tld|name|parameters}} = {{name|parameters}}
{{tlf|name|parameters}} = {{name|parameters}}

These templates work similarly to {{Tl}} and {{tlx}}, but they don't make the template name into a link. When writing documentation you might want to avoid a lot of unnecessary links, since it decreases readability. So on the first occurrence of a template name use {{Tl}} or {{tlx}}, and then use {{tlc}}, {{tld}} or {{tlf}}.

Features of {{tlc}}, {{tld}} and {{tlf}}:

  • They show a template name and up to eight parameters.
  • They also show empty parameters. (See examples below.)
  • They prevent line wraps in their output.

Examples

Wikitables make the <code></code> tags transparent, that's why the "code colouring" is missing in these examples.

CodeResultComment
{{tlc}} {{{{{1}}}}} Shows its own syntax.
{{tlc|name}} {{name}}
{{tlc|name|one}} {{name|one}}
{{tlc|name|one|two}} {{name|one|two}}
{{tlc|name|a|b|c|d|e|f|g|h|i|j}} {{name|a|b|c|d|e|f|g|h}} Shows up to eight parameters. The rest are dropped.
{{tlc|name|||three|four}} {{name|||three|four}} Also shows empty parameters.
{{tlc|name|||three||}} {{name|||three||}} Even shows empty parameters that come in the end.
{{tlc|one=a|two=b}} {{name}} Equal signs is a problem, but there is a fix.
{{tlc|name|2=one=a|3=two=b}} {{name|one=a|two=b}} Use numbered parameters to fix it. Remember to start from 2, since the "name" is number 1.

See also

  • {{Tlc}} – Not linked, several parameters and text in <code></code> style.
  • {{Tld}} – Not linked, several parameters and teletype text style.
  • {{Tlf}} – Not linked, several parameters and normal text style.
  • {{Tl}} – Template link, no parameters.
  • {{Tlx}} – Template link, several parameters and interwiki links, wide text style.
  • {{Tn}} – Same as tl, but shows the braces as part of the link.


Cookies help us deliver our services. By using our services, you agree to our use of cookies.