Template:TemplateData/doc: Difference between revisions
Streetclaw (talk | contribs)  Created page with "Template for creating a unified parameter format for templates  == About == Creates a list that displays Template parameter in a unified format.  == Parameter == {{TemplateDat..."  | 
				Streetclaw (talk | contribs)  doc added  | 
				||
| Line 6: | Line 6: | ||
== Parameter ==  | == Parameter ==  | ||
{{TemplateData|  | {{TemplateData|  | ||
{{TemplateData/entry|name=  | {{TemplateData/entry|name=listType|param=1|desc=List type|example=  | ||
<pre>{{#invoke:list|bulleted|a|b|c}}</pre>  | |||
{{#invoke:list|bulleted|a|b|c}}  | |||
<pre>{{#invoke:list|unbulleted|a|b|c}}</pre>  | |||
{{#invoke:list|unbulleted|a|b|c}}  | |||
<pre>{{#invoke:list|horizontal|a|b|c}}</pre>  | |||
{{#invoke:list|horizontal|a|b|c}}  | |||
<pre>{{#invoke:list|ordered|a|b|c}}</pre>  | |||
{{#invoke:list|ordered|a|b|c}}  | |||
<pre>{{#invoke:list|horizontal_ordered|a|b|c}}</pre>  | |||
{{#invoke:list|horizontal_ordered|a|b|c}}  | |||
|def=NULL|type=<nowiki>[ "bulleted" | "unbulleted" | "horizontal" | "ordered" | "horizontal_ordered" ]</nowiki>|status=Required}}  | |||
{{TemplateData/entry|name=listEntries|param=2...x|desc=List entries|def=NULL|type=WikiCode|status=Optional}}  | |||
{{TemplateData/entry|name=olStart|param=start|desc=Start entry. <pre><ol start=""></pre> [https://developer.mozilla.org/de/docs/Web/HTML/Element/ol#Attribute MDN (ol)]. Requires <code>listType</code> <nowiki>[ "ordered" | "horizontal_ordered" ]</nowiki>|example=  | |||
<pre>{{#invoke:list|ordered|a|b|c|start=5}}</pre>  | |||
{{#invoke:list|ordered|a|b|c|start=5}}  | |||
<pre>{{#invoke:list|ordered|a|b|c|start=-5}}</pre>  | |||
{{#invoke:list|ordered|a|b|c|start=-5}}  | |||
|def=1|type=SignedNumber|status=Optional}}  | |||
{{TemplateData/entry|name=olType|param=type|desc=Ordered list type. <pre><ol type=""></pre>  [https://developer.mozilla.org/de/docs/Web/HTML/Element/ol#Attribute MDN (ol)]. Requires <code>listType</code> <nowiki>[ "ordered" | "horizontal_ordered" ]</nowiki>. It's recommended to use <code>style</code>,<code>class</code> or param <code>list_style_type</code> instead|example=  | |||
<pre>{{#invoke:list|ordered|a|b|c|type=i}}</pre>  | |||
{{#invoke:list|ordered|a|b|c|type=i}}  | |||
<pre>{{#invoke:list|ordered|a|b|c|type=a}}</pre>  | |||
{{#invoke:list|ordered|a|b|c|type=a}}  | |||
|def=1|type=<nowiki>[ "1" | "a" | "A" | "i" | "I" ]</nowiki>|status=Optional}}  | |||
{{TemplateData/entry|name=cssType|param=list_style_type|desc=Recommended list style type. Uses the css attribute <code>list-style-type</code>|example=  | |||
<pre>{{#invoke:list|ordered|a|b|c|list_style_type=lower-alpha}}</pre>  | |||
{{#invoke:list|ordered|a|b|c|list_style_type=lower-alpha}}  | |||
<pre>{{#invoke:list|ordered|a|b|c|list_style_type=lower-greek}}</pre>  | |||
{{#invoke:list|ordered|a|b|c|list_style_type=lower-greek}}  | |||
<pre>{{#invoke:list|ordered|a|b|c|list_style_type=decimal-leading-zero}}</pre>  | |||
{{#invoke:list|ordered|a|b|c|list_style_type=decimal-leading-zero}}  | |||
|def=NULL|type=[https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-type MDN (list-style-type)]|status=Optional}}  | |||
{{TemplateData/entry|name=divClass|param=class|desc=<code>class</code> attribute for the <pre><div>...</div></pre> surrounding the list|def=NULL|type=String|status=Optional}}  | |||
{{TemplateData/entry|name=divStyle|param=style|desc=<code>style</code> attribute for the <pre><div>...</div></pre> surrounding the list|def=NULL|type=String|status=Optional}}  | |||
{{TemplateData/entry|name=listStyle|param=list_style|desc=<code>style</code> attribute for the list|def=NULL|type=String|status=Optional}}  | |||
{{TemplateData/entry|name=itemStyle|param=item_style|desc=<code>style</code> attribute for the list items|def=NULL|type=String|status=Optional}}  | |||
{{TemplateData/entry|name=itemXStyle|param=item1_style...itemX_style|desc=<code>style</code> attribute for item x in list|def=NULL|type=String|status=Optional}}  | |||
{{TemplateData/entry|name=itemXValue|param=item1_value...itemX_value|desc=<code>value</code> attribute for item x in list|def=NULL|type=String|status=Optional}}  | |||
{{TemplateData/entry|name=listIndent|param=indent|desc=Set <code>margin-left</code> for list (<code>intent * 1.6 em</code>)|def=NULL|type=String|status=Optional}}  | |||
}}  | }}  | ||
== Examples ==  | == Examples ==  | ||
{{#invoke:list|bulleted|First item|Second item|Third item|item1_style=background-color:yellow;|item2_style=background-color:silver;color:black;}}  | |||
{{  | |||
}}  | |||
<pre>  | <pre>  | ||
{{  | {{#invoke:list|bulleted|First item|Second item|Third item|item1_style=background-color:yellow;|item2_style=background-color:silver;color:black;}}  | ||
}}  | |||
</pre>  | </pre>  | ||
Revision as of 23:34, 31 August 2020
Template for creating a unified parameter format for templates
About
Creates a list that displays Template parameter in a unified format.
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 | |
|---|---|---|---|---|
| listType | 1
 | 
List type
 Default:
 Example: {{#invoke:list|bulleted|a|b|c}}
 {{#invoke:list|unbulleted|a|b|c}}
 {{#invoke:list|horizontal|a|b|c}}
 {{#invoke:list|ordered|a|b|c}}
 {{#invoke:list|horizontal_ordered|a|b|c}}
  | 
[ "bulleted" | "unbulleted" | "horizontal" | "ordered" | "horizontal_ordered" ] | Required | 
| listEntries | 2...x
 | 
List entries
 Default:
 Example: no example  | 
WikiCode | Optional | 
| olStart | start
 | 
Start entry. <ol start="">MDN (ol). Requires listType [ "ordered" | "horizontal_ordered" ]
Default:
 Example: {{#invoke:list|ordered|a|b|c|start=5}}
 {{#invoke:list|ordered|a|b|c|start=-5}}
  | 
SignedNumber | Optional | 
| olType | type
 | 
Ordered list type. <ol type="">MDN (ol). Requires listType [ "ordered" | "horizontal_ordered" ]. It's recommended to use style,class or param list_style_type instead
Default:
 Example: {{#invoke:list|ordered|a|b|c|type=i}}
 {{#invoke:list|ordered|a|b|c|type=a}}
  | 
[ "1" | "a" | "A" | "i" | "I" ] | Optional | 
| cssType | list_style_type
 | 
Recommended list style type. Uses the css attribute list-style-type
Default:
 Example: {{#invoke:list|ordered|a|b|c|list_style_type=lower-alpha}}
 {{#invoke:list|ordered|a|b|c|list_style_type=lower-greek}}
 {{#invoke:list|ordered|a|b|c|list_style_type=decimal-leading-zero}}
  | 
MDN (list-style-type) | Optional | 
| divClass | class
 | 
class attribute for the <div>...</div>surrounding the list Default:
 Example: no example  | 
String | Optional | 
| divStyle | style
 | 
style attribute for the <div>...</div>surrounding the list Default:
 Example: no example  | 
String | Optional | 
| listStyle | list_style
 | 
style attribute for the list
Default:
 Example: no example  | 
String | Optional | 
| itemStyle | item_style
 | 
style attribute for the list items
Default:
 Example: no example  | 
String | Optional | 
| itemXStyle | item1_style...itemX_style
 | 
style attribute for item x in list
Default:
 Example: no example  | 
String | Optional | 
| itemXValue | item1_value...itemX_value
 | 
value attribute for item x in list
Default:
 Example: no example  | 
String | Optional | 
| listIndent | indent
 | 
Set margin-left for list (intent * 1.6 em)
Default:
 Example: no example  | 
String | Optional | 
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
- First item
 - Second item
 - Third item
 
{{#invoke:list|bulleted|First item|Second item|Third item|item1_style=background-color:yellow;|item2_style=background-color:silver;color:black;}}