跳转到内容

模板:Documentation:修订间差异

来自天灾之下:危险连接资料站
bwiki>43881503
小 已保护“模板:Documentation”([编辑=仅允许管理员](无限期)[移动=仅允许管理员](无限期))
 
小 导入1个版本
 
(未显示4个用户的5个中间版本)
第1行: 第1行:
<div class="template-documentation" style="background: aliceblue; padding: 1em; border: 1px solid #aaa;"><!--
<noinclude>
--><div class="template-documentation-header" style="padding-bottom:3px; border-bottom: 1px solid #aaa; margin-bottom:1ex"><!--
<languages/>
    --><span style="font-weight: bold; font-size: 125%">{{#switch:{{NAMESPACE}}
</noinclude><includeonly>{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}</includeonly><noinclude>
    |{{ns:template}}=[[File:Template-info.png|50px|link=]] 模板文档
{{documentation|content=
    |{{ns:module}}=[[File:Template-info.png|50px|link=]] 模块文档
 
    |{{ns:widget}}=[[File:Template-info.png|50px|link=]] 小工具文档
{{Lua|Module:Documentation}}
    |#default=文档
<translate><!--T:12--> This template automatically displays a documentation box like the one you are seeing now, of which the content is sometimes transcluded from another page.</translate>
  }}</span>&nbsp;&nbsp;<span class="editsection plainlinks" style="font-size:small;" id="doc_editlinks">{{#if:{{{content|}}}|
<translate><!--T:13--> It is intended for pages which are [[<tvar name=1>Special:MyLanguage/Help:Transclusion</tvar>|transcluded]] in other pages, i.e. templates, whether in the template namespace or not.</translate>
      <!--内联文档-->[[{{fullurl:{{FULLPAGENAME}}|action=edit}} 编辑]]
 
    |{{#ifexist: {{{1|{{Documentation/docname}}}}}
<translate>
      |<!--**/doc 存在  **-->[[{{fullurl:{{{1|{{Documentation/docname}}}}}}} 查看]] [[{{fullurl:{{{1|{{Documentation/docname}}}}}|action=edit}} 编辑]] [[{{fullurl:{{{1|{{Documentation/docname}}}}}|action=history}} 历史]]
== Usage == <!--T:2-->
      |<!--**/doc 不存在**-->[[{{fullurl:{{{1|{{Documentation/docname }}}}}|action=edit}} 创建]]
 
    }} [[{{fullurl:{{FULLPAGENAME}}|action=purge}} 刷新]]
=== Customising display === <!--T:3-->
  }}</span></div><!--
 
--><div id="template_doc_page_transcluded" class="dablink plainlinks" style="font-size:84%;"><!--
<!--T:4-->
  -->{{#if:{{{content|}}}|
Overrides exist to customise the output in special cases:
      <!--内联文档**-->这个[[zhwiki:Wikipedia:模板文件頁模式|文档]]是内联文档。
</translate>
      |{{#ifexist: {{{1|{{Documentation/docname}}}}}
* <nowiki>{{</nowiki>documentation{{!}}'''heading'''=<nowiki>}}</nowiki> - <translate><!--T:5--> change the text of the "documentation" heading.</translate> <translate><!--T:10--> If this is set to blank, the entire heading line (including the first [edit] link) will also disappear.</translate>
        |<!--**/doc存在**-->这个[[Wikipedia:模板文件頁模式|文档]][[Wikipedia:嵌入包含|嵌入]]自[[{{{1|{{Documentation/docname}}}}}]]。
 
      }}
<translate>
    }}
== Rationale == <!--T:6-->
</div>
</translate>
{{#if:{{{content|}}}|{{{content}}}|{{#ifexist:{{{1|{{Documentation/docname}}}}} | {{ {{{1|{{Documentation/docname}}}}} }} }}}}
<translate><!--T:7--> 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 and categories.</translate>
</div>
<translate><!--T:8--> It also reduces server resources by circumventing a [[w:Wikipedia:Template limits|technical limitation of templates]] (see a [[<tvar name=1>:en:Special:Diff/69888944</tvar>|developer's explanation]]).</translate>
<noinclude>[[Category:元模板]]</noinclude>
 
<translate>
== See also == <!--T:9-->
</translate>
* <translate><!--T:14--> [[w:Template:Documentation subpage]]</translate>
* {{tim|Documentation}}
* <translate><!--T:11--> [[w:Wikipedia:Template documentation]]</translate>
 
}}
[[Category:Formatting templates{{#translation:}}|Template documentation]]
[[Category:Template documentation{{#translation:}}| ]]
</noinclude><includeonly>{{#if:{{{content|}}}|
[[Category:Template documentation pages{{#translation:}}]]
}}</includeonly>

2025年12月29日 (一) 21:46的最新版本


模板文档

This template automatically displays a documentation box like the one you are seeing now, of which the content is sometimes 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

Customising display

Overrides exist to customise 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.

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

See also