Template:Documentation/doc
這是 {{Documentation}} 模板的說明文件頁面。 本文件並不是為直接瀏覽而撰寫。若是其中使用了跨維基計畫連結,某些連結可能會顯示損毀。請勿將這些連結替換為硬编码的頁面名稱或網址。 |
这个模板自动显示“模板文档”框,就象你现在看到的这样。文档框中的内容由其它页面生成,
用法
[编辑]- 在主模板中增加
<noinclude>{{Documentation}}</noinclude>
。 - 点击“编辑”链接,它将打开/doc子页面,并在那里填写文档。
- 將分類與跨語言連結增加在/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>
Best practice
[编辑]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> </includeonly>
tags.
If the documentation page contains includeonly or noinclude tags as part of the documentation, replace the "<" with "<".
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.
功能
[编辑]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
[编辑]- Use of this template allows templates to be protected where necessary, while allowing anyone to edit the documentation, categories, and interwiki links.
- Text on the template page itself adds to the amount of text which must be processed when displaying the template, which is limited for performance reasons: there is a pre-expand include size maximum of 2,048,000 bytes. Placing the documentation in a subpage reduces the wikitext for documentation on the template page itself to a template call and noinclude tags. MediaWiki developers have recommended this system for this reason.
重定向
[编辑]{{模板文档}}重定向至此處。