模板:Xtag/doc

来自决策链云智库
< 模板:Xtag
Zeroclanzhang讨论 | 贡献2024年1月17日 (三) 13:11的版本 (创建页面,内容为“{{Documentation subpage}}<!----Categories where indicated at the bottom of this page, please----> This template adds a formatted MediaWiki parser or extension tag that links to the help or extension page. This template is similar to {{tl|tag}}, but it links the tag and defaults to open. ===Parser and extension tags=== <section begin="xtag" />{{Xtag/list}}<section end="xtag" /> ===Parameters=== * '''first parameter''' ''(mandatory)'': the name of the HTML ta…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

This template adds a formatted MediaWiki parser or extension tag that links to the help or extension page. This template is similar to {{tag}}, but it links the tag and defaults to open.

Parser and extension tags

For a machine-generated list, see Special:Version. It may include tags not documented here.

Parser tags
<gallery>, <includeonly>, <noinclude>, <nowiki>, <onlyinclude>, <pre>
Extension tags
<categorytree>, <charinsert>, <chem> (alias <ce>), <graph>, <hiero>, <imagemap>, <indicator>, <inputbox>, <mapframe>, <maplink>, <math>, <math chem>, <poem>, <ref>, <references>, <score>, <section>, <syntaxhighlight> (alias <source>), <templatedata>, <templatestyles>, <timeline>

Parameters

  • first parameter (mandatory): the name of the HTML tag
  • second parameter: what type of tag to display:
    • p or pair: display a matched pair of open-and-close 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-close pair
    • c or close: display only the closing tag of an open-and-close pair
    • s or single: display a single tag
  • content= the text content of 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=inline lang="text"}}
<syntaxhighlight inline lang="text">...</syntaxhighlight>

See also

Other formatting templates

{{#lsth:Template:Template-linking_templates|Other formatting templates}}