Template:TemplateData/entry

From CrossCode Wiki
Revision as of 09:55, 15 July 2017 by Streetclaw (talk | contribs) (Deprecated)
Jump to navigation Jump to search
File:Template-info.svg Template Documentation

Template for creating unified table rows for template parameter documentation.

About

Creates a table row that displays Template parameter documentation in a unified format. This template creates a single entry for the main template {{TemplateData}}.

Parameter

Do not use named parameter for 1 ... x. The first Parameter will be automatically marked as 1, the second as 2 and so on.

Parameter Description Type Status
{{{name}}} labelname Specify a label for a parameter of the template documentation

Default: {{{def}}}

Example: no example

String Required
{{{name}}} param Specify a name for a parameter of the template documentation

Default: {{{def}}}

Example: no example

String Required
{{{name}}} alias1 Specify a alias for a parameter of the template documentation

Default: {{{def}}}

Example: no example

String Optional
{{{name}}} alias2 Specify a alias for a parameter of the template documentation

Default: {{{def}}}

Example: no example

String Optional
{{{name}}} alias3 Specify a alias for a parameter of the template documentation

Default: {{{def}}}

Example: no example

String Optional
{{{name}}} desc Specify a description for a parameter of the template documentation

Default: no description

Example: no example

WikiCode Recommended
{{{name}}} defaultdef Specify the parameter's default value

Default: {{{def}}}

Example: no example

WikiCode Optional
{{{name}}} example Specify an example for a parameter of the template documentation

Default: no example

Example: no example

WikiCode Optional
{{{name}}} type Specify a type for a parameter of the template documentation: Data Dictionary Notation

Default: {{{def}}}

Example: no example

DDNCode Required
{{{name}}} mwType Specify the MediaWiki TemplateData type for a parameter of the template.

Default: {{{def}}}

Example: no example

[ "unknown" | "number" | "string" | "line" | "boolean" | "date" | "url" | "wiki-page-name" | "wiki-file-name" | "wiki-template-name" | "wiki-user-name" | "content" | "unbalanced-wikitext" ] Recommended
{{{name}}} status Specify a status for a parameter of the template documentation

Default: {{{def}}}

Example: no example

["Required" | "Recommended" | "Optional" | "Deprecated" ] Required
{{{name}}} autoPre Automatic pre for examples

Default: 0

Example: no example

Boolean Optional
Format:
Custom:
{{_
| ______ = _
}}

See Template:TemplateData and Template:TemplateData/entry for more information about the parameter list and DDNCode for more information about types and the DDN Notation

Examples

Complete example:

Do not use named parameter for 1 ... x. The first Parameter will be automatically marked as 1, the second as 2 and so on.

Parameter Description Type Status
{{{name}}} example paramExample alias 1Example alias 2Example alias 3 example description

Default: {{{def}}}

Example: xyz

String Required
{{{name}}} B paramB alias 1B alias 2B alias 3 B description

Default: NULL

Example:

String Required
{{{name}}} deprecated paramDeprecated alias 1Deprecated alias 2Deprecated alias 3 deprecated description

Default: NULL

Example: xyz

String Deprecated

See Template:TemplateData and Template:TemplateData/entry for more information about the parameter list and DDNCode for more information about types and the DDN Notation

{{TemplateData|
{{TemplateData/entry
| name    = Example name
| param   = example param
| alias1  = Example alias 1
| alias2  = Example alias 2
| alias3  = Example alias 3
| desc    = example description
| default = NULL
| example = xyz
| type    = String
| status  = Required
}}
{{TemplateData/entry
| name    = Auto pre name B
| param   = B param
| alias1  = B alias 1
| alias2  = B alias 2
| alias3  = B alias 3
| desc    = B description
| def     = NULL
| example =
* List example with containing templates and HTML tags
* No Icon (<code>1</code>): {{ItemLink|Ginger Tom. Salad|noIcon=1}}
* Icon (<code>0</code>): {{ItemLink|Ginger Tom. Salad|noIcon=0}}
* Default (parameter not used / <code>0</code>): {{ItemLink|Ginger Tom. Salad}}
| type    = String
| status  = Required
| autoPre = 1
}}
{{TemplateData/entry
| name    = Deprecated Example name
| param   = deprecated param
| alias1  = Deprecated alias 1
| alias2  = Deprecated alias 2
| alias3  = Deprecated alias 3
| desc    = deprecated description
| def     = NULL
| example = xyz
| type    = String
| status  = Deprecated
}}
}}

Data Dictionary Notation (DDN) for types

