Template:Xtag/doc: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
(Rewrite stock documentation from Mediawiki projects for this template to suit Kodi Wiki)
 
(Fix categorization)
 
Line 6: Line 6:
{{Glossary}}
{{Glossary}}
{{Term|Parser tags}}
{{Term|Parser tags}}
{{Defn|defn=
{{Defn|1={{Xtag|gallery}}, {{Xtag|includeonly}}, {{Xtag|noinclude}}, {{Xtag|nowiki}}, {{Xtag|onlyinclude}} and {{Xtag|pre}}}}
{{Xtag|gallery}}, {{Xtag|includeonly}}, {{Xtag|noinclude}}, {{Xtag|nowiki}}, {{Xtag|onlyinclude}} and {{Xtag|pre}}
}}


{{Term|Extension tags}}
{{Term|Extension tags}}
{{Defn|1={{Xtag|categorytree}}, {{Xtag|dpl}}, {{Xtag|dynamicpagelist}}, {{Xtag|imagemap}}, {{Xtag|indicator}}, {{Xtag|inputbox}}, {{Xtag|poem}}, {{Xtag|ref}}, {{Xtag|references}}, {{Xtag|section}} and {{Xtag|syntaxhighlight}} (alias {{Xtag|source}})}}
{{Defn|1={{Xtag|categorytree}}, {{Xtag|dpl}}, {{Xtag|dynamicpagelist}}, {{Xtag|imagemap}}, {{Xtag|indicator}}, {{Xtag|inputbox}}, {{Xtag|poem}}, {{Xtag|ref}}, {{Xtag|references}}, {{Xtag|section}} and {{Xtag|syntaxhighlight}} (alias {{Xtag|source}})}}
{{Glossary end}}


=== Parameters ===
=== Parameters ===
* '''first parameter''' ''(mandatory)'': the name of the tag
* '''unnamed first parameter''' or '''{{Para|1}}''' ''(mandatory)'': the name of the tag
* '''second parameter''': what type of tag to display, valid values are
* '''unnamed second parameter''' or '''{{Para|2}}''' ''(optional)'': what type of tag to display; valid values are
** <code>p</code> or <code>pair</code>: display a matched pair (open-and-closed) of tags
*** To suppress the ellipsis which appears between the tags, add an empty {{Para|content}} parameter
** <code>o</code> or <code>open</code> ''(default)'': display only the opening tag of an open-and-closed pair
** <code>o</code> or <code>open</code> ''(default)'': display only the opening tag of an open-and-closed pair
** <code>c</code> or <code>close</code>: display only the closing tag of an open-and-closed pair
** <code>c</code> or <code>close</code>: display only the closing tag of an open-and-closed pair
** <code>s</code> or <code>single</code>: display a single, self-closing tag
** <code>s</code> or <code>single</code>: display a single, self-closing tag
** <code>p</code> or <code>pair</code>: display a matched pair of tags (open-and-closed)
*** To suppress the ellipsis (<code>…</code>) which appears between the tags, add an empty {{Para|content}} parameter
* '''{{Para|content}}''' the text shown between the tags
* '''{{Para|content}}''' the text shown between the tags
* '''{{Para|params}}''' any parameters to be included in the opening tag
* '''{{Para|params}}''' any parameters to be included in the opening tag


==== Examples ====
=== Examples ===
Markup &rarr; renders as:<br />
''Markup &rarr; renders as''<br />
<code><nowiki>{{Xtag|nowiki}}</nowiki></code> &rarr; {{Xtag|nowiki}}


<code><nowiki>{{Xtag|nowiki|s}}</nowiki></code> &rarr; {{Xtag|nowiki|s}}
:<code><nowiki>{{Xtag|nowiki}}</nowiki></code> &rarr; {{Xtag|nowiki}}


:<code><nowiki>{{Xtag|nowiki|s}}</nowiki></code> &rarr; {{Xtag|nowiki|s}}


Markup &rarr; renders as:<br />
:<code><nowiki>{{Xtag|syntaxhighlight|p|params=enclose="div" lang="text"}}</nowiki></code> &rarr; {{Xtag|syntaxhighlight|p|params=enclose="div" lang="text"}}
<code><nowiki>{{Xtag|syntaxhighlight|p|params=enclose="div" lang="text"}}</nowiki></code> &rarr; {{Xtag|syntaxhighlight|p|params=enclose="div" lang="text"}}


=== See also ===
=== See also ===
Line 38: Line 36:




{{Sandbox other||<!----Categories below this line, please:---->
<!----Categories below this line, please:---->
[[Category:HTML typing-aid templates]]
[[Category:Formatting templates]]
[[Category:Wikitext typing-aid templates]]
[[Category:Wiki templates]]</includeonly>
[[Category:Wikipedia XHTML tag-replacing templates| ]]
}}</includeonly>

Latest revision as of 23:24, 5 March 2022

This template outputs a formatted MediaWiki parser or extension tag that links to the help or extension page about it. It is similar in function and behavior to {{Tag}}, but it links the tag and defaults to an open value for the second positional (unnamed) parameter.

Parser and extension tags

For a machine-generated list, see Special:Version#mw-version-parser-extensiontags, it may include tags not documented here.

Parser tags
<gallery>, <includeonly>, <noinclude>, <nowiki>, <onlyinclude> and <pre>
Extension tags
<categorytree>, <DPL>, <DynamicPageList>, <imagemap>, <indicator>, <inputbox>, <poem>, <ref>, <references>, <section> and <syntaxhighlight> (alias <source>)

Parameters

  • unnamed first parameter or |1= (mandatory): the name of the tag
  • unnamed second parameter or |2= (optional): what type of tag to display; valid values are
    • o or open (default): display only the opening tag of an open-and-closed pair
    • c or close: display only the closing tag of an open-and-closed pair
    • s or single: display a single, self-closing tag
    • p or pair: display a matched pair of tags (open-and-closed)
      • To suppress the ellipsis () which appears between the tags, add an empty |content= parameter
  • |content= the text shown between the tags
  • |params= any parameters to be included in the opening tag

Examples

Markup → renders as

{{Xtag|nowiki}}<nowiki>
{{Xtag|nowiki|s}}<nowiki />
{{Xtag|syntaxhighlight|p|params=enclose="div" lang="text"}}<syntaxhighlight enclose="div" lang="text">…</syntaxhighlight>

See also