Difference between revisions of "Template:Note"
MediaWiki>Shirayuki (use translation aware transclusion) |
m (remove translate) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
<onlyinclude>{{#if: {{#if:{{{1|{{{text|}}}}}}|{{{1|{{{text|}}}}}}|{{#if:<noinclude>demo</noinclude>|demo|{{{demo|}}}}} }} | <templatestyles src="Note/styles.css" /><div role="note" class="note note-{{#switch: {{{2|{{{type|}}}}}} | <onlyinclude>{{#if: {{#if:{{{1|{{{text|}}}}}}|{{{1|{{{text|}}}}}}|{{#if:<noinclude>demo</noinclude>|demo|{{{demo|}}}}} }} | <templatestyles src="Note/styles.css" /><div role="note" class="note note-{{#switch: {{{2|{{{type|}}}}}} | ||
|gotcha=error | |gotcha=error | ||
Line 5: | Line 4: | ||
|#default={{{2|{{{type|}}}}}} | |#default={{{2|{{{type|}}}}}} | ||
}} {{#ifeq:{{{inline|}}}|1|note-inline}}">{{{1|{{{text}}}}}}</div> | }} {{#ifeq:{{{inline|}}}|1|note-inline}}">{{{1|{{{text}}}}}}</div> | ||
| [[File:OOjs UI icon lightbulb-20 fc3.svg|18px| | | [[File:OOjs UI icon lightbulb-20 fc3.svg|18px|<!--T:1--> Note|link=]] '''<!--T:2--> Note:''' }}<!-- | ||
--></onlyinclude> | --></onlyinclude> | ||
{{documentation|content= | {{documentation|content= | ||
== Usage == <!--T:3--> | == Usage == <!--T:3--> | ||
<pre> | <pre> | ||
{{Note|Foo}} | {{Note|Foo}} | ||
Line 17: | Line 16: | ||
{{Note|Foo|warn}} | {{Note|Foo|warn}} | ||
{{Note|Foo|error}} | {{Note|Foo|error}} | ||
{{Note}} | {{Note}} <!--T:6--> Loose test | ||
* Text {{Note|Foo|inline=1}} | * Text {{Note|Foo|inline=1}} | ||
Line 26: | Line 25: | ||
{{Note|Foo|warn}} | {{Note|Foo|warn}} | ||
{{Note|Foo|error}} | {{Note|Foo|error}} | ||
{{Note}} | {{Note}} <!--T:4--> Loose test | ||
* Text {{Note|Foo|inline=1}} | * Text {{Note|Foo|inline=1}} |
Latest revision as of 15:11, 26 September 2021
{{#if: {{#if:||{{#if:demo|demo|}} }} |
| Note: }}
{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}{{#if:== Usage ==
{{Note|Foo}} {{Note|Foo|info}} {{Note|Foo|reminder}} {{Note|Foo|warn}} {{Note|Foo|error}} {{Note}} <!--T:6--> Loose test * Text {{Note|Foo|inline=1}}
{{#if: {{#if:Foo|Foo|{{#if:|demo|}} }} |
| Note: }}
{{#if: {{#if:Foo|Foo|{{#if:|demo|}} }} |
| Note: }}
{{#if: {{#if:Foo|Foo|{{#if:|demo|}} }} |
| Note: }}
{{#if: {{#if:Foo|Foo|{{#if:|demo|}} }} |
| Note: }}
{{#if: {{#if:Foo|Foo|{{#if:|demo|}} }} |
| Note: }}
{{#if: {{#if:||{{#if:|demo|}} }} |
| Note: }} Loose test
- Text {{#if: {{#if:Foo|Foo|{{#if:|demo|}} }} | Foo
| Note: }}
Parameters
{{#switch:<translate></translate> | = {{#if:{{#ifexpr: ( {{#ifeq:note|doc|1|0}} or ( {{#ifeq:{{#titleparts:template:note|-1|-2}}|doc|1|0}} and {{#if:{{#invoke:Template translation|getLanguageSubpage}}|1|0}} ) )|1|}}
|
{{#ifeq:show |show
| {{#invoke:Message box|mbox}} }}{{#if: | | {{#ifexist:Template:Note | [[Category:{{#switch:Template | Template | Project = Template | Module = Module | User = User | #default = MediaWiki }} documentation pages{{#translation:}}]] | [[Category:Documentation subpages without corresponding pages{{#translation:}}]] }} }} | }}
| #default=
{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Documentation subpage|noshift=1|uselang=⧼lang⧽}}
}} {{#switch:<translate></translate> |=
|no |n |false |0 = | = |¬ = |yes |y |true |1 = yes |#default = yes
}}|{{#ifexpr:{{#if:Note/doc|{{#ifeq:Template:Note|{{#switch:
|#default = Note/doc | = {{#ifeq: | | Template:Note/doc | Note/doc }}
}}|0|1}}|not{{#ifexpr: ( {{#ifeq:note|doc|1|0}} or ( {{#ifeq:{{#titleparts:template:note|-1|-2}}|doc|1|0}} and {{#if:{{#invoke:Template translation|getLanguageSubpage}}|1|0}} ) )|1|0}}}}|Page Template:Module:Navbar/styles.css has no content.
|#default = Note/doc | = {{#ifeq: | | Template:Note/doc | Note/doc }}
}}|<span style="" title="<translate nowrap> View this template</translate>">{{#if:|<translate> v</translate>|<translate> view</translate>}}]] · [[[:Template:Fullurl:]] <span style="" title="<translate nowrap> Discuss this template</translate>">{{#if:|<translate> d</translate>|<translate> talk</translate>}}]{{#if:|| · [{{fullurl:{{#switch:
|#default = Note/doc | = {{#ifeq: | | Template:Note/doc | Note/doc }}
}}|action=edit}} <span style="" title="<translate nowrap> Edit this template</translate>">{{#if:|<translate> e</translate>|<translate> edit</translate>}}]}}{{#if:1|]}}}}}} {{#if:||<translate> This is the [[<tvar name=1>Special:MyLanguage/Help:TemplateData</tvar>|TemplateData]] documentation for this template used by [[<tvar name=2>Special:MyLanguage/VisualEditor</tvar>|VisualEditor]] and other tools.</translate>}}
Note
{{#ifeq:Note|sandbox||{{#if:{{#ifexpr: (
{{#ifeq:note|doc|1|0}} or ( {{#ifeq:{{#titleparts:template:note|-1|-2}}|doc|1|0}} and {{#if:{{#invoke:Template translation|getLanguageSubpage}}|1|0}} ) )|1|}}|[[Category:TemplateData documentation{{#translation:}}]]|[[Category:Templates using TemplateData{{#translation:}}]]}}}} | #default=
{{#invoke:Template translation|renderTranslatedTemplate|template=Template:TemplateData header|noshift=1|uselang={{#if:{{#ifeq:{{#invoke:Template translation|getLanguageSubpage|}}|en
|{{#ifeq:{{#titleparts:Note||-1}}|en
|{{#invoke:Template translation|getLanguageSubpage|}} }}
|{{#invoke:Template translation|getLanguageSubpage|}} }}|{{#ifeq:{{#invoke:Template translation|getLanguageSubpage|}}|en |{{#ifeq:{{#titleparts:Note||-1}}|en
|{{#invoke:Template translation|getLanguageSubpage|}} }}
|{{#invoke:Template translation|getLanguageSubpage|}} }}|⧼lang⧽}}}} }} <templatedata> { "format": "inline", "description": { "en": "Show a note in a box (e.g. a top-of-the-page warning).", "tr": "Bir kutuda bir not gösterin (ör. sayfanın üstü uyarısı)." }, "params": { "inline": { "label": { "en": "Inline formatting", "tr": "Satır içi biçimlendirme" }, "description": { "en": "Show the template without line breaks before and after it.", "tr": "Şablonu, öncesinde ve sonrasında satır kesmeleri olmadan gösterin." }, "default": "0", "autovalue": "1", "type": "boolean" }, "type": { "aliases": [ "2" ], "label": { "en": "Type", "tr": "Tür" }, "description": { "en": "One of “info”, “reminder”, “warn”, or “error”. This setting affects the color and icon.", "tr": "“info”, “reminder”, “warn” veya “error” değerlerden biri. Bu ayar, rengi ve simgeyi etkiler." }, "suggestedvalues": [ "info", "reminder", "warn", "error" ], "default": "info", "type": "string" }, "1": { "aliases": [ "text" ], "label": { "en": "Text", "tr": "Metin" }, "description": { "en": "Informative note.", "tr": "Bilgilendirecek not." }, "required": true, "type": "content" } }, "paramOrder": [ "inline", "type", "1" ] } </templatedata> {{#switch:Note|sandbox|doc=|#default= [[Category:Templates{{#translation:}}]] }}| [[Category:Template documentation pages{{#translation:}}]] }} [[Category:Templates{{#translation:}}|Note]]