Template:Tc

From Miranda NG
Jump to: navigation, search

{{Tc|...}}

Template documentation[view] [edit] [history] [purge]

This page provides documentation for {{Tc}}.

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 {{Tc}} template.

This template works similarly to {{Tl}}, 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}}, and then use {{Tc}}.


Functional details

  • This template takes another template-name and some associated pipe-tricked (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.
  • Features:
    • shows a template name and a lot of parameters,
    • also show empty parameters, (See examples hereafter.)
    • prevent line wraps in their output by default. (Can be changed using the linewrap=yes parameter.)


Usage

{{Tc|Template|first_parameter|second|third|fourth|...|eighth}}{{Template|first_parameter|second|third|fourth|fifth|sixth|seventh|eighth}}


Examples

Todo: needs revision, adjustments

Note: Wikitables make the <code></code> tags transparent, unfortunately, so the "code colouring" is missing in these examples.

CodeResultComment
{{Tc}} {{Tc|...}} Shows its own syntax.
{{Tc|name}} {{name}}
{{Tc|name|one}} {{name|one}}
{{Tc|name|one|two}} {{name|one|two}}
{{Tc|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.
{{Tc|name}} {{name}} Also shows empty parameters.
{{Tc|name}} {{name}} Even shows empty parameters that come in the end.
{{Tc|name|one=a|two=b}} {{name}} The use of equal signs is a problem, but there is a fix; see next row.
{{Tc|name|one{{=}}a|two{{=}}b}} {{name|one=a|two=b}} Use {{=}} in place of an equal sign, so that it gets rendered properly.
{{Tc|name|<code>{{IPA|/tʃ/}}</code>|two}} {{Tc|name|Template:IPA|two}} Nested template calls also cause problems ...
{{Tc|name|{{Tc|IPA|/tʃ/}}|two}} {{Tc|name|<code>{{IPA|/tʃ/}}</code>|two}} ... but there are ways to get around this issue, also.
{{Tc|name|{{((}}IPA{{!}}/tʃ/{{))}}|two}} {{Tc|name|<code>{{IPA|/tʃ/}}</code>|two}} ... another way to do the same thing, using {{((}}, {{!}} and {{))}} to insert literal {{, | and }}, respectively.

See also

</div>

Navigation menu