Template:Code demo/doc: Difference between revisions

From NPOWiki
Jump to navigation Jump to search
(generic category)
(cat)
 
Line 13: Line 13:
*<code><nowiki>{{code demo|''[[some link]]''|x}}</nowiki></code> produces: {{code demo|''[[some link]]''|x}}
*<code><nowiki>{{code demo|''[[some link]]''|x}}</nowiki></code> produces: {{code demo|''[[some link]]''|x}}


<includeonly>[[Category:Templates]]</includeonly>
<includeonly>[[Category:Formatting templates]]</includeonly>

Latest revision as of 12:14, 14 July 2021

This page contains the documentation for Template:Code demo. It includes information about the template, such as usage and categories, and is not displayed when using the template itself.

This is a shortcut for wrapping some wikitext in code and nowiki tags. By default, it also shows the result of the wikitext.

Unfortunately, it cannot be used with template code, because it is expanded before it can be nowiki'd.

Parameters

  • First unnamed parameter: the wikitext to display.
  • Second unnamed parameter: if this is not defined, the template will show the actual output of the wikitext.

Examples

  • {{code demo|[[Lord of Darkness|LoD]]}} produces the following: [[Lord of Darkness|LoD]] produces: LoD
  • {{code demo|''[[some link]]''|x}} produces: ''[[some link]]''