Template:Template name explanation/doc
Documentation
This template renders text in a monospace font (in which all the characters have the same width — also known as "typewriter type" and matching the rendering of the <tt> HTML element), and allows you to easily alternate between regular text and underlined text, which allows for easy formatting of "mnemonic" phrases explaining the names of certain templates. (See below to understand what the heck that means.)
Usage
{{template name explanation|underlined|and regular|text|alternating|…}}{{template name explanation|underlined|and regular|text|alternating|…|first=|second=|this=|the phrase=|quote-only=|.=}}
Up to 9 underlined segments can be shown (and as many non-underlined segments). If you need more than that… why the heck would need more than that??
The optional named parameters first and second can be used to format two different phrases in the same sentence. See the examples below.
The optional parameters this, the phrase, and . allow you to override those specific parts of the output. Again, see the examples below.
If you set the optional parameter quote-only to a true value, the output is restricted to only the quoted part, omitting the beginning of the sentence and the final punctuation.
Examples
{{template name explanation}}
⇒ The name of this template is based on the phrase "".{{template name explanation|t|ypewriter |t|ype with |u|nder|l|ining}}
⇒ The name of this template is based on the phrase "typewriter type with underlining".{{template name explanation||e|xternal |l|link}}
⇒ The name of this template is based on the phrase "external link".{{template name explanation|abbr|eviation|the phrase=the word}}
⇒ The name of this template is based on the word "abbreviation".{{template name explanation|…|this=the}}
⇒ The name of the template is based on the phrase "…".{{template name explanation|A|.=}}or perhaps{{template name explanation|B|quote-only=y}}.
⇒ The name of this template is based on the phrase "A" or perhaps "B".{{template name explanation|A|first=y}}or perhaps{{template name explanation|B|second=y}}
⇒ The name of this template is based on the phrase "A" or perhaps "B".
The point of using this=the in the fifth example is to avoid over-using the word "this" in cases where that word has already been used multiple times in the text immediately preceding or following the call to this template.
As seen in the third example, if the first bit of text is not to be underlined, just leave the first positional parameter empty.
The last two examples are almost equivalent ways of suggesting two different mnemonic phrases. Notice how you have to provide your own final punctuation after the second template call using quote-only but not when using second.