mNo edit summary |
m (decomplexifying) |
||
Line 4: | Line 4: | ||
This is the '''{{tlc|{{lc:{{BASEPAGENAME}}}}}}''' template. | This is the '''{{tlc|{{lc:{{BASEPAGENAME}}}}}}''' template. | ||
This page also provides the full documentation for the templates '''{{tlx|{{#ifeq:{{lc:{{BASEPAGENAME}}}}|tlc|tld|tlc}} | This page also provides the full documentation for the templates '''{{tlx|{{#ifeq:{{lc:{{BASEPAGENAME}}}}|tlc|tld|tlc}}}}''', which work almost exactly identically. The only difference between {{tlx|tlc}} and {{tlx|tld}} is that {{tlx|tld}} does not support {{para|allowlinebreak|yes}}. | ||
== Purpose and naming == | == Purpose and naming == | ||
When a template name with braces is to be shown in documentation, the braces have to be escaped in some way so it doesn't become an actual call to the template. Instead of using <code><nowiki></nowiki></code> tags you can write it more simply and concisely by using the {{tlc|tlc}}, {{tlc|tld | When a template name with braces is to be shown in documentation, the braces have to be escaped in some way so it doesn't become an actual call to the template. Instead of using <code><nowiki></nowiki></code> tags you can write it more simply and concisely by using the {{tlc|tlc}}, {{tlc|tld}} templates. | ||
These templates work similarly to {{tlc|tl}} and {{tlc|tlx}}, but don't make the template name into a link. When writing documentation you might want to avoid a lot of unnecessary links, since they can decrease readability. So on the first occurrence of a template name use {{tlx|tl}} or {{tlx|tlx}}, and then use {{tlc|tlc}} | These templates work similarly to {{tlc|tl}} and {{tlc|tlx}}, but don't make the template name into a link. When writing documentation you might want to avoid a lot of unnecessary links, since they can decrease readability. So on the first occurrence of a template name use {{tlx|tl}} or {{tlx|tlx}}, and then use {{tlc|tlc}} or {{tlc|tld}} thereafter. | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 24: | Line 24: | ||
| {{tlc|tld}} | | {{tlc|tld}} | ||
| '''T'''emplate '''l'''ink '''d'''ialup-host | | '''T'''emplate '''l'''ink '''d'''ialup-host | ||
The three names were based on {{tlx|tl}} '''t'''emplate '''l'''ink, despite the fact that, unlike the actual {{tlc|tl}} template, these three don't include an actual link. The mnemonics for {{tlc|tld | |||
The three names were based on {{tlx|tl}} '''t'''emplate '''l'''ink, despite the fact that, unlike the actual {{tlc|tl}} template, these three don't include an actual link. The mnemonics for {{tlc|tld}} were invented after the fact, since the template creator used the single letters still available rather than the preferred {{tlc|tlt}} (using <nowiki><tt></nowiki>) and {{tlc|tln}} (using "normal", non-coded text style) monikers. | |||
===Basic operation=== | ===Basic operation=== | ||
Line 37: | Line 34: | ||
:{{tlc|tlc|name|parameters}} = {{tlc|name|parameters}} | :{{tlc|tlc|name|parameters}} = {{tlc|name|parameters}} | ||
:{{tlc|tld|name|parameters}} = {{tld|name|parameters}} | :{{tlc|tld|name|parameters}} = {{tld|name|parameters}} | ||
==Documentation== | ==Documentation== | ||
Line 53: | Line 42: | ||
* This template takes another ''template-name'' and some associated [[Help:Pipe trick|pipe-tricked]] [[m:Parameter#Parameters|(numbered) parameters]] (or 'pass parameters'), and displays them as an 'example demonstration' of how the ''template-name'' template could be coded, literally. Its primary use is in instruction and documentation. | * This template takes another ''template-name'' and some associated [[Help:Pipe trick|pipe-tricked]] [[m:Parameter#Parameters|(numbered) parameters]] (or 'pass parameters'), and displays them as an 'example demonstration' of how the ''template-name'' template could be coded, literally. Its primary use is in instruction and documentation. | ||
*Specifics here??? <!-- Coding details, other parameters (SUBST?), other notes? Cf. [[Template:Tlx]]. --> | *Specifics here??? <!-- Coding details, other parameters (SUBST?), other notes? Cf. [[Template:Tlx]]. --> | ||
*Features of {{tlc|tlc}} | *Features of {{tlc|tlc}} and {{tlc|tld}}: | ||
** They show a template name and up to eight parameters. | ** They show a template name and up to eight parameters. | ||
** They also show empty parameters. (See examples hereafter.) | ** They also show empty parameters. (See examples hereafter.) | ||
Line 64: | Line 53: | ||
{{tlc|Tld|Template|first_parameter|second|third|fourth|...|eighth}} → {{Tld|Template|first_parameter|second|third|fourth|fifth|sixth|seventh|eighth}} | {{tlc|Tld|Template|first_parameter|second|third|fourth|...|eighth}} → {{Tld|Template|first_parameter|second|third|fourth|fifth|sixth|seventh|eighth}} | ||
=== Examples === | === Examples === | ||
Line 83: | Line 71: | ||
<tr><td>{{tlc|tlc|name|one{{=}}a|two{{=}}{{))}}b}} <td>{{tlc|name|one{{=}}a|two{{=}}b}} <td>Use <code><nowiki>{{=}}</nowiki></code> in place of an equal sign, so that it gets rendered properly. | <tr><td>{{tlc|tlc|name|one{{=}}a|two{{=}}{{))}}b}} <td>{{tlc|name|one{{=}}a|two{{=}}b}} <td>Use <code><nowiki>{{=}}</nowiki></code> in place of an equal sign, so that it gets rendered properly. | ||
<tr><td>{{tlc|tlc|name|{{ | <tr><td>{{tlc|tlc|name|{{tl|IPA|/tʃ/}}|two}} <td>{{tlc|tlc|name||two}} <td>Nested template calls also cause problems ... | ||
<tr><td><code><nowiki>{{tlc|name|{{ | <tr><td><code><nowiki>{{tlc|name|{{tl|IPA|/tʃ/}}|two}}</nowiki></code> <td>{{tlc|tlc|name|{{tl|IPA|/tʃ/}}|two}} <td>... but there are ways to get around this issue, also. | ||
<tr><td><code><nowiki>{{tlc|name|IPA{{!}}/tʃ/{{))}}|two}}</nowiki></code> <td>{{tlc|tlc|name|{{ | <tr><td><code><nowiki>{{tlc|name|IPA{{!}}/tʃ/{{))}}|two}}</nowiki></code> <td>{{tlc|tlc|name|{{tl|IPA|/tʃ/}}|two}} <td>... another way to do the same thing, using <code><nowiki></nowiki></code>, <code><nowiki>{{!}}</nowiki></code> and <code><nowiki>{{))}}</nowiki></code> to insert literal <code><nowiki>{{</nowiki></code>, <code><nowiki>|</nowiki></code> and <code><nowiki>}}</nowiki></code>, respectively. | ||
</table> | </table> | ||
An alternative to using constructs such as <code><nowiki>{{=}}</nowiki></code> and <code><nowiki>{{ | An alternative to using constructs such as <code><nowiki>{{=}}</nowiki></code> and <code><nowiki>{{tl|...}}</nowiki></code> to prevent characters from getting interpreted syntactically is to use <code><nowiki><code><nowiki>...</nowiki></code></nowiki></code>, which will prevent '''all''' characters from being interpreted. For example, in place of | ||
<code><nowiki>{{tlc|name|one{{=}}{{ | <code><nowiki>{{tlc|name|one{{=}}{{tl|IPA|/tʃ/}}|two}}</nowiki></code> | ||
you can use | you can use | ||
<code><nowiki><code><nowiki>{{name|one=|two}}</nowiki></code></nowiki></code> | <code><nowiki><code><nowiki>{{name|one=|two}}</nowiki></code></nowiki></code> | ||
Line 97: | Line 85: | ||
If a vertical display with parameters on their own lines is desired, this can also be laid out manually in this manner, or more rapidly done with <code><nowiki><pre>...</pre></nowiki></code>. | If a vertical display with parameters on their own lines is desired, this can also be laid out manually in this manner, or more rapidly done with <code><nowiki><pre>...</pre></nowiki></code>. | ||
Here are the codes to emulate | Here are the codes to emulate {{tlc|tld}} and {{tlc|tlc}} using <code><nowiki></code>: | ||
{| | {| | ||
! Using templates: !! Using <code><nowiki></code>: !! Rendered result: | ! Using templates: !! Using <code><nowiki></code>: !! Rendered result: | ||
|- | |- | ||
|style="padding-right: 50px;"| <code><nowiki>{{tld|name|one{{=}}a|two{{=}}b}}</nowiki></code> | |style="padding-right: 50px;"| <code><nowiki>{{tld|name|one{{=}}a|two{{=}}b}}</nowiki></code> |
Revision as of 14:54, 22 June 2015
This is a documentation subpage for . It contains usage information, categories and other content that is not part of the original template page. |
This is the {{tlc}}
template.
This page also provides the full documentation for the templates {{tld}}
, which work almost exactly identically. The only difference between {{tlc}}
and {{tld}}
is that {{tld}}
does not support |allowlinebreak=yes
.
Purpose and naming
When a template name with braces is to be shown in documentation, the braces have to be escaped in some way so it doesn't become an actual call to the template. Instead of using <nowiki></nowiki>
tags you can write it more simply and concisely by using the {{tlc}}
, {{tld}}
templates.
These templates work similarly to {{tl}}
and {{tlx}}
, but don't make the template name into a link. When writing documentation you might want to avoid a lot of unnecessary links, since they can decrease readability. So on the first occurrence of a template name use {{tl}}
or {{tlx}}
, and then use {{tlc}}
or {{tld}}
thereafter.
Template | Mnemonic | Format differentiation | |||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{tlc}}
|
Template link code | Uses the <code>...</code> tags meant for showing programming code. Essentially the non-linking equivalent of {{tlx}} .
| |||||||||||||||||||||||||||||||||||||||||||||||
{{tld}}
|
Template link dialup-host
Basic operationHere is how these templates look. Code is to the left; actual rendering to the right:
DocumentationFunctional details
Usage
ExamplesNote: Wikitables make the
An alternative to using constructs such as
you can use
Both render as
If a vertical display with parameters on their own lines is desired, this can also be laid out manually in this manner, or more rapidly done with Here are the codes to emulate
|