(页面间差异)
无编辑摘要 标签:已被回退 |
小 (已保护“模板:Tag/doc”([编辑=仅允许管理员](无限期)[移动=仅允许管理员](无限期))) |
||
第1行: | 第1行: | ||
< | {{Documentation}} | ||
< | : {{t|tag|''tagname'' [|''type''] [|content=''text''] [|params=''parameters'']}} | ||
< | This template provides a quick way to mention an {{WP|ref=no|XML}}/{{WP|ref=no|HTML}}-style tag in a preformatted way. Mainly used in discussion/help pages. | ||
< | |||
< | ===Parameters=== | ||
< | Required parameters shown in '''''bold italics'''''. | ||
</ | |||
</ | ; {{para|first unnamed}} {{nobold| (''tagname'' above)}} : The XML/HTML tag's name (e.g. {{mono|100%|code}}, {{mono|100%|ref}}). | ||
</ | ; {{para|second unnamed}} {{nobold| (''type'' above)}} : To indicate which of the tag's types is/are presented: | ||
:; <kbd>p</kbd> (pair) ''(default)'' : A matching pair of open/start and close/end tags (e.g. {{tag|div|pair}}).<br/>To suppress the ellipsis ("...") between the tags, add an empty {{para|content}} parameter. | |||
:; <kbd>o</kbd> (open) : An open/start tag (e.g. {{tag|span|open}}). | |||
:; <kbd>c</kbd> (close) : A close/end tag (e.g. {{tag|span|close}}). | |||
:; <kbd>s</kbd> (single) : A single tag (e.g. {{tag|hr|single}}). | |||
; {{para|content}} : Text to place between open/start and close/end tags. | |||
; {{para|params}} : Parameters to be included as part of an open/start tag. | |||
; {{para|wrap|yes}} : Disable nowrap for long samples. | |||
===Examples=== | |||
{| class="wikitable" | |||
!Markup | |||
!Renders as | |||
|- | |||
| <nowiki>{{tag|ref}}</nowiki> || {{tag|ref}} | |||
|- | |||
| <nowiki>{{tag|ref|content=}}</nowiki> || {{tag|ref|content=}} | |||
|- | |||
| <nowiki>{{tag|ref|content=hello}}</nowiki> || {{tag|ref|content=hello}} | |||
|- | |||
| <nowiki>{{tag|span|content=foo}}</nowiki> || {{tag|span|content=foo}} | |||
|- | |||
| <nowiki>{{tag|span|open}}</nowiki> || {{tag|span|open}} | |||
|- | |||
| <nowiki>{{tag|span|open|content=hello}}</nowiki> || {{tag|span|open|content=hello}} | |||
|- | |||
| <nowiki>{{tag|span|close|content=hello}}</nowiki> || {{tag|span|close|content=hello}} | |||
|- | |||
| <nowiki>{{tag|span|pair|content=hello}}</nowiki> || {{tag|span|pair|content=hello}} | |||
|- | |||
| <nowiki>{{tag|ref|open|params=group="note"}}</nowiki> || {{tag|ref|open|params=group="note"}} | |||
|- | |||
| <nowiki>{{tag|references|single}}</nowiki> || {{tag|references|single}} | |||
|- | |||
| <nowiki>{{tag|br|single}}</nowiki> || {{tag|br|single}} | |||
|- | |||
| <nowiki>{{tag|!--|content=comment}}</nowiki> || {{tag|!--|content=comment}} | |||
|- | |||
| <nowiki>{{tag|math|params=chem}}</nowiki> || {{tag|math|params=chem}} | |||
|- | |||
| <nowiki>{{tag|a|params=href="<nowiki>https://en.wikipedia.org/</nowiki>"|content=English Wikipedia}}</nowiki> || {{tag|a|params=href="<nowiki>https://en.wikipedia.org/</nowiki>"|content=English Wikipedia}} | |||
|} | |||
<includeonly> | |||
[[Category:Typing-aid templates]] | |||
</includeonly> | |||
<noinclude></noinclude> |
2023年9月23日 (六) 22:35的最新版本
这是模板:Tag的一个文档子页面。它包含了使用信息、分类和其他不属于 原始 template 页面.的内容
- {{tag|<tagname [>|<type] [>|<content=text] [>|<params=parameters]>}}
This template provides a quick way to mention an XML/ HTML-style tag in a preformatted way. Mainly used in discussion/help pages.
Parameters
Required parameters shown in bold italics.
|first unnamed=
(tagname above)- The XML/HTML tag's name (e.g. code, ref).
|second unnamed=
(type above)- To indicate which of the tag's types is/are presented:
- p (pair) (default)
- A matching pair of open/start and close/end tags (e.g.
<div>...</div>
).
To suppress the ellipsis ("...") between the tags, add an empty|content=
parameter. - o (open)
- An open/start tag (e.g.
<span>
). - c (close)
- A close/end tag (e.g.
</span>
). - s (single)
- A single tag (e.g.
<hr />
).
|content=
- Text to place between open/start and close/end tags.
|params=
- Parameters to be included as part of an open/start tag.
|wrap=yes
- Disable nowrap for long samples.
Examples
Markup | Renders as |
---|---|
{{tag|ref}} | <ref>...</ref>
|
{{tag|ref|content=}} | <ref></ref>
|
{{tag|ref|content=hello}} | <ref>hello</ref>
|
{{tag|span|content=foo}} | <span>foo</span>
|
{{tag|span|open}} | <span>
|
{{tag|span|open|content=hello}} | <span>hello
|
{{tag|span|close|content=hello}} | hello</span>
|
{{tag|span|pair|content=hello}} | <span>hello</span>
|
{{tag|ref|open|params=group="note"}} | <ref group="note">
|
{{tag|references|single}} | <references />
|
{{tag|br|single}} | <br />
|
{{tag|!--|content=comment}} | <!--comment-->
|
{{tag|math|params=chem}} | <math chem>...</math>
|
{{tag|a|params=href="<nowiki>https://en.wikipedia.org/</nowiki>"|content=English Wikipedia}} | <a href="https://en.wikipedia.org/">English Wikipedia</a>
|