Перейти к содержимому страницы
Переключить меню
Переключить меню настроек
Переключить персональное меню
Вы не представились системе
Ваш IP-адрес будет виден всем, если вы внесёте какие-либо изменения.
Сообщество «Повелителя Тайн»Telegram — новости, дунхуа, игры и мерчDiscord — обсуждение книг и теорий, вопросы по вики

Шаблон:LuaFn/Returns

Материал из проекта «Повелитель Тайн Вики»
Документация шаблона (для шаблона выше, иногда скрытого или невидимого)
Примечание: части шаблона или весь шаблон могут быть не видны без заданных значений.
Шаблон Документация Использование
Этот шаблон использует Module:Parameters (править|история), скрипт на языке Lua.

{{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
|type=[fn, invoker, template]
|mode=[table, bullet]
|faq_title=Faq Title
|desc=Description
|returns={{LuaFn/Args}} or {{LuaFn/Returns}}
... 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
ParametersTypeDescriptionStatus
IdLabel
returnsreturnsTemplateDocumentation 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
typetypeString["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
modemodeString["table", "bullet"]Mode parameter, "table" will create a table. "bullet" will make a bullet list.Default: table
faq_titlefaq_titleStringif not empty, it creates an FAQ and places its content inside of it. The title will be the input here.optional
descdescStringDescription of the function or template. If in an FAQ, it will be placed outside the table.optional
Parameters1...20TemplateUse the {{LuaFn/Args}} template here.optional
LuaFn/Args Parameters
Template Parameters
ParametersTypeDescriptionStatus
IdLabel
labellabelStringThe display label for this parameter, preferable over the id which may be a number.optional
defaultdefaultStringThe default value of this parameter.Default: required
requiredrequiredStringIndicates if this parameter is required or not.Default: true
param id1StringThe parameter id. The one that is used to refer to a parameter in a template.required
type2StringThe type of the parameter.optional
description3StringThe description for the parameter.optional
LuaFn/Returns Parameters
Template Parameters
ParametersTypeDescriptionStatus
IdLabel
Parameters1...20AnyUse the {{LuaFn/Args}} template here.optional

Чтобы изменить этот текст, перейдите на Template:LuaFn/doc (как это работает?)