Шаблон:LuaFn/Returns
Материал из проекта «Повелитель Тайн Вики»
Дополнительные действия
Документация шаблона (для шаблона выше, иногда скрытого или невидимого)
Примечание: части шаблона или весь шаблон могут быть не видны без заданных значений.
Примечание: части шаблона или весь шаблон могут быть не видны без заданных значений.
| Шаблон | Документация | Использование |
{{LuaFn}} is used for generating function parameters with pre formatted settings.
It allows documentation of function and function parameters to be decorated a lot more easily. At least within the defaults.
Usage
- Basic Usage
{{LuaFn|<{{t|LuaFn/Args}}>}}
{{LuaFn/Args|<param id>|<type>|<description>}}
- All Parameters
{{LuaFn
|type=[fn, invoker, template]
|mode=[table, bullet]
|faq_title=Faq Title
|desc=Description
... As many as you need.
}}
{{LuaFn/Args|<label=label>|<required=[true/false] or default=default value>|<param id>|<type>|<description>}}
Parameters
This also doubles as examples.
LuaFn Parameters
Template Parameters | ||||
|---|---|---|---|---|
| Parameters | Type | Description | Status | |
| Id | Label | |||
| returns | returns | Template | Documentation for the return value. For a lua function, this is necessary. For single return values use {{LuaFn/Args}}, for multiple use {{LuaFn/Returns}} which allows for more {{LuaFn/Args}}. | optional |
| type | type | String["fn", "invoker", "template"] | Type parameter, "fn" indicates for use inside of lua functions. "invoker" for use inside #invoke. And "template" for use inside of template parameters. | optional |
| mode | mode | String["table", "bullet"] | Mode parameter, "table" will create a table. "bullet" will make a bullet list. | Default: table |
| faq_title | faq_title | String | if not empty, it creates an FAQ and places its content inside of it. The title will be the input here. | optional |
| desc | desc | String | Description of the function or template. If in an FAQ, it will be placed outside the table. | optional |
| Parameters | 1...20 | Template | Use the {{LuaFn/Args}} template here. | optional |
LuaFn/Args Parameters
Template Parameters | ||||
|---|---|---|---|---|
| Parameters | Type | Description | Status | |
| Id | Label | |||
| label | label | String | The display label for this parameter, preferable over the id which may be a number. | optional |
| default | default | String | The default value of this parameter. | Default: required |
| required | required | String | Indicates if this parameter is required or not. | Default: true |
| param id | 1 | String | The parameter id. The one that is used to refer to a parameter in a template. | required |
| type | 2 | String | The type of the parameter. | optional |
| description | 3 | String | The description for the parameter. | optional |
LuaFn/Returns Parameters
Template Parameters | ||||
|---|---|---|---|---|
| Parameters | Type | Description | Status | |
| Id | Label | |||
| Parameters | 1...20 | Any | Use the {{LuaFn/Args}} template here. | optional |
Чтобы изменить этот текст, перейдите на Template:LuaFn/doc (как это работает?)