模板:Hatnote/doc:修订间差异
bwiki>35609647 小 列表替换:替换 “分类:模板页的文档” 为 “分类:模板文档” 第 32/145 个 |
小 导入1个版本 |
||
| (未显示另一用户的1个中间版本) | |||
| 第1行: | 第1行: | ||
{{Documentation subpage}} | |||
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> | |||
{{Uses TemplateStyles|Template:Hatnote/styles.css}} | |||
{{Hatnote templates}} | |||
< | This template produces formatted text, following the guideline for a '''hatnote'''. | ||
:<code><nowiki>{{hatnote|Example hatnote text.}}</nowiki></code> →<br/><!-- a construct to show hatnote as expected (using newline) --> | |||
{{hatnote|Example hatnote text.}} | |||
Broadly speaking, a hatnote should answer a readers' question (maybe preemptively): ''Am I on the right page?'' | |||
< | == Function == | ||
<!-- | This template is primarily used to add a correctly formatted ''hatnote'' to a page. Often, but not always, this is a ''disambiguation link'' at the top of article pages. It places an HTML <code>div-</code> / <code>div</code> block around the text entered as its only argument, which provides standardized formatting (contents are indented and italicized in most displays); it also isolates the contained code to make sure that it is interpreted correctly. | ||
[[ | |||
</ | This template is also used as the "meta-template" for additional specialized disambiguation link templates. | ||
The template does not automatically create links of any kind. Links and other desired formatting must be explicitly added, using normal [[Help:Wiki markup|Wikipedia markup]]. | |||
== Usage == | |||
{{((}}hatnote{{!}}''text''{{))}} | |||
== Parameters == | |||
This template accepts the following parameters: | |||
* <code>1</code> - the hatnote text (required) | |||
== Example == | |||
* <code><nowiki>{{hatnote|Example hatnote text}}</nowiki></code> → {{hatnote|Example hatnote text}} | |||
== Technical details == | |||
The HTML code produced by this template looks like this: | |||
* <code>{{#tag:syntaxhighlight|{{^(}}div role="note" class="hatnote"{{)^}}|lang=html|inline=1|style= | |||
border:0 | |||
}}''hatnote text''{{#tag:syntaxhighlight|{{^(}}/div{{)^}}|lang=html|inline=1|style= | |||
border:0 | |||
}}</code> | |||
{{TemplateData header|noheader=1}} | |||
<templatedata> | |||
{ | |||
"description": { | |||
"cs": "Šablona pro vytvoření standardní hatnote. Hatnote je krátká poznámka umístěná v horní části článku nebo sekce, která uživatele nasměruje na související stránky.", | |||
"en": "Template for creating a standard hatnote. A hatnote is a short note placed at the top of an article or section to direct users to related pages.", | |||
"pt-br": "Predefinição para a criação de uma nota de cabeçalho padrão. Uma nota de cabeçalho é uma nota curta colocada na parte superior de um artigo ou seção para direcionar os usuários às páginas relacionadas." | |||
}, | |||
"format": "inline", | |||
"params": { | |||
"1": { | |||
"aliases": [ | |||
"text" | |||
], | |||
"label": { | |||
"en": "Text", | |||
"pt-br": "Texto", | |||
"cs": "Text" | |||
}, | |||
"description": { | |||
"en": "This field should contain the text that will be displayed in the hatnote.", | |||
"cs": "Toto pole by mělo obsahovat text, který se zobrazí v hatnote.", | |||
"pt-br": "Este campo deve conter o texto que será exibido na nota de cabeçalho." | |||
}, | |||
"type": "string", | |||
"required": true, | |||
"example": { | |||
"en": "Insert text here.", | |||
"cs": "Sem vložte text.", | |||
"pt-br": "Inserir texto aqui." | |||
} | |||
}, | |||
"extraclasses": { | |||
"label": { | |||
"en": "Extra classes", | |||
"cs": "Extra třídy", | |||
"pt-br": "Classes adicionais" | |||
}, | |||
"description": { | |||
"en": "Comma-separated list of CSS class names.", | |||
"cs": "Seznam názvů tříd CSS oddělených čárkami.", | |||
"pt-br": "Lista separada por vírgulas de nomes de classes CSS." | |||
}, | |||
"type": "string" | |||
} | |||
}, | |||
"paramOrder": [ | |||
"1", | |||
"extraclasses" | |||
] | |||
} | |||
</templatedata> | |||
<includeonly>{{Sandbox other|| | |||
<!-- Categories below this line; interwikis at Wikidata --> | |||
[[Category:Hatnote templates| ]] | |||
}}</includeonly> | |||
2025年12月19日 (五) 23:43的最新版本
| 文件:Codex icon book color-base.svg | This is a documentation subpage for 模板:Hatnote. It contains usage information, categories and other content that is not part of the original 模板 page. |
| CSS | This template uses TemplateStyles: |
| Hatnote templates |
|---|
{{Main|$1|$2|$3|etc.}} |
{{For|$1|$2}} |
|
<translate> For {{<tvar name=1>#if:$1|$1</tvar>|other uses}}, see: <tvar name=2>$2</tvar>.</translate> |
{{For|2=$2|3=$3|4=etc.}} |
{{See|$1|$2|etc.}} |
{{See also|$1|$2|ll=true}} |
{{Distinguish|$1|$2}} |
{{Hatnote|Custom text}} |
|
Custom text like: For more information, please refer to ... |
{{Further|$1|$2}} |
|
<translate>
|
| · <span style="" title="<translate nowrap> Edit this template</translate>"><translate> e</translate> |
This template produces formatted text, following the guideline for a hatnote.
{{hatnote|Example hatnote text.}}→
Broadly speaking, a hatnote should answer a readers' question (maybe preemptively): Am I on the right page?
Function
This template is primarily used to add a correctly formatted hatnote to a page. Often, but not always, this is a disambiguation link at the top of article pages. It places an HTML div- / div block around the text entered as its only argument, which provides standardized formatting (contents are indented and italicized in most displays); it also isolates the contained code to make sure that it is interpreted correctly.
This template is also used as the "meta-template" for additional specialized disambiguation link templates.
The template does not automatically create links of any kind. Links and other desired formatting must be explicitly added, using normal Wikipedia markup.
Usage
{{hatnote|text}}
Parameters
This template accepts the following parameters:
1- the hatnote text (required)
Example
{{hatnote|Example hatnote text}}→Example hatnote text
Technical details
The HTML code produced by this template looks like this:
<div role="note" class="hatnote">hatnote text</div>
Hatnote
Template for creating a standard hatnote. A hatnote is a short note placed at the top of an article or section to direct users to related pages.
| 参数 | 描述 | 类型 | 状态 | |
|---|---|---|---|---|
| Text | 1 text | This field should contain the text that will be displayed in the hatnote.
| 字符串 | 必需 |
| Extra classes | extraclasses | Comma-separated list of CSS class names. | 字符串 | 可选 |