Шаблон:TemplateData header/doc

Материал из Машинное обучение - Кафедра прикладной кибернетики
< Шаблон:TemplateData header
Версия от 18:53, 4 сентября 2021; Mr makay (обсуждение | вклад) (1 версия импортирована)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к навигации Перейти к поиску

{{#ifeq:doc |doc

    | 

{{#ifeq:show |show

         | {{#invoke:Message box|mbox}}
        }}{{#if: |
         |   {{#ifexist:Шаблон:TemplateData header
                  | [[Category:{{#switch:Шаблон |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
                  |
                 }}
        }}
    | 
   }}

The {{#Invoke:Template link general|main|code=on}} template inserts a brief header for the template data section, and adds the page to Category:Templates using TemplateData.

Usage

==TemplateData==
{{TemplateData header}}
<templatedata>{
...
}</templatedata>

Note: Section headers of ==Parameters== or ==Usage== may also be used.

Use {{TemplateData header|Template name}} to display a name for the template other than the default, which is {{BASEPAGENAME}}. Do not add namespace Template:

{{#switch: =[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|no|C|c}}lick here] to see a monthly parameter usage report for {{#if:|[[Template:]]|this template}}{{#ifeq:{{safesubst:#switch: y

no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}.

none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|no|P|p}}arameter usage report]{{#ifeq:{{safesubst:#switch: y

no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}

For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|no|P|p}}arameter usage report] for {{#if:|[[Template:]]|Template:TemplateData header}}{{#ifeq:{{safesubst:#switch: y

no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}.

#default=[1]{{#ifeq:{{safesubst:#switch: y no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}} }}|This is the {{#if:|TemplateData|TemplateData}} for this template used by TemplateWizard, VisualEditor and other tools. {{#switch:

=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|no|C|c}}lick here] to see a monthly parameter usage report for {{#if:|[[Template:]]|this template}}{{#ifeq:{{safesubst:#switch: y

no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}.

none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|no|P|p}}arameter usage report]{{#ifeq:{{safesubst:#switch: y

no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}

For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|no|P|p}}arameter usage report] for {{#if:|[[Template:]]|Template:TemplateData header}}{{#ifeq:{{safesubst:#switch: y

no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}.

#default=[2]{{#ifeq:{{safesubst:#switch: y no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}} }}}}

TemplateData for Template name

{{#invoke:Check for unknown parameters|check
unknown={{#switch:
 {{#if:
{{{demospace}}} Шаблон template other
   }}
 }}
template = other #default =

}}

template=Template:TemplateData header nolink |noheader preview=
Unknown parameter '_VALUE_' in Template:TemplateData header.

}}{{#switch:

 {{#if:
{{{demospace}}} Шаблон template other
   }}
 }}
sublength|s=doc|i=0|len=7}}|sandbox|1}}{{#ifeq:doc|doc|1}}{{#invoke:String|match|TemplateData header/doc|/sandbox/styles.css$|plain=false|nomatch=}}

}}

other #default =

}}

Use {{TemplateData header|nolink=1}} to omit the wikilink from the word "TemplateData" in the header text, for instances where it is already linked outside this template.

{{#switch: =[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|no|C|c}}lick here] to see a monthly parameter usage report for {{#if:|[[Template:]]|this template}}{{#ifeq:{{safesubst:#switch: y

no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}.

none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|no|P|p}}arameter usage report]{{#ifeq:{{safesubst:#switch: y

no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}

For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|no|P|p}}arameter usage report] for {{#if:|[[Template:]]|Template:TemplateData header}}{{#ifeq:{{safesubst:#switch: y

no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}.

#default=[3]{{#ifeq:{{safesubst:#switch: y no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}} }}|This is the {{#if:1|TemplateData|TemplateData}} for this template used by TemplateWizard, VisualEditor and other tools. {{#switch:

=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|no|C|c}}lick here] to see a monthly parameter usage report for {{#if:|[[Template:]]|this template}}{{#ifeq:{{safesubst:#switch: y

no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}.

none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|no|P|p}}arameter usage report]{{#ifeq:{{safesubst:#switch: y

no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}

For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|no|P|p}}arameter usage report] for {{#if:|[[Template:]]|Template:TemplateData header}}{{#ifeq:{{safesubst:#switch: y

no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}.

#default=[4]{{#ifeq:{{safesubst:#switch: y no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}} }}}}

TemplateData for TemplateData header

{{#invoke:Check for unknown parameters|check
unknown={{#switch:
 {{#if:
{{{demospace}}} Шаблон template other
   }}
 }}
template = other #default =

}}

template=Template:TemplateData header nolink |noheader preview=
Unknown parameter '_VALUE_' in Template:TemplateData header.

}}{{#switch:

 {{#if:
{{{demospace}}} Шаблон template other
   }}
 }}
sublength|s=doc|i=0|len=7}}|sandbox|1}}{{#ifeq:doc|doc|1}}{{#invoke:String|match|TemplateData header/doc|/sandbox/styles.css$|plain=false|nomatch=}}

}}

other #default =

}}

Use {{TemplateData header|noheader=1}} to omit the first sentence of the header text.

