"模板:Documentation/doc" 修訂間的差異

出自 陳富國維基館
前往: 導覽搜尋
(移除跨語言連結,現在由維基數據d:Q4608595提供)
(1個修訂)
 
(未顯示同一使用者於中間所作的 1 次修訂)
行 1: 行 1:
<includeonly>{{pp-template}}</includeonly><noinclude>{{template doc page viewed directly}}</noinclude>
+
<noinclude>{{Documentation subpage}}
这个模板自动显示“模板-{A|zh-hans:文档;zh-hant:文件}-”框,就像你现在看到的这样。文档框中的内容由其它页面生成,
+
{{timw|Documentation}}
{{seealso|Wikipedia:模板文件頁模式}}
+
</noinclude>
== 用法 ==
 
# 在主模板中增加<code>&lt;noinclude&gt;&#123;{Documentation}&#125;&lt;/noinclude&gt;</code>。
 
# 点击“编辑”链接,它将打开<tt>/doc</tt>子页面,并在那里填写文档。
 
# 將分類與跨語言連結增加在<tt>/doc</tt>子頁面的<code>&lt;includeonly&gt;&lt;/includeonly&gt;</code>中。
 
=== 正常的/doc子页面 ===
 
&lt;noinclude&gt;&#123;&#123;{{{template-name|Documentation}}}&#125;&#125;&lt;/noinclude&gt;
 
=== 任意/doc子页面 ===
 
&lt;noinclude&gt;&#123;&#123;{{{template-name|Documentation}}}|Template:any page/doc&#125;&#125;&lt;/noinclude&gt;
 
=== 内联内容 ===
 
&lt;noinclude&gt;&#123;&#123;{{{template-name|Documentation}}}|content=这是一个文档。&#125;&#125;&lt;/noinclude&gt;
 
=== 有[查看][编辑]链接的内联内容 ===
 
&lt;noinclude&gt;&#123;&#123;{{{template-name|Documentation}}}
 
|1 = Template:模板名/doc
 
|content =&#123;&#123;Template:模板名/doc|参数}}
 
}}&lt;/noinclude>
 
  
=== 最佳用法 ===
+
This template automatically displays a documentation box like you are seeing now, of which the content is transcluded from another page. It is intended for pages which are [[Wikipedia:Transclusion|transcluded]] in other pages, i.e. templates, whether in the template namespace or not.
此代码应该放置在模板代码的底部“<code>&lt;noinclude></code>”之前且不加多余的空格(否则会导致使用该模板的页面上出现多余空格)。参数可以像上面这样来使用以包含任意文档页。
+
 
用于模板本身的分类链接和跨维基链接应该用 <code>&lt;includeonly> &lt;/includeonly></code> 标签来添加到文档页面。
+
==Usage==
更复杂的案例请参见 [[Wikipedia:模板文件頁模式#分类链接与跨维基链接]]。
+
===Normal===
如果文档页包含 <code>includeonly</code> 或 <code>noinclude</code> 标签并作为文档的一部分,请用“<code>&amp;lt;</code>”替代“<code><</code>”。
+
<pre>
=== 自定义显示 ===
+
&lt;noinclude&gt;{{documentation}}&lt;noinclude&gt;
替换这些值可以实现特殊的输出效果:
+
or &lt;noinclude&gt;{{documentation|template:any page/doc}}&lt;noinclude&gt;
* <code>{&#123;documentation| '''heading''' = ...}}</code> − 改变“文档”页的标题文字。如果此处留空,整个标题行(包括第一个[编辑]链接)也将隐藏。
+
</pre>
{{tl|模板文档}}{{tl|Template doc}}{{tl|Documentation, template}}{{tl|Doc}}均重定向至此處。
+
 
 +
This code should be added at the bottom of the template code, with no extra space before "<code>&lt;noinclude&gt;</code>" (which would cause extra space on pages where the template is used). The parameter can be used as shown above to transclude an arbitrary documentation page.
 +
 
 +
Add categories and interwiki links to the documentation page inside includeonly tags.
 +
 
 +
If the documentation page contains includeonly or noinclude tags as part of the documentation, replace the "<" with "&amp;lt;".
 +
 
 +
===Customizing display===
 +
Overrides exist to customize the output in special cases:
 +
* <nowiki>{{</nowiki>documentation|'''heading'''=}}: change the text of the "documentation" heading. If this is set to blank, the entire heading line (including the first [edit] link) will also disappear.
 +
 
 +
==Functions==
 +
If the documentation page doesn't exist, the "edit" link includes a [[mw:Manual:Creating pages with preloaded text|preload]] parameter so that clicking it will pre-fill the edit form with the basic documentation page format.
 +
 
 +
==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. It also reduces server resources by circumventing a [[:en:Wikipedia:Template limits|technical limitation of templates]] (see a [{{fullurl:en:Project:Village pump (technical)|diff=prev&oldid=69888944}} developer's explanation]).
 +
 
 +
==See also==
 +
* {{tiw|template doc}} (similar template with more documentation; see [[User:Pathoschild/Sandbox|template comparison]])
 +
* {{tiw|documentation subpage}} (replaces older {{[[template:Template doc page viewed directly|Template doc page viewed directly]]}} and {{[[template:Template doc page transcluded|Template doc page transcluded]]}})
 +
*{{tim|Documentation}}
 +
* [[w:Wikipedia:Template documentation]]
 +
 
 +
{{Languages}}
 +
 
 +
<!-- for the template  -->
 
<includeonly>
 
<includeonly>
[[Category:模板頁的模板]]
+
[[Category:Template documentation| ]]
 +
[[Category:Formatting templates|Template documentation]]
 +
 
 +
[[eo:Ŝablono:Dok]]
 +
[[es:Plantilla:Uso de plantilla]]
 +
[[fr:Modèle:Documentation modèle]]
 +
[[hsb:Předłoha:Doc]]
 +
[[hu:Sablon:Sablondokumentáció]]
 +
[[ko:틀:틀 설명문서]]
 +
[[nl:Sjabloon:Sjabdoc]]
 +
[[ru:Шаблон:Doc]]
 +
[[pl:Szablon:Dokumentacja]]
 +
[[sl:Predloga:Dokumentacija]]
 +
[[uk:Шаблон:Doc]]
 +
[[zh:Template:Template doc]]
 
</includeonly>
 
</includeonly>

於 2013年3月15日 (五) 12:53 的最新修訂

模板:Timw


This template automatically displays a documentation box like you are seeing now, of which the content is transcluded from another page. It is intended for pages which are transcluded in other pages, i.e. templates, whether in the template namespace or not.

Usage

Normal

<noinclude>{{documentation}}<noinclude>
or <noinclude>{{documentation|template:any page/doc}}<noinclude>

This code should be added at the bottom of the template code, with no extra space before "<noinclude>" (which would cause extra space on pages where the template is used). The parameter can be used as shown above to transclude an arbitrary documentation page.

Add categories and interwiki links to the documentation page inside includeonly tags.

If the documentation page contains includeonly or noinclude tags as part of the documentation, replace the "<" with "&lt;".

Customizing display

Overrides exist to customize the output in special cases:

  • {{documentation|heading=}}: change the text of the "documentation" heading. If this is set to blank, the entire heading line (including the first [edit] link) will also disappear.

Functions

If the documentation page doesn't exist, the "edit" link includes a preload parameter so that clicking it will pre-fill the edit form with the basic documentation page format.

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. It also reduces server resources by circumventing a technical limitation of templates (see a developer's explanation).

See also

Language: English