Content deleted Content added
m sl:Predloga:Tlsc |
HouseBlaster (talk | contribs) m HouseBlaster moved page Template:Tlsc/doc to Template:Template link code with subst/doc: expand template name per WP:TPN |
||
(10 intermediate revisions by 8 users not shown) | |||
Line 1:
{{Documentation subpage}}
{{High-use}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
This is the '''{{tlc|tlsc}}''' template.
This page also provides the full documentation for the
== 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|tlsc}}
These templates work similarly to {{tlc|tls}} and {{tlc|tlsp}}, 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|tls}} or {{tlx|tlsp}}, and then use {{tlc|tlsc
{| class="wikitable"
Line 20 ⟶ 21:
| {{tlc|tlsc}}
| '''T'''emplate '''l'''ink '''s'''ubstitution '''c'''ode
| Uses the <code><nowiki><code>...</code></nowiki></code> tags meant for showing programming code. Essentially the non-linking equivalent of {{tlx|tlsx}}.
|-▼
|-
| {{tlc|tlsf}}
Line 31 ⟶ 28:
|}
The
===Basic operation===
Line 38 ⟶ 35:
:{{tlc|tlsc|name|parameters}} = {{tlsc|name|parameters}}
:{{tlc|tlsf|name|parameters}} = {{tlsf|name|parameters}}
Line 55 ⟶ 51:
* 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]] -->
*Features of {{tlc|tlsc
** They show the "subst:" needed in order to substitute a template.
** They show a template name and up to eight parameters.
Line 71 ⟶ 67:
=== Examples ===
{| class="wikitable" style="background: transparent"
▲|-
▲<tr><th>Code<th>Result<th>Comment
|-
▲<tr><td>{{tlc|tlsc}} <td>{{tlsc}} <td>Shows its own syntax.
|-
|-
<tr><td><code><nowiki>{{tlsc|name|a|b|c|d|e|f|g|h|i|j}}</nowiki></code> <td>{{tlsc|name|a|b|c|d|e|f|g|h|i}} <td>Shows up to eight parameters. The rest are dropped.▼
|-
<tr><td>{{tlc|tlsc|name|||three||}} <td>{{tlsc|name|||three||}} <td>Even shows empty parameters that come in the end.▼
▲
|-
<tr><td>{{tlc|tlsc|name|3=one=a|4=two=b}} <td>{{tlsc|name|one=a|two=b}} <td>The use of equals signs is a problem, but there is a fix; see next row.▼
| {{tlc|tlsc|name|||three|four}} || {{tlsc|name|||three|four}} || Also shows empty parameters.
<tr><td>{{tlc|tlsc|name|3=2=one=a|4=3=two=b}} <td>{{tlsc|name|2=one=a|3=two=b}} <td>Use numbered parameters to fix the problem with equals signs. Remember to start from 2, since the "name" is number 1.▼
|-
▲
|-
▲
|-
▲
|}
* '''''Exceptions:''''' If the intended template lists numerous/keyword parameters, then perhaps this template should really ''not'' be used, and just hardcode the usage with <code><nowiki><code><nowiki></nowiki></code>, for example: <code><nowiki><code><nowiki>{{Anytemplate|arg1=23|size=250px|</nowiki><var>other parameters...</var><nowiki>}}</nowiki></code></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>.
Line 93 ⟶ 95:
:<code><nowiki><nowiki>{{subst:name|one=a|two=b}}</nowiki></nowiki></code> = <nowiki>{{subst:name|one=a|two=b}}</nowiki>
:<code><nowiki><tt><nowiki>{{subst:name|one=a|two=b}}</nowiki></tt></nowiki></code> = <
:<code><nowiki><code><nowiki>{{subst:name|one=a|two=b}}</nowiki></code></nowiki></code> = <code><nowiki>{{subst:name|one=a|two=b}}</nowiki></code>
Line 100 ⟶ 102:
* {{tl|tlsc}} – Not linked, several parameters and text in <code><code></code></code> style.
* {{tl|tlsf}} – Not linked, several parameters and normal text style.
* {{tl|tls}} – Template link, no parameters and normal text style.
* {{tl|tlsp}} – Template link, several parameters and interwiki links.
* {{tl|tlsx}} – Template link, several parameters and interwiki links, <
<includeonly>{{Sandbox other||
<!--
[[Category:
[[Category:Wikitext typing-aid templates]]
[[sl:Predloga:Tlsc]]
}}</includeonly>
|