打开/关闭菜单
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
zh>Evon R'al
Fix typo.
 
甲虫留言 | 贡献
导入1个版本
 
(未显示2个用户的2个中间版本)
第1行: 第1行:
{{Tocright}}
{{NoteTA|G1=MediaWiki|G2=IT}}{{Documentation subpage}}{{High-use|1=20550}}{{Uses Lua|Module:Documentation}}
; Description
== 概要 ==
: This template is used to insert documentation on template pages.
{{See also|Wikipedia:模板文件頁模式}}
这个模板自动显示“模板文档”框,就像你现在看到的这样,文档框中的内容由其它页面生成。


; Dependencies
== 參數及使用方法 ==
:; Uses
# 在主模板中增加<syntaxhighlight lang=wikitext inline><noinclude>{{Documentation}}</noinclude></syntaxhighlight>。
:: {{T|Documentation/preload}} when no actual documentation is added yet.
# 点击“编辑”链接,它将打开/doc子页面,并在那里填写文档。
# 將分類增加在/doc子頁面的<syntaxhighlight lang=wikitext inline><includeonly></includeonly></syntaxhighlight>中。


; Syntax
=== 正常的/doc子页面 ===
: Type <code><nowiki><noinclude>{{Documentation</noinclude></nowiki></code> at the end of the template page.
<syntaxhighlight lang="wikitext">
<noinclude>{{Documentation}}</noinclude>
</syntaxhighlight>


== General usage ==
=== 任意/doc子页面 ===
=== On the Template page ===
<syntaxhighlight lang="wikitext">
You should attach <code><nowiki><noinclude>{{Documentation}}</noinclude></nowiki></code> to the end of the template page, so it looks like the below:
<noinclude>{{Documentation|Template:any page/doc}}</noinclude>
<pre>
</syntaxhighlight>
TEMPLATE CODE HERE
Template code
<includeonly> Any categories to be inserted into articles by the template</includeonly><noinclude>
{{documentation}}</noinclude>
</pre>


This will add the documentation template to the template-page, ''but not to pages where the template is used'' due to the inclusion tags.
=== 内联内容 ===
-{zh-hans:<syntaxhighlight lang="wikitext">
<noinclude>{{Documentation|content=这是一个文档。}}</noinclude>
</syntaxhighlight>; zh-hant:<syntaxhighlight lang="wikitext">
<noinclude>{{Documentation|content=這是一個文件。}}</noinclude>
</syntaxhighlight>;}-


=== On the Template/doc page ===
=== 有[查看][编辑]链接的内联内容 ===
You should fill this out with information on how to use the template. Unused items should be removed.
<syntaxhighlight lang="wikitext">
<noinclude>{{Documentation
|1 = Template:模板名/doc
|content = {{Template:模板名/doc|参数}}
}}</noinclude>
</syntaxhighlight>


:''See also [[Template:Documentation/preload]]''
=== 最佳用法 ===
<pre>
此代码应该放置在模板代码的底部“<syntaxhighlight lang=wikitext inline><noinclude></syntaxhighlight>”之前且不加多余的空格(否则会导致使用该模板的页面上出现多余空格)。参数可以像上面这样来使用以包含任意文档页。
; Description
用于模板本身的分类链接应该用 <syntaxhighlight lang=wikitext inline><includeonly> </includeonly></syntaxhighlight> 标签来添加到文档页面。
: A short description of the purpose of the template.
更复杂的案例请参见 [[Wikipedia:模板文件頁模式#分类链接]]
如果文档页包含 <code>includeonly</code> 或 <code>noinclude</code> 标签并作为文档的一部分,请用“<code>&amp;lt;</code>”替代“<code><</code>”。


; Dependencies
請勿在/doc子頁面裡再掛上{{tlx|Documentation}},以避免出錯。
:; Uses
{{Documentation/TemplateData}}
:: Resource used by this template (Use linking or {{T}} where possible)
:: Resource used by this template
:: Repeat as needed ...
:; Used by
:: Template that uses this template (Preferably by using {{T|Templatename}} ))
:: Repeat as needed ...


; Syntax
== 重定向 ==
: {{T|Templatename|param|...}}
*{{Tl|Doc}}
:; Parameters
*{{Tl|Documentation, template}}
::; param
*{{Tl|Documentations}}
::: Param description
*{{Tl|Template doc}}
::; param
*{{Tl|Template doc page}}
::: Param description
*{{Tl|Template doc page transcluded}}
OR
*&#123;&#123;[[Template:模板文件|-{模板文件}-]]&#125;&#125;
::; param : Param description
*&#123;&#123;[[Template:模板文档|-{模板文档}-]]&#125;&#125;
::; param : Param description
*{{Tl|帮助文档}}
 
<includeonly>{{Sandbox other||
Repeat as needed ...
[[Category:模板說明文件|D]]
 
[[Category:模板頁的模板|D]]
; Sample
[[Category:Lua模板|D]]
: <code>&lt;nowiki>{{templatename}}</nowiki></code> gives...
}}</includeonly>
: {{templatename}}
 
<includeonly>[[Category:Any categories for the template itself]]</includeonly><noinclude>
[[Category:Template documentation]]</noinclude>
</pre>
 
Use any or all of the above description/syntax/sample output sections. You may also want to add "see also" or further usage information sections.
 
Note that the above example also uses {{T|T}} to display the formatting of the template code, without actually calling the template for transclusion (as normally happens with the squiggly brackets).
 
== Rationale ==
This template allows any page to use any documentation page, and makes it possible to protect templates while allowing anyone to edit the template's documentation, categories, and interwiki links.  According to [http://www.mediawiki.org/wiki/Template:Documentation/doc#Rationale MediaWiki] it also helps reduce server resource demand by circumventing certain technical limitations of templates.  Unfortunately they don't say what those limitations are, exactly. - 2012, [[User:Quinn fellthorn]]
: [[User:Telinchei]] would suggest to the those relate to server resources, when deciding what to transclude (finding noinclude tags) from the template page.
 
{{SPW|is newer|name=Documentation}}
 
 
<includeonly>
[[Category:Maintenance templates]]
</includeonly>
<noinclude>
[[Category:Template documentation]]
</noinclude>

2024年10月14日 (一) 09:41的最新版本

概要

这个模板自动显示“模板文档”框,就像你现在看到的这样,文档框中的内容由其它页面生成。

參數及使用方法

  1. 在主模板中增加<noinclude>{{Documentation}}</noinclude>
  2. 点击“编辑”链接,它将打开/doc子页面,并在那里填写文档。
  3. 將分類增加在/doc子頁面的<includeonly></includeonly>中。

正常的/doc子页面

<noinclude>{{Documentation}}</noinclude>

任意/doc子页面

<noinclude>{{Documentation|Template:any page/doc}}</noinclude>

内联内容

<noinclude>{{Documentation|content=这是一个文档。}}</noinclude>

有[查看][编辑]链接的内联内容

<noinclude>{{Documentation
|1 = Template:模板名/doc
|content = {{Template:模板名/doc|参数}}
}}</noinclude>

最佳用法

此代码应该放置在模板代码的底部“<noinclude>”之前且不加多余的空格(否则会导致使用该模板的页面上出现多余空格)。参数可以像上面这样来使用以包含任意文档页。 用于模板本身的分类链接应该用 <includeonly> </includeonly> 标签来添加到文档页面。 更复杂的案例请参见 Wikipedia:模板文件頁模式#分类链接。 如果文档页包含 includeonlynoinclude 标签并作为文档的一部分,请用“&lt;”替代“<”。

請勿在/doc子頁面裡再掛上{{Documentation}},以避免出錯。

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

Documentation模板数据

顯示一個模板的使用說明

模板参数

参数描述类型状态
模板的使用說明所在頁面1

標示該模板的使用說明所在頁面名稱

默认值
{{PAGENAME}}/doc
示例值
Template:Documentation/doc
页面名称可选
模板的使用說明內容content

以所寫的使用說明內容取代該模板的/doc子頁面

示例值
這是這個模板的使用說明
内容可选

重定向