Template:Xtag/doc: Difference between revisions
Jump to navigation
Jump to search
RogueScholar (talk | contribs) Rewrite stock documentation from Mediawiki projects for this template to suit Kodi Wiki |
RogueScholar (talk | contribs) Fix categorization |
||
| Line 6: | Line 6: | ||
{{Glossary}} | {{Glossary}} | ||
{{Term|Parser tags}} | {{Term|Parser tags}} | ||
{{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 | * '''unnamed second parameter''' or '''{{Para|2}}''' ''(optional)'': what type of tag to display; valid values are | ||
** <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 === | |||
Markup → renders as | ''Markup → renders as''<br /> | ||
<code><nowiki>{{Xtag|nowiki | :<code><nowiki>{{Xtag|nowiki}}</nowiki></code> → {{Xtag|nowiki}} | ||
:<code><nowiki>{{Xtag|nowiki|s}}</nowiki></code> → {{Xtag|nowiki|s}} | |||
:<code><nowiki>{{Xtag|syntaxhighlight|p|params=enclose="div" lang="text"}}</nowiki></code> → {{Xtag|syntaxhighlight|p|params=enclose="div" lang="text"}} | |||
<code><nowiki>{{Xtag|syntaxhighlight|p|params=enclose="div" lang="text"}}</nowiki></code> → {{Xtag|syntaxhighlight|p|params=enclose="div" lang="text"}} | |||
=== See also === | === See also === | ||
| Line 38: | Line 36: | ||
<!----Categories below this line, please:----> | |||
[[Category: | [[Category:Formatting templates]] | ||
[[Category:Wiki templates]]</includeonly> | |||
[[Category: | |||
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 areooropen(default): display only the opening tag of an open-and-closed paircorclose: display only the closing tag of an open-and-closed pairsorsingle: display a single, self-closing tagporpair: display a matched pair of tags (open-and-closed)- To suppress the ellipsis (
…) which appears between the tags, add an empty|content=parameter
- To suppress the ellipsis (
|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
- {{Tag}}