The Data Dictionary Notation (DDN) is a modified modified BNF notation (which is used in Data Dictionaries) to describes the structure of data entries. The BNF and DDN notation is used in the field of Software engineering (SWE). In this case it describes how types have to be structured.

The used DDN Notation is slightly different than the linked DDN Notation:

  • The upper limit is not superscript
  • Can have a lower limit
  • Can have optional parts
Type Notation Description
Sequence + Sequence of definitions
Alternative [...|...] Only one element out of this list
Repetition {...} Repetition of the definition
Repetition 2 {...} Repetition of the definition with the minimum of two
Repetition {...} 5 Repetition of the definition with the maximum of five
Repetition 1 {...} 6 Repetition of the definition with the minimum of one and the maximum of six
Option (...) Optional definition
Specific value "..." fix definition

Predefined

All predefined Types can be used directly or inside DDNCode

Type Definition Comment
NULL "" Empty
LineFeed " " The Unicode character 'LINE FEED (LF)' (U+000A)
NonzeroDigit [ "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ] Single character, 1 - 9
Digit [ "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ] Single character, 0 - 9
LowerAlphabet [ "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" ] Single character, a - z
UpperAlphabet [ "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" ] Single character, A - Z
Alphabet [ LowerAlphabetUpperAlphabet ] Single character, a - z / A - Z
Ascii 1 {Ascii} 1 ASCII character
Char 1 {Char} 1 UTF-8 character
String 1 {Char} One or more UTF-8 characters
AsciiString 1 {Ascii} One or more ASCII characters
WikiCode 1 {WikiCode} 1 Any wiki code
DDNCode 1 {DDNCode} 1 Any DDNCode (links are allowed)
Number 1 {Digit} Any natural number with zero
Decimal 1 {Digit} + ( "." + 1 {Digit} ) Any natural number with zero
NonzeroNumber [ NonzeroDigit | 2 {Digit} ] Any natural number without zero
SignedNumber [ "-" + NonzeroDigitDigit | ("-") +  2 {Digit} ] Any Integer (doesn't allow -0 only 0)
PercentValue [ 1 {Digit} 2 | "100" ] Any natural number from 0 to 100
SignedPercentValue [ "-" + NonzeroDigitDigit | ("-") + 2 {Digit} 2 | ("-") + "100" ] Any natural number from 0 to 100 and from -1 to -100
Percent PercentValue + "%" From 0% to 100% (natural number)
SignedPercent SignedPercentValue + "%" From 0% to 100% and from -1% to -100% (natural number)
Boolean [ FalseTrue ] 0 (off) or 1 (on)
True "1" 1 (on)
False "0" 0 (off)
Month [ NonzeroDigit | "10" | "11" | "12" ] 1 - 12
Monthfill [ "0" + NonzeroDigit | "10" | "11" | "12" ] 01, 02, 03 ... - 12
Monthname [ "January" | "February" | "March" | "April" | "May" | "June" | "July" | "August" | "September" | "October" | "November" | "December" ] Month (name)
Day [ ( [ "1" | "2" ] ) + Digit | "30" | "31" ] 1 - 31
Dayfill [ [ "0" | 1" | "2" ] + Digit | "30" | "31" ] 01, 02, 03 ... - 31
Year 1 {Digit} Any year
LabeledYear Year + [" AD" | " BC" | " AC"] Any year with label
LevelNumber [ NonzeroDigit | 2 {Digit} 2 ] 1, 2, ... - 99
LevelNumberFill [ "0" + NonzeroDigit | 2 {Digit} 2 ] 01, 02, ... - 99
FormatString FormatStringStartFormatStringParamFormatStringEnd See MediaWiki TemplateData specification
FormatStringStart (LineFeed) + "{{" + (1 {" "})FormatStringHole
FormatStringParam (LineFeed) + (1 {" "}) + "|" + (LineFeed) + (1 {" "})FormatStringHole + (1 {" "}) + "=" + (1 {" "})FormatStringHole
FormatStringEnd (LineFeed) + (1 {" "}) + "}}" + (LineFeed)
FormatStringHole 1 {"_"}

Special Predefined

These predefines are based on the current Template

Type Definition Comment
<name> "{{{<name>}}}" All parameter names of the current template (this means: use the same type as in <name>)
<Template:<name>> "[[Template:<name>]]" Other templates (link required for type; this means: use these template as type; used in nested templates)

Examples

  • String + Number + {param}
  • Number + param

(param is in this example an other parameter of the template)

  • String + " = " + 1 {String} 2
  • String + (Number)