模板:Documentation:修订间差异

来自PlantsVsZombies Mixed
跳转到导航 跳转到搜索
(创建页面,内容为“<div class="template-documentation" style="background: aliceblue; padding: 1em; border: 1px solid #eee;"><!-- --><div class="template-documentation-header" style="padding-bottom:3px; border-bottom: 1px solid #eee; margin-bottom:1ex"><!-- --><span style="font-weight: bold; font-size: 125%">{{#switch:{{NAMESPACE}} |{{ns:template}}=50px|link= 模板文档 |{{ns:module}}=50px|link= 模块文…”)
无编辑摘要
第2行: 第2行:
  --><div class="template-documentation-header" style="padding-bottom:3px; border-bottom: 1px solid #eee; margin-bottom:1ex"><!--
  --><div class="template-documentation-header" style="padding-bottom:3px; border-bottom: 1px solid #eee; margin-bottom:1ex"><!--
     --><span style="font-weight: bold; font-size: 125%">{{#switch:{{NAMESPACE}}
     --><span style="font-weight: bold; font-size: 125%">{{#switch:{{NAMESPACE}}
     |{{ns:template}}=[[File:Template-info-png.png|50px|link=]] 模板文档
     |{{ns:template}}=[[File:Template-Doc.png|50px|link=]] 模板文档
     |{{ns:module}}=[[File:Template-info-png.png|50px|link=]] 模块文档
     |{{ns:module}}=[[File:Template-Doc.png|50px|link=]] 模块文档
     |{{ns:widget}}=[[File:Template-info-png.png|50px|link=]] 小工具文档
     |{{ns:widget}}=[[File:Template-Doc.png|50px|link=]] 小工具文档
     |#default=文档
     |#default=文档
   }}</span>&nbsp;&nbsp;<span class="editsection plainlinks" style="font-size:small;" id="doc_editlinks">{{#if:{{{content|}}}|
   }}</span>&nbsp;&nbsp;<span class="editsection plainlinks" style="font-size:small;" id="doc_editlinks">{{#if:{{{content|}}}|

2024年2月23日 (五) 07:12的版本

模板文档  [查看] [编辑] [历史] [刷新]

Template:Documentation既可以嵌入/doc子页面,也可以用来进行内联嵌入,同时会将有一定的样式来标记这是文档页。

使用Template:Documentation能够将模板及其页面分离,从而避免内联文档的缺点。

使用方法及其简单,仅需在模板的最后加入<noinclude>{{Documentation}}</noinclude>即可,然后在模板下方就会出现文档内容。

点击创建就能在/doc子页面中创建所需的文档。创建完以后模板页就会自动包含这个文档。

虽然不推荐内联文档,但是对于一些短小的文档,内联的确更加方便。这时候可以使用该模板的content属性:

<noinclude>{{Documentation|content=
内联文档
}}</noinclude>


注意,请确保<noinclude>的开头,接在模板原始码或文字的最后一行后方,不要新起一行。否则,一个多余的新行会被插入到包含该模板的页面中,往往该页面不需要这个新行。

  • 参数1默认值是模板:Documentation/doc。
  • 参数content默认值为空。

分类

  • 要将模板本身置于一个分类中,如果该文档具有/doc子页面,请在/doc子页面上的 <includeonly>...</includeonly> 段落中添加分类。若没有/doc子页面,请在模板页上的 <noinclude>...</noinclude> 段落中添加分类。模板的分类参见分类:PRTS模板
  • 要将 /doc 子页面置于一个分类中,请在 /doc 子页面上的 <noinclude>...</noinclude> 段落中添加分类。