Template:TemplateData/entry/doc

From CrossCode Wiki
Jump to navigation Jump to search
File:Template-info.svg Template Documentation

Template for creating a unified parameter format for templates

About

Creates a list that displays Template parameter in a unified format. This template creates a single entry for the Required template 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
Parameter title name

Specify a title for a parameter of the template documentation

Default:
NULL
Example:
no example
String Required
Parameter name param

Specify a name for a parameter of the template documentation

Default:
NULL
Example:
no example
String Required
Parameter alias1 alias1

Specify a alias for a parameter of the template documentation

Default:
NULL
Example:
no example
String Optional
Parameter alias2 alias2

Specify a alias for a parameter of the template documentation

Default:
NULL
Example:
no example
String Optional
Parameter alias3 alias3

Specify a alias for a parameter of the template documentation

Default:
NULL
Example:
no example
String Optional
Parameter Description desc

Specify a description for a parameter of the template documentation

Default:
no description
Example:
no example
WikiCode Recommended
Parameter Example example

Specify an example for a parameter of the template documentation

Default:
no example
Example:
no example
WikiCode Recommended
Parameter type type

Specify a type for a parameter of the template documentation: Data Dictionary Notation

Default:
NULL
Example:
no example
DDNCode Required
Parameter status status

Specify a status for a parameter of the template documentation

Default:
NULL
Example:
no example
["Required" | "Recommended" | "Optional"] Required

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

Test of raw TemplateData output:

No description.

Template parameters

ParameterDescriptionTypeStatus
Parameter titlename

Specify a title for a parameter of the template documentation

Stringrequired
Parameter nameparam

Specify a name for a parameter of the template documentation

Stringrequired
Parameter alias1alias1

Specify a alias for a parameter of the template documentation

Stringoptional
Parameter alias2alias2

Specify a alias for a parameter of the template documentation

Stringoptional
Parameter alias3alias3

Specify a alias for a parameter of the template documentation

Stringoptional
Parameter Descriptiondesc

Specify a description for a parameter of the template documentation

Default
no description
Contentsuggested
Parameter Exampleexample

Specify an example for a parameter of the template documentation

Default
no example
Contentsuggested
Parameter typetype

Specify a type for a parameter of the template documentation: [[#Data_Dictionary_Notation_.28DDN.29_for_types|Data Dictionary Notation]]

Contentrequired
Parameter statusstatus

Specify a status for a parameter of the template documentation

Contentrequired

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
Example name example param
Example alias 1
Example alias 2
Example alias 3

example description

Default:
NULL
Example:
xyz
String Required

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

Test of raw TemplateData output:

No description.

Template parameters

ParameterDescriptionTypeStatus
Example nameexample param Example alias 1 Example alias 2 Example alias 3

example description

Example
xyz
Stringrequired
{{TemplateData|
{{TemplateData/entry|name=Example name|alias1=Example alias 1|alias2=Example alias 2|alias3=Example alias 3|param=example param|desc=example description|def=NULL|example=xyz|type=String|status=Required}}
}}

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
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 [LowerAlphabet | UpperAlphabet] 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 [ 1 {NonzeroDigit} 1 | 2 {Digit} ] Any natural number without zero
SignedNumber [ "-" + 1 {NonzeroDigit} 1 | 1 {Digit} 1 | ("-") + 2 {Digit} ] Any Integer (dosn't allow -0 only 0)
PercentValue [ 1 {Digit} 2 | "100" ] Any natural number from 0 to 100
SignedPercentValue [ "-" + 1 {NonzeroDigit} 1 | 1 {Digit} 1 | ("-") + 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 ["0" | "1"] 0 (off) or 1 (on)
Month [ 1 {NonzeroDigit} 1 | "10" | "11" | "12"] 1 - 12
Monthfill ["0" + 1 {NonzeroDigit} 1 | "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" ] ) + 1 {Digit} 1 | "30" | "31" ] 1 - 31
Dayfill [ [ "0" | 1" | "2" ] + 1 {Digit} 1 | "30" | "31" ] 01, 02, 03 ... - 31
Year 1 {Digit} Any year
LabeledYear Year + [" AD" | " BC" | " AC"] Any year with label

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>>|{{<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)