Template:Tag/doc: Difference between revisions
Jump to navigation
Jump to search
(→Examples: fix + add example) |
|||
Line 18: | Line 18: | ||
* <code><nowiki>{{tag|ref}}</nowiki></code> → {{tag|ref}} | * <code><nowiki>{{tag|ref}}</nowiki></code> → {{tag|ref}} | ||
* <code><nowiki>{{tag|ref|hello}}</nowiki></code> → {{tag|ref|hello}} | * <code><nowiki>{{tag|ref|content=hello}}</nowiki></code> → {{tag|ref|content=hello}} | ||
* <code><nowiki>{{tag|font|content=foo}}</nowiki></code> → {{tag|font|content=foo}} | * <code><nowiki>{{tag|font|content=foo}}</nowiki></code> → {{tag|font|content=foo}} | ||
* <code><nowiki>{{tag|font|open}}</nowiki></code> → {{tag|font|open}} | * <code><nowiki>{{tag|font|open}}</nowiki></code> → {{tag|font|open}} | ||
Line 25: | Line 25: | ||
* <code><nowiki>{{tag|span|pair|content=hello}}</nowiki></code> → {{tag|span|pair|content=hello}} | * <code><nowiki>{{tag|span|pair|content=hello}}</nowiki></code> → {{tag|span|pair|content=hello}} | ||
* <code><nowiki>{{tag|ref|params=group=note|open}}</nowiki></code> → {{tag|ref|params=group=note|open}} | * <code><nowiki>{{tag|ref|params=group=note|open}}</nowiki></code> → {{tag|ref|params=group=note|open}} | ||
* <code><nowiki>{{tag|references|single}}</nowiki></code> → {{tag|references|single}} | |||
* <code><nowiki>{{tag|br|single}}</nowiki></code> → {{tag|br|single}} | * <code><nowiki>{{tag|br|single}}</nowiki></code> → {{tag|br|single}} | ||
Revision as of 13:47, 28 December 2010
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 (compulsory) the name of the HTML tag
- second parameter — what type of tag to display:
pair
(default) – display a matched pair of open-and-close tags:<font>...</font>
open
– display only the opening tag of an open-and-close pair:<span>
close
– display only the closing tag of an open-and-close pair:</span>
single
– display a single tag:<br />
- content= — the text content of the tags
- params= — any parameters to be included in the opening tag
Examples
{{tag|ref}}
→<ref>...</ref>
{{tag|ref|content=hello}}
→<ref>hello</ref>
{{tag|font|content=foo}}
→<font>foo</font>
{{tag|font|open}}
→<font>
{{tag|font|open|content=hello}}
→<font>hello
{{tag|span|close|content=hello}}
→hello</span>
{{tag|span|pair|content=hello}}
→<span>hello</span>
{{tag|ref|params=group=note|open}}
→<ref group=note>
{{tag|references|single}}
→<references />
{{tag|br|single}}
→<br />
See also
- The #tag: parserfunction generates working tags.