模板:Tlc/doc:修订间差异
来自康健生活
无编辑摘要 |
|||
| (未显示同一用户的5个中间版本) | |||
| 第1行: | 第1行: | ||
== 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 | 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. | ||
| 第28行: | 第28行: | ||
=== Examples === | === Examples === | ||
Note: Wikitables make the | 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"> | ||
| 第52行: | 第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 | Here is the code to emulate {{tlc|tlc}} using <code><nowiki><nowiki></nowiki></code>: | ||
{| | {| | ||
! Using templates: !! Using | ! 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> | ||
| 第63行: | 第63行: | ||
== TemplateData == | == TemplateData == | ||
<templatedata> | <templatedata> | ||
{ | { | ||