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)
(No difference)

Revision as of 17:08, 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

  • first parameter (mandatory): the name of the tag
  • second parameter: what type of tag to display, valid values are
    • p or pair: display a matched pair (open-and-closed) of tags
      • To suppress the ellipsis which appears between the tags, add an empty |content= parameter
    • 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
  • |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 />


Markup → renders as:
{{Xtag|syntaxhighlight|p|params=enclose="div" lang="text"}}<syntaxhighlight enclose="div" lang="text">…</syntaxhighlight>

See also