Template:Format TemplateData/doc
外观

![]() | 此頁面是Template:Format TemplateData的Template文档。 此頁面可能包含了模板的使用說明、分類和其他内容。 |
![]() | 此模板使用Lua语言: |
此行以下的所有内容都是对模板功能的展示:打开源代码就可以学会怎么使用了。
用法
This template formats TemplateData nicely on doc pages. It hides irrelevant information such as "Default: empty", and allows the use of formatting. Remember that the users of 可视化编辑器 will not see this formatting; it is important to test your new TemplateData in 可视化编辑器 to check that it makes sense without. (For all details of formatting available, see the template's page.) By default, {{tl|TemplateData header}} is automatically inserted before the table.
参数 | 描述 | 类型 | 状态 | |
---|---|---|---|---|
JSON 模板数据 | JSON | 通常会被包裹在<templatedata>标签中的代码(不包括<templatedata>标签本身。链接和基本的文本格式应该只是在显示的表格中工作;完整的细节请参见本模板的页面。你应该使用HTML实体来处理特殊字符,如<>。 格式化选项
| 字符串 | 推荐 |
<templadata> 模板数据 | 1 | 如果未指定JSON参数,将从此参数提取JSON。此选项允许您使用图形化的模板文档编辑器,但它比直接提供实际的JSON对象更棘手。
| 字符串 | 可选 |
显示目录 | TOC | 如果设置为1,在描述之后为页面插入一个目录。
| 布尔 | 推荐 |
显示 TemplateDataHeader | header | 如果设置为0,隐藏TemplateDataHeader模板。不推荐。
| 布尔 | 可选 |
关闭模板数据输出 | lazy | 如果设置为非0值,关闭真实的模板数据输出。如果页面上有很多份文档的话可能会有用。由于没有真的模板数据,可视化编辑器将不能理解内容。
| 布尔 | 可选 |
Using the template
Add the <templatedata>
as usual, and then enclose it in a template call like {{Format TemplateData|1=<templatedata>...</templatedata>}}
.
Maintenance categories
- Category:Templates with TemplateData errors(0) – the template adds this category to template documentation pages with malformed TemplateData code.