跳转到内容

Template:Format TemplateData/doc

本页使用了标题或全文手工转换
维基百科,自由的百科全书

这是本页的一个历史版本,由Artoria2e5留言 | 贡献2020年7月7日 (二) 19:14 用法编辑。这可能和当前版本存在着巨大的差异。

此行以下的所有内容都是对模板功能的展示:打开源代码就可以学会怎么使用了。

用法

以下是该模板的模板数据,适用于可视化编辑器等工具。

Format TemplateData模板数据

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实体来处理特殊字符,如<>。

格式化选项

  • Wiki链接可以以通常的方式指定。它们只能在表格中使用;在可视化编辑器中,链接的标题将以纯文本的形式显示。如果URL被指定为[https://en.wikipedia.org Wikipedia],这将在表格中显示为Wikipedia,在可视化编辑器中显示为https://en.wikipedia.org。
  • HTML实体:你可以指定&lt;&gt;&amp;amp;amp;quot;&nbsp;和任何数字实体。
  • HTML标签可以使用;它们不会出现在可视化编辑器中。包裹在这些标签中的内容将只出现在表格中。它根本不会出现在可视化编辑器中;它对参数的详细解释和仅对格式化有用的内容有用。这里尊重换行字符。
  • 模板可以会被包括在内。然而,一些模板可能会输出使JSON无效的内容。
默认值
如果既不提供{{{1}}}也不提供{{{JSON}}},则扫描页面的源代码,寻找<templatedata>标签。
<templadata> 模板数据1
如果未指定JSON参数,将从此参数提取JSON。此选项允许您使用图形化的模板文档编辑器,但它比直接提供实际的JSON对象更棘手。
默认值
见 {{{JSON}}}。
显示目录TOC
如果设置为1,在描述之后为页面插入一个目录。
默认值
0
显示 TemplateDataHeaderheader
如果设置为0,隐藏TemplateDataHeader模板。不推荐。
默认值
1
关闭模板数据输出lazy
如果设置为非0值,关闭真实的模板数据输出。如果页面上有很多份文档的话可能会有用。由于没有真的模板数据,可视化编辑器将不能理解内容。
默认值
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