缺氧 wiki 编辑团队提示:注册账号并登录后体验更佳,且可通过参数设置定制优化您的浏览体验!
该站点为镜像站点,如果你想帮助这个由玩家志愿编辑的 wiki 站点,请前往原站点参与编辑,
同时欢迎加入编辑讨论群 851803695 与其他编辑者一起参与建设!
模板:Docbunto
此模板调用Dev:Docbunto并为 Lua 模块自动生成文档。
用法示例
{{T|Docbunto|"[[Global Lua Modules/Entrypoint|Entrypoint]]"|code{{=}}"1"}}
程序包函数
entrypoint(package)
(函数)- Entrypoint templating wrapper for Scribunto packages. The module generates an entrypoint function that can execute Scribunto package calls in the template context. This allows a package to support both direct and template invocations.
- 参数:
package
Scribunto package.(表) - 错误:
- 'you must specify a function to call'(string;line 85)
- 'the function you specified did not exist'(string;line 91)
- '$2 is not a function'(string;line 95;可选)
- 返回:Template entrypoint -
main
.(函数)
其他项
main(frame)
(函数)- Template entrypoint function generated by this module.
- 参数:
frame
Scribunto frame in module context.(Frame) - 返回:Module output in template context.(字符串)
注意
- Parent frames are not available in Entrypoint's
frame
. This is because recursive (grandparent) frame access is impossible in legacy Scribunto due to empty-argument expansion cache limitations. - As Entrypoint enables template access rather than a new extension hook, it does not work with named numeric parameters such as
1=
or2=
. This may result in unexpected behaviour such as Entrypoint and module errors.
模板参数
无描述。
参数 | 描述 | 类型 | 状态 | |
---|---|---|---|---|
模块名称 | 1 file | Module page name (without namespace).Default: First sub-page of the "Global Lua Modules" root page or the top-level page name.
| 字符串 | 推荐 |
Infobox Image | image | Infobox image. | 文件 | 可选 |
Caption | caption | Infobox image caption. | 内容 | 可选 |
All | all | Include private items in documentation.
| 布尔值 | 可选 |
Boilerplate | boilerplate | Removal of boilerplate (license block comments).
| 布尔值 | 可选 |
Code | code | Only document Docbunto code items - exclude article infobox and lede from rendered documentation.
| 布尔值 | 可选 |
Colon | colon | Parses tags with a `:` suffix and without the `@` prefix. This bypasses the "doctag soup" some authors complain of.
| 布尔值 | 可选 |
No Lua Reference | noluaref | Don't link to the Lua reference manual for types.
| 布尔值 | 可选 |
Plain | plain | Disable Markdown formatting in documentation.
| 布尔值 | 可选 |
Simple | simple | Limit documentation to descriptions only. Removes documentation of subitem tags such as `@param` and `@field`.
| 布尔值 | 可选 |
Sort | sort | Sort documentation items in alphabetical order instead of source code order.
| 布尔值 | 可选 |
Strip | strip | Remove table index in documentation.
| 布尔值 | 可选 |
UList | ulist | Indent subitems as `<ul>` lists (LDoc/JSDoc behaviour) instead of `<dl>` list.
| 布尔值 | 可选 |
Preface | preface | Preface text to insert between lede & item documentation, used to provide usage and code examples. | 内容 | 推荐 |