{{#switch: =[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|no|C|c}}lick here] to see a monthly parameter usage report for {{#if:|[[Template:]]|this template}}{{#ifeq:{{safesubst:#switch: y

no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}.

none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|no|P|p}}arameter usage report]{{#ifeq:{{safesubst:#switch: y

no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}

For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|no|P|p}}arameter usage report] for {{#if:|[[Template:]]|Template:TemplateData header}}{{#ifeq:{{safesubst:#switch: y

no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}.

#default=[5]{{#ifeq:{{safesubst:#switch: y no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}} }}|This is the {{#if:|TemplateData|TemplateData}} for this template used by TemplateWizard, VisualEditor and other tools. {{#switch:

=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|no|C|c}}lick here] to see a monthly parameter usage report for {{#if:|[[Template:]]|this template}}{{#ifeq:{{safesubst:#switch: y

no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}.

none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|no|P|p}}arameter usage report]{{#ifeq:{{safesubst:#switch: y

no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}

For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|no|P|p}}arameter usage report] for {{#if:|[[Template:]]|Template:TemplateData header}}{{#ifeq:{{safesubst:#switch: y

no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}.

#default=[6]{{#ifeq:{{safesubst:#switch: y no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}|yes| based on {{#if:|its|this}} TemplateData}} }}}}

TemplateData for TemplateData header

{{#invoke:Check for unknown parameters|check
unknown={{#switch:
 {{#if:
{{{demospace}}} Шаблон template other
   }}
 }}
template = other #default =

}}

template=Template:TemplateData header nolink |noheader preview=
Unknown parameter '_VALUE_' in Template:TemplateData header.

}}{{#switch:

 {{#if:
{{{demospace}}} Шаблон template other
   }}
 }}
sublength|s=doc|i=0|len=7}}|sandbox|1}}{{#ifeq:doc|doc|1}}{{#invoke:String|match|TemplateData header/doc|/sandbox/styles.css$|plain=false|nomatch=}}

}}

other #default =

}}

Parameters

{{#if:|{{#switch:
|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}}
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|no|C|c}}lick here] to see a monthly parameter usage report for {{#if:|[[Template:]]|this template}}{{#ifeq:{{safesubst:#switch: y

|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}.

|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}}
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|no|P|p}}arameter usage report]{{#ifeq:{{safesubst:#switch: y

|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}

|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}}
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|no|P|p}}arameter usage report] for {{#if:|[[Template:]]|Template:TemplateData header}}{{#ifeq:{{safesubst:#switch: y

|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}.

|#default=[7]{{#ifeq:{{safesubst:#switch: y
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:|its|this}} TemplateData}} }}|This is the {{#if:|TemplateData|TemplateData}} for this template used by TemplateWizard, VisualEditor and other tools. {{#switch:

|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}}
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|no|C|c}}lick here] to see a monthly parameter usage report for {{#if:|[[Template:]]|this template}}{{#ifeq:{{safesubst:#switch: y

|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}.

|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}}
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|no|P|p}}arameter usage report]{{#ifeq:{{safesubst:#switch: y

|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}

|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CTemplateData+header%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}}
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|no|P|p}}arameter usage report] for {{#if:|[[Template:]]|Template:TemplateData header}}{{#ifeq:{{safesubst:#switch: y

|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:|its|this}} TemplateData}}.

|#default=[8]{{#ifeq:{{safesubst:#switch: y
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:|its|this}} TemplateData}} }}}}

TemplateData for TemplateData header

{{#invoke:Check for unknown parameters|check

|unknown={{#switch:

 {{#if:
 | {{{demospace}}}    
 | {{#ifeq:Шаблон|Шаблон
   | template
   | other
   }}
 }}

| template = | other | #default = }} |template=Template:TemplateData header |1 |nolink |noheader

|preview=

Unknown parameter '_VALUE_' in Template:TemplateData header.

}}{{#switch:

 {{#if:
 | {{{demospace}}}    
 | {{#ifeq:Шаблон|Шаблон
   | template
   | other
   }}
 }}

| template = {{#if:{{#ifeq:{{#invoke:String|sublength|s=doc|i=0|len=7}}|sandbox|1}}{{#ifeq:doc|doc|1}}{{#invoke:String|match|TemplateData header/doc|/sandbox/styles.css$|plain=false|nomatch=}}||

}} | other | #default = }} <templatedata>{

 "description": "Inserts a brief header for the template data section. Adds the page to",
 "params": {
   "1": {
     "label": "Template name",
     "description": "Used to display a name for the template other than the default, which is TemplateData header.",
     "type": "string",
     "required": false
   },
   "nolink": {
     "label": "No link",
     "description": "Assigning any value to this parameter will omit cause the template to omit the wikilink from the word \"TemplateData\" in the header text, for instances where it is already linked outside this template.",
     "type": "string",
     "required": false
   },
   "noheader": {
     "label": "No header",
     "description": "Assigning any value to this parameter will cause the template to omit the first sentence of the header text.",
     "type": "string",
     "required": false
   }
 }

}</templatedata>

Example

Using a collapse box for [[Template:User{{#if:||{{{2}}}}}]]:

{{#invoke:Template test case|main}}

Tracking category

  • [[:Category:{{#invoke:string|replace|1=Category:Pages using TemplateData header with unknown parameters|2=^:?[Cc]ategory:|3=|plain=false}}|{{#if:|{{{name}}}|Category:{{#invoke:string|replace|1=Category:Pages using TemplateData header with unknown parameters|2=^:?[Cc]ategory:|3=|plain=false}}}}]] (0)

See also

  • [[:Category:{{#invoke:string|replace|1=Category:Templates using TemplateData|2=^:?[Cc]ategory:|3=|plain=false}}|{{#if:|{{{name}}}|Category:{{#invoke:string|replace|1=Category:Templates using TemplateData|2=^:?[Cc]ategory:|3=|plain=false}}}}]] (0)
  • {{Crude TemplateData}}
  • {{Template parameter usage}}