打开/关闭菜单
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

目前wiki关闭了自行注册账号的功能,如需注册账号,请查阅Help:注册账号

模板:Documentation/doc:修订间差异

来自RIA | Wiki
Aunst留言 | 贡献
创建页面,内容为“此模板现在<strong>不可用</strong>。 此模板本应用于包含模板的文档化指令和信息, 但是其需要前置模块: Module:Documentation,…”
 
Aunst留言 | 贡献
模板文档
第1行: 第1行:
此模板现在<strong>不可用</strong>。
这是{{tl|Documentation}}模板, 几乎在每个模板页面上都使用它来包含该模板的文档化指令和信息。


此模板本应用于包含模板的文档化指令和信息, 但是其需要前置模块: [[Module:Documentation]], 而此模块又基于MediaWiki的[https://www.mediawiki.org/wiki/Extension:Scribunto Scribunto扩展] (可能还有[https://www.mediawiki.org/wiki/Extension:TemplateStyles TemplateStyles扩展]) , 而这两个扩展都没在Zth Wiki里安装, 所以此模板现在不可用。
有关如何以及何时使用此模板的详细说明, 请参见[[Wikipedia:Template_documentation]]
 
此模板创建一个蓝色的文档框, 就像您现在看到的那样, 并自动从模板的 ''/doc'' 子页面加载内容。如果需要, 它还可以从其他地方加载内容。
 
This template is intended for documenting templates and other pages that are transcluded onto other pages. It can be used in the template namespace and most other namespaces.
 
使用此模板可以在必要时保护模板, 同时允许任何人编辑模板信息和分类。
 
为啥没CSS样式? 因为没装[[mw:Extension:TemplateStyles|TemplateStyles]]扩展。
 
== 使用 ==
通常使用这个模板不需要使用任何参数, 将<code><nowiki>{{Documentation}}</nowiki></code>放置在 <code><nowiki><noinclude>...</noinclude></nowiki></code>之中, 如下示:
<pre>
<!-- 模板代码的最后一行 --><noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
</pre>
然后, 该模板就会自动从所使用的模板的 /doc 子页面加载内容。
 
此模板还可以从任何其他页面加载内容。如下:
<pre>
<!-- 模板代码的最后一行 --><noinclude>
{{Documentation |Template:Other page/doc}}
</noinclude>
</pre>
提示: 当从本地 /doc 子页面以外的页面加载文档时, 处理分类会变得很棘手。
 
内容也可以直接作为文本提供 (就是内联) 。如下:
<pre>
<!-- 模板代码的最后一行 --><noinclude>
{{Documentation
| content =
(一些描述文本)
}}</noinclude>
</pre>
当使用<code>content</code>参数时, doc框通常不会在右上角显示 "[编辑] [清除缓存]" 链接。注意, 如果 /doc 子页面存在, 它的链接仍然显示在doc框下面的链接框中。
 
== 模板数据 ==
{{TemplateData header}}
<templatedata>
{
  "description": "用于创建一个蓝色的文档框, 并自动从 模板的 /doc 子页面加载内容",
  "format": "{{_\n  | _ = _\n}}\n",
  "params":
  {
    "1":
    {
      "label": "链入页面",
      "description": "从任意 /doc 子页面加载文档",
      "type": "string"
    },
    "content":
    {
      "label": "内联文档",
      "description": "内联文档的内容",
      "type": "content"
    },
    "heading":
    {
      "label": "标题文本",
      "description": "设置文档页的标题文本, 如果此处留空, 整个标题行 (包括第一个 [编辑] 链接) 也将隐藏。",
      "type": "string"
    },
    "heading-style":
    {
      "label": "头部 CSS 样式",
      "description": "设置文档页的头部的 CSS 样式",
      "type": "string"
    },
    "link box": { }
  }
}
</templatedata>
 
== 脚注 ==

2021年2月27日 (六) 09:54的版本

这是{{Documentation}}模板, 几乎在每个模板页面上都使用它来包含该模板的文档化指令和信息。

有关如何以及何时使用此模板的详细说明, 请参见Wikipedia:Template_documentation

此模板创建一个蓝色的文档框, 就像您现在看到的那样, 并自动从模板的 /doc 子页面加载内容。如果需要, 它还可以从其他地方加载内容。

This template is intended for documenting templates and other pages that are transcluded onto other pages. It can be used in the template namespace and most other namespaces.

使用此模板可以在必要时保护模板, 同时允许任何人编辑模板信息和分类。

为啥没CSS样式? 因为没装TemplateStyles扩展。

使用

通常使用这个模板不需要使用任何参数, 将{{Documentation}}放置在 <noinclude>...</noinclude>之中, 如下示:

<!-- 模板代码的最后一行 --><noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>

然后, 该模板就会自动从所使用的模板的 /doc 子页面加载内容。

此模板还可以从任何其他页面加载内容。如下:

<!-- 模板代码的最后一行 --><noinclude>
{{Documentation |Template:Other page/doc}}
</noinclude>

提示: 当从本地 /doc 子页面以外的页面加载文档时, 处理分类会变得很棘手。

内容也可以直接作为文本提供 (就是内联) 。如下:

<!-- 模板代码的最后一行 --><noinclude>
{{Documentation
 | content =
 (一些描述文本) 
}}</noinclude>

当使用content参数时, doc框通常不会在右上角显示 "[编辑] [清除缓存]" 链接。注意, 如果 /doc 子页面存在, 它的链接仍然显示在doc框下面的链接框中。

模板数据

这是用于新版可视化编辑器及其他工具的模板数据文档。

Documentation模板数据

用于创建一个蓝色的文档框, 并自动从 模板的 /doc 子页面加载内容

模板参数

此模板有自定义格式。

参数描述类型状态
链入页面1

从任意 /doc 子页面加载文档

字符串可选
内联文档content

内联文档的内容

内容可选
标题文本heading

设置文档页的标题文本, 如果此处留空, 整个标题行 (包括第一个 [编辑] 链接) 也将隐藏。

字符串可选
头部 CSS 样式heading-style

设置文档页的头部的 CSS 样式

字符串可选
link boxlink box

无描述

未知可选

脚注