Template:Tlc/doc: Difference between revisions
meta>Davidgothberg Some wording. |
meta>Davidgothberg Starting to look good. |
||
| Line 4: | Line 4: | ||
This is the {{tlc|tlc}} template. | This is the {{tlc|tlc}} template. | ||
First a short example: | |||
This page is also the documentation for some other templates: | <pre> | ||
* {{tld|tld}} – | {{tlc|template name|parameters}} | ||
* {{tlf|tlf}} – | </pre> | ||
Renders like this: | |||
:{{tlc|template name|parameters}} | |||
This page is also the documentation for some other templates that work almost exactly the same: | |||
* {{tld|tld}} – Looks like this: {{tld|name|parameter}} | |||
* {{tlf|tlf}} – Looks like this: {{tlf|name|parameter}} | |||
These templates help writing documentation which mentions {{tlc|templates}}, or even {{tlc|templates|that|has|parameters}}. They 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}}. | 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 14: | Line 23: | ||
Features of {{tlc|tlc}}, {{tld|tld}} and {{tlf|tlf}}: | Features of {{tlc|tlc}}, {{tld|tld}} and {{tlf|tlf}}: | ||
* They show a template name and up to eight parameters. | * They show a template name and up to eight parameters. | ||
* They | * They also show empty parameters. (See examples below.) | ||
* They prevent [[line wrap]]s in their output. | * They prevent [[line wrap]]s in their output. | ||
=== Examples === | === Examples === | ||
Wikitables | Wikitables make the <code><code></code> tags transparent, that's why the "<code>code colouring</code>" is missing in these examples. | ||
<table class="wikitable"> | <table class="wikitable"> | ||
Revision as of 08:00, 21 March 2008
| This is a documentation subpage for Template:Tlc. It may contain usage information, categories and other content that is not part of the original template page. |
This is the {{tlc}} template.
First a short example:
{{tlc|template name|parameters}}
Renders like this:
{{template name|parameters}}
This page is also the documentation for some other templates that work almost exactly the same:
{{tld}}– Looks like this:{{name|parameter}}- {{tlf}} – Looks like this: {{name|parameter}}
These templates help writing documentation which mentions {{templates}}, or even {{templates|that|has|parameters}}. They 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> tags transparent, that's why the "code colouring" is missing in these examples.
| Code | Result | Comment |
|---|---|---|
{{tlc}} | Lua error in Module:Template_link_general at line 136: attempt to concatenate local 'titlePart' (a nil value). | 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|i}} | 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. |
See also
- {{tlx}}