Template:Tc/doc

From Angelina Jordan Wiki
Revision as of 11:34, 11 November 2020 by Dcljr (talk | contribs) (+ cat:illus markup)
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", 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.

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

Usage

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

The third form shows how to display more than one parameter. Any number of them can be separated by {{!}}. (Even though treating the first parameter differently from the rest is not actually necessary for this template, since it doesn't form a wikilink, the syntax of Template:Tl and Template:Tlnc has been retained here for consistency and therefore ease of learning/remembering how to use all these similar templates.)

Examples

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

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

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

See also

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