Template:Tag/doc: Difference between revisions
Template page
More actions
No edit summary |
|||
| (4 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
<!-- | <!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> | ||
{{Interwikitmp-grp|meta=Tag|wp=Tag|cms=Tag|wbk=Tag|wsp=Tag|wvy=Tag|mdw=Tag}} | |||
This template provides a quick way to mention an XML-style tag in a preformatted way. Mainly used in discussion/help pages. | This template provides a quick way to mention an XML-style tag in a preformatted way. Mainly used in discussion/help pages. | ||
== Usage == | |||
*'''first parameter''' — ''(mandatory)'' the name of the HTML tag | *'''first parameter''' — ''(mandatory)'' the name of the HTML tag | ||
*'''second parameter''' — what type of tag to display: | *'''second parameter''' — what type of tag to display: | ||
**<code>p</code> or <code>pair</code> – display a matched pair of open-and-close tags: {{tag|font|pair}} | **<code>p</code> or <code>pair</code> – ''(default)'' display a matched pair of open-and-close tags: {{tag|font|pair}} | ||
**<code>o</code> or <code>open</code> – | **<code>o</code> or <code>open</code> – display only the opening tag of an open-and-close pair: {{tag|span|open}} | ||
**<code>c</code> or <code>close</code> – display only the closing tag of an open-and-close pair: {{tag|span|close}} | **<code>c</code> or <code>close</code> – display only the closing tag of an open-and-close pair: {{tag|span|close}} | ||
**<code>s</code> or <code>single</code> – display a single tag: {{tag|br|single}} | **<code>s</code> or <code>single</code> – display a single tag: {{tag|br|single}} | ||
| Line 15: | Line 15: | ||
*'''params=''' — any parameters to be included in the opening tag | *'''params=''' — any parameters to be included in the opening tag | ||
=== Examples === | |||
* <code><nowiki>{{tag|ref}}</nowiki></code> → {{tag|ref}} | * <code><nowiki>{{tag|ref}}</nowiki></code> → {{tag|ref}} | ||
| Line 28: | Line 28: | ||
* <code><nowiki>{{tag|br|single}}</nowiki></code> → {{tag|br|single}} | * <code><nowiki>{{tag|br|single}}</nowiki></code> → {{tag|br|single}} | ||
<includeonly> | == TemplateData == | ||
<!-- | {{TemplateData header}} | ||
</includeonly> | <templatedata> | ||
{ | |||
"description": { | |||
"en": "This template provides a quick way to mention an XML-style tag in a preformatted way. Mainly used in discussion/help pages." | |||
}, | |||
"format": "inline", | |||
"params": { | |||
"1": { | |||
"label": { | |||
"en": "Tag" | |||
}, | |||
"description": { | |||
"en": "The name of the HTML tag." | |||
}, | |||
"example": "span", | |||
"default": "tag", | |||
"required": true, | |||
"type": "line" | |||
}, | |||
"2": { | |||
"label": { | |||
"en": "Type" | |||
}, | |||
"description": { | |||
"en": "What type of tag to display." | |||
}, | |||
"suggestedvalues": [ | |||
"p", "pair", | |||
"o", "open", | |||
"c", "close", | |||
"s", "single" | |||
], | |||
"default": "pair", | |||
"type": "string" | |||
}, | |||
"params": { | |||
"label": { | |||
"en": "Parameters" | |||
}, | |||
"description": { | |||
"en": "Parameters to be included in the opening tag." | |||
}, | |||
"example": { | |||
"en": "foo=\"bar\"" | |||
}, | |||
"type": "line" | |||
}, | |||
"content": { | |||
"label": { | |||
"en": "Content" | |||
}, | |||
"description": { | |||
"en": "The text content of the tags." | |||
}, | |||
"default": { | |||
"en": "\n; pair\n: ...\n\n; other\n" | |||
}, | |||
"type": "content" | |||
} | |||
} | |||
} | |||
</templatedata> | |||
<includeonly>{{Sandbox other|| | |||
<!-- Categories below this line; interwikis at Wikidata --> | |||
[[Category:Formatting templates]] | |||
[[Category:Semantic markup templates]] | |||
}}</includeonly> | |||