Template:Xtag/doc
File:Farm-Fresh css add.svg | This template uses TemplateStyles: |
This is the TemplateData documentation for this template used by VisualEditor and other tools.
Extension tag
<templatedata>
{
"description": {
"en": "This template adds a formatted MediaWiki parser or extension tag that links to the help or extension page. This template is similar to <tag>...</tag>
, but it links the tag and defaults to open.",
"cs": "Tato šablona přidává formátovaný analyzátor MediaWiki nebo značku rozšíření, která odkazuje na stránku nápovědy nebo rozšíření. Tato šablona je podobná <tag>...</tag>
, ale značku propojuje a ve výchozím nastavení se otevře."
},
"format": "inline",
"params": {
"1": {
"label": {
"en": "Tag",
"cs": "Značka",
"tr": "Etiket"
},
"description": {
"en": "The name of the Extension tag.",
"cs": "Název značky rozšíření."
},
"example": "pre",
"type": "line",
"default": {
"en": "tag",
"cs": "značka",
"tr": "tag"
},
"required": true
},
"2": {
"label": {
"en": "Type",
"cs": "Typ",
"tr": "Tür"
},
"description": {
"en": "What type of tag to display, see documentation for possible values.",
"cs": "Jaký typ značky zobrazit, možné hodnoty naleznete v dokumentaci.",
"tr": "Ne tür bir etiket görüntülenecek, olası değerler için belgelere bakın."
},
"suggestedvalues": [
"p", "pair",
"o", "open",
"c", "close",
"s", "single"
],
"default": "open",
"type": "string"
},
"content": {
"label": {
"en": "Content",
"cs": "Obsah",
"tr": "İçerik"
},
"description": {
"en": "The text content of the tag. By default “...” for pair type, empty for others; unused if type is single.",
"cs": "Textový obsah značky. Ve výchozím nastavení “...” pro typ páru, prázdné pro ostatní; nepoužito, pokud je typ single.",
"tr": "Etiketin metin içeriği. Çift tipi için varsayılan olarak “...”, diğerleri için boştur; tür tek ise kullanılmaz."
},
"type": "content"
},
"params": {
"label": {
"en": "Parameters",
"cs": "Parametry",
"tr": "Parametreler"
},
"description": {
"en": "Parameters (attributes) for the opening tag, unused in close type.",
"cs": "Parametry (atributy) pro úvodní značku, nepoužívané v typu close.",
"tr": "Kapanış türünde kullanılmayan açılış etiketi için parametreler (öznitelikler)."
},
"example": "foo=\"bar\"",
"type": "line"
},
"plain": {
"label": {
"en": "Plain display",
"cs": "Obyčejné zobrazení",
"tr": "Düz görüntüleme"
},
"description": {
"en": "Avoid using monospace font and grey background for the tag.",
"cs": "Vyhněte se použití jednoprostorového písma a šedého pozadí pro značku.",
"tr": "Etiket için tek aralıklı yazı tipi ve gri arka plan kullanmaktan kaçının."
},
"default": "0",
"autovalue": "1",
"type": "boolean"
},
"wrap": {
"label": {
"en": "Wrap?",
"cs": "Zabalit?"
},
"description": {
"en": "Whether to not add `style=\"white-space: nowrap;\"` to the enclosing tag.",
"cs": "Zda nepřidat `style=\"white-space: nowrap;\"` do ohraničující značky
."
},
"default": "0",
"autovalue": "1",
"type": "boolean"
}
}
}
</templatedata>
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|close
| content = <nowiki>{{{content}}}</nowiki>
| params = {{attr|foo|"bar"}}
}}
{{{content}}}</nowiki>
{{xtag|nowiki|single
| content = <nowiki>{{{content}}}</nowiki>
| params = {{attr|foo|"bar"}}
}}
<nowiki foo="bar" />
{{xtag|nowiki|open
| content = <nowiki>{{{content}}}</nowiki>
| params = {{attr|foo|"bar"}}
}}
<nowiki foo="bar">{{{content}}}
{{xtag|nowiki|pair
| content = <nowiki>{{{content}}}</nowiki>
| params = {{attr|foo|"bar"}}
}}
<nowiki foo="bar">{{{content}}}</nowiki>
Markup → Renders as:
- {{xtag|templatestyles|s|params={{attr|lang|"Template:Uses TemplateStyles/example.css"}}}} →
<templatestyles src="Template:Uses TemplateStyles/example.css" />
- {{xtag|syntaxhighlight|p|params={{attr|lang|"text"}}}} →
<syntaxhighlight lang="text">...</syntaxhighlight>
See also