Jump to content

Template:Demo inline/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m JsfasdF252 moved page Template:Demo-inline/doc to Template:Demo inline/doc: unhyphenate
nowiki tags can't nest, i.e. the first </nowiki> closes <nowiki>, so in order for the first </nowiki> to display as such, it must be escaped. This is a better workaround than before.
Line 13: Line 13:
The code
The code


<code><nowiki>{{demo-inline|<nowiki>{{USHRseats|California}}</nowiki></nowiki>{{))}}</code>
<code><nowiki>{{demo-inline|<nowiki>{{USHRseats|California}}&lt;/nowiki>}}</nowiki></code>


produces the template example:
produces the template example:

Revision as of 08:44, 27 June 2021

Usage

Used to include examples of template use in documentation pages.

Like {{demo}}, this template takes an unnamed argument in <nowiki> tags, and displays it unprocessed (as code), then as processed wikitext.

Unlike {{demo}}, this template presents the processed output on the same line as the unprocessed input, separated by an arrow. This is useful for compactly demonstrating a series of different behaviors of the same template.

Example

The code

{{demo-inline|<nowiki>{{USHRseats|California}}</nowiki>}}

produces the template example:

{{USHRseats|California}} → 52

See also