Difference between revisions of "Template:Tag"
Jump to navigation
Jump to search
MyraMidnight (talk | contribs) m |
MyraMidnight (talk | contribs) m |
||
Line 1: | Line 1: | ||
− | <onlyinclude>{|style="width:90%;margin:5px auto;border:2px solid {{{background|SlateBlue}}};background:white;border-collapse:collapse;95%" | + | Î{{#if:{{{plain|}}}| |
+ | |<code style="white-space:nowrap"> | ||
+ | }}{{#switch:{{{2|pair}}} | ||
+ | |c|close = <!--nothing--> | ||
+ | |s|single | ||
+ | |o|open | ||
+ | |p|pair = <{{{1|tag}}}{{#if:{{{params|}}}| {{{params}}}}} | ||
+ | }}{{#switch:{{{2|pair}}} | ||
+ | |c|close = {{{content|}}} | ||
+ | |s|single =  /> | ||
+ | |o|open = >{{{content|}}} | ||
+ | |p|pair = >{{{content|...}}} | ||
+ | }}{{#switch:{{{2|pair}}} | ||
+ | |s|single | ||
+ | |o|open = <!--nothing--> | ||
+ | |c|close | ||
+ | |p|pair = </{{{1|tag}}}> | ||
+ | }}{{#if:{{{plain|}}}| | ||
+ | |</code> | ||
+ | }}<noinclude> | ||
+ | {{documentation}} | ||
+ | |||
+ | <!---<onlyinclude>{|style="width:90%;margin:5px auto;border:2px solid {{{background|SlateBlue}}};background:white;border-collapse:collapse;95%" | ||
!style="background:{{{background|SlateBlue}}};color:{{{color|white}}};"|{{{title}}} | !style="background:{{{background|SlateBlue}}};color:{{{color|white}}};"|{{{title}}} | ||
|- | |- | ||
Line 22: | Line 44: | ||
:Please add the [[Template:Tag/help|Tag/help]] template at the end within the [[Template:Template Explanation|Template Explanation]], it adds the basic information | :Please add the [[Template:Tag/help|Tag/help]] template at the end within the [[Template:Template Explanation|Template Explanation]], it adds the basic information | ||
==See Also== | ==See Also== | ||
− | |||
|} | |} | ||
+ | ---></noinclude> |
Revision as of 12:13, 3 May 2017
Î<tag>...</tag>
Template documentation (
)
)
- For the page status indicator Phabricator tags, see Template:ptag.
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
- second parameter — what type of tag to display:
p
orpair
– (default) display a matched pair of open-and-close tags:
{{{title}}} |
---|
{{{message}}} |
o
oropen
– display only the opening tag of an open-and-close pair:
{{{title}}} |
---|
{{{message}}} |
c
orclose
– display only the closing tag of an open-and-close pair:
{{{title}}} |
---|
{{{message}}} |
s
orsingle
– display a single tag:
{{{title}}} |
---|
{{{message}}} |
- content= — the text content of the tags
- params= — any parameters to be included in the opening tag
Examples
{{tag|ref}}
→
{{{title}}} |
---|
{{{message}}} |
{{tag|ref|content=hello}}
→
{{{title}}} |
---|
{{{message}}} |
{{tag|font|content=foo}}
→
{{{title}}} |
---|
{{{message}}} |
{{tag|font|open}}
→
{{{title}}} |
---|
{{{message}}} |
{{tag|font|open|content=hello}}
→
{{{title}}} |
---|
{{{message}}} |
{{tag|span|close|content=hello}}
→
{{{title}}} |
---|
{{{message}}} |
{{tag|span|pair|content=hello}}
→
{{{title}}} |
---|
{{{message}}} |
{{tag|ref|open|params=group=note}}
→
{{{title}}} |
---|
{{{message}}} |
{{tag|references|single}}
→
{{{title}}} |
---|
{{{message}}} |
{{tag|br|single}}
→
{{{title}}} |
---|
{{{message}}} |
- The above documentation is transcluded from Template:Tag/doc.
- Editors can experiment in this template's sandbox
- Please add categories to the /doc subpage within
{{{title}}} |
---|
{{{message}}} |