模板:Tlc/doc:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
创建页面,内容为“{{Documentation subpage}} <!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> {{Uses TemplateStyles|Template:Nowrap/styles.css}} __TOC__ {{-}} == 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 {{tag|nowiki}} tags you can write it more simply and concisely by using the…”
 
Kangkk​(留言 | 贡献)
 
(未显示同一用户的6个中间版本)
第1行: 第1行:
{{Documentation subpage}}
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata -->
{{Uses TemplateStyles|Template:Nowrap/styles.css}}
__TOC__
{{-}}
== 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 {{tag|nowiki}} tags you can write it more simply and concisely by using the {{tlc|tlc}} template.
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>…‎</nowiki></nowiki></code> tags you can write it more simply and concisely by using the {{tlc|tlc}} template.


It works similarly to {{tlc|tl}} and {{tlc|tlx}}, but doesn'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}} thereafter.
It works similarly to {{tlc|tl}} and {{tlc|tlx}}, but doesn'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}} thereafter.
第33行: 第28行:
=== Examples ===
=== Examples ===


Note: Wikitables make the {{tag|code}} tags transparent, unfortunately, so the "<code>code colouring</code>" is missing in these examples.  
Note: Wikitables make the <code><nowiki><code>…‎</code></nowiki></code> tags transparent, unfortunately, so the "<code>code colouring</code>" is missing in these examples.  


<table class="wikitable">
<table class="wikitable">
第57行: 第52行:
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 {{tag|pre}}.
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 {{tag|pre}}.


Here is the code to emulate {{tlc|tlc}} using {{tag|nowiki|open}}:
Here is the code to emulate {{tlc|tlc}} using <code>‎<nowiki><nowiki></nowiki></code>:


{|
{|
! Using templates: !! Using {{tag|nowiki|open}}: !! Rendered result:  
! Using templates: !! Using nowiki tag: !! Rendered result:  
|-
|-
|style="padding-right: 50px;"| <code><nowiki>{{tlc|name|one{{=}}a|two{{=}}b}}</nowiki></code>
|style="padding-right: 50px;"| <code><nowiki>{{tlc|name|one{{=}}a|two{{=}}b}}</nowiki></code>
第68行: 第63行:


== TemplateData ==
== TemplateData ==
{{TemplateData header}}
<templatedata>
<templatedata>
{
{