Template:Tc/doc

From Angelina Jordan Wiki
Revision as of 03:21, 22 June 2024 by Dcljr (talk | contribs) (heh…)
This is a subpage documenting Template:Tc. To change the template, edit that page; to change the template's documentation (seen below), edit this one.

Documentation

This template is used to display the wiki markup that would form a call to a template (i.e., using double curly-braces: {{}}). Unlike Template:Tl and Template:Tlnc, the name of the template is not linked to the template page. This should only be used on talk pages or in template documentation (or help pages, user pages, etc.), not in articles. If no input is given to the template, it uses the phrase "template call" (as seen above), but this can be suppressed by passing the template empty input (i.e., {{tc|}} — see examples below).

This template styles the template call as code, {{like this}}. To display it as plain text, {{like this}}, use Template:Tcnc.

If you want the template name to be linked to the template page, use Template:Tl or Template:Tlnc.

The name of this template is based on the phrase "template call".

This template is used on a great many pages. Making any changes to it will cause lots of jobs to be added to the processing queue.

Usage

  • {{tc|template name}}
  • {{tc|template name|parameter}}
  • {{tc|template name|parameter1|parameter2|}}

Up to 19 parameters can be displayed. If you need more, use {{param-var}}.

Examples

  • {{tc}}{{template call}}
  • {{tc|}}{{}}
  • {{tc|tc{{!}}}}{{tc|}}
  • {{tc|code}}{{code}}
  • {{tc|code|span}}{{code|span}}
  • {{tc|abbr|NOK|Norwegian krone}}{{abbr|NOK|Norwegian krone}}
  • {{tc|ytv|v{{=}}|t{{=}}|linktext{{=}}}}{{ytv|v=|t=|linktext=}}

As seen in the last example, when illustrating calls with multiple named parameters, there is little benefit in using this template over simply wrapping the entire sample template call in <nowiki> tags. In particular, the same thing could be accomplished by doing:

  • <code><nowiki>{{ytv|v=|t=|linktext=}}</nowiki></code>{{ytv|v=|t=|linktext=}}

Note that there are also variations on this template that can make such things even easier. These are listed below.

See also

  • {{tcnc}} — same as this template, but renders the template link as plain text (not code)
  • {{tl}} — similar to this template, but links the template name

Other similar templates for specific use cases:

  • {{tc-names}} — to list named parameters with no values, like {{ytv|v=|t=|linktext=}} or {{ytv|v= |t= |linktext=}}
  • {{tc-nameval}} — to show a concrete example with name-value pairs, like {{ytv|v=-wKoZlapqgg|linktext=Love Don't Let Me Go}}
  • {{tc-namevar}} — to show name-value pairs with generic (variable) values, like {{ytv|v=video ID|linktext=text to be linked}}
  • {{tc-numvar}} — to show numerical parameters with generic (variable) values, like {{ytv|1=video ID|2=text to be linked}}
  • {{tc-var}} — to explain positional parameters using generic (variable) values, like {{ytv|video ID|text to be linked}}