Template:Documentation/doc: Difference between revisions

From NeuroWiki
Jump to navigation Jump to search
创建页面,内容为“{{documentation header}} <!-- Documentation here --> {{Lua}} 对于模板,在末尾插入<code><nowiki>{{subst:doc}}</nowiki></code>,然后保存页面,这将放置<code><nowiki>{{documentation}}</nowiki></code>和一条建议编辑者在何处放置类别和interwiki链接的注释。对于其他类型的页面,文档模板应该存在。 单击页面顶部的“创建”将打开文档页面,并带有某些Template:Documentation/preload|预格…”
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
{{Lua}}
{{Lua}}


对于模板,在末尾插入<code><nowiki>{{subst:doc}}</nowiki></code>,然后保存页面,这将放置<code><nowiki>{{documentation}}</nowiki></code>和一条建议编辑者在何处放置类别和interwiki链接的注释。对于其他类型的页面,文档模板应该存在。
For templates, insert <code><nowiki>{{subst:doc}}</nowiki></code> at the end and save the page. This will place <code><nowiki>{{documentation}}</nowiki></code> and a note suggesting where editors should place categories and interwiki links. For other types of pages, a documentation template should exist.


单击页面顶部的“创建”将打开文档页面,并带有某些[[Template:Documentation/preload|预格式化]]。也可以使用文档页面上的<code><nowiki>{{subst:doc}}</nowiki></code>创建这种格式。
Clicking "Create" at the top of the page will open the documentation page with some [[Template:Documentation/preload|preformatted]] content. You can also use <code><nowiki>{{subst:doc}}</nowiki></code> on the documentation page to create this format.


文档页面将自动添加到[[:Category:文档页面]]。 使用不带<code>subst:</code>的{{t|doc}}会将页面添加到[[:Category:需要替换模板的页面]]
Documentation pages will be automatically added to [[:Category:Documentation Pages]]. Using {{t|doc}} without <code>subst:</code> will add the page to [[:Category:Pages Needing Template Substitution]].


== 可选参数 ==
== Optional Parameters ==
创建页面时,可以将此参数添加到<code> <nowiki>{{subst:doc}}</nowiki></code>模板中,也可以添加到<code><nowiki>{{documentation}}</nowiki></code>模板。
When creating a page, you can add this parameter to the <code><nowiki>{{subst:doc}}</nowiki></code> template or to the <code><nowiki>{{documentation}}</nowiki></code> template.


=== type ===
=== type ===
设置文档的“type”,例如模板、模块、消息等。这将用作模板可能显示的某些消息以及分类的一部分。
Set the "type" of documentation, such as template, module, message, etc. This will be used as part of some messages the template might display and for categorization.


type是基于命名空间的自动类型,因此通常无需设置。
Type is automatically based on the namespace, so it usually doesn't need to be set.


=== page ===
=== page ===
文档所在的页面。默认为当前页面的子页面,称为“doc”。
The page where the documentation is located. Defaults to a subpage of the current page called "doc."


=== content ===
=== content ===
允许直接指定文档内容,而不是在单独的子页面上。 对于特定于小型页面的子页面模板很有用,例如[[爆炸/table]]
Allows specifying the documentation content directly, rather than on a separate subpage. Useful for subpage templates specific to small pages, like [[Explosion/table]].


=== nodoc ===
=== nodoc ===
如果模板没有文档,并且你不知道如何使用它,请在文档页面上的文档模板中添加nodoc=1。文档的背景将变为红色以使其引人注意,并且将页面添加到类别中。
If the template has no documentation and you don't know how to use it, add nodoc=1 to the documentation template on the documentation page. The background of the documentation will turn red to draw attention, and the page will be added to the category.


* [[:Category:没有文档的模板]]
* [[:Category:Templates Without Documentation]]
* [[:Category:没有文档的模块]]
* [[:Category:Modules Without Documentation]]


如果文档页面不存在或为空,则会自动设置,因此通常不需要设置。
If the documentation page doesn't exist or is empty, it's automatically set, so it usually doesn't need to be set.


=== baddoc ===
=== baddoc ===
与nodoc相似,它用于标记''''''文档的模板,但不是很好。这可能意味着它没有足够的示例,未正确解释所有功能或未正确解释模板的要点。文档的背景将变为黄色以使其更引人注目,并且页面将添加到类别中。
Similar to nodoc, it's used to mark templates that '''do''' have documentation, but it's not very good. This might mean it lacks enough examples, doesn't properly explain all features, or doesn't correctly explain the template's main points. The background of the documentation will turn yellow to stand out, and the page will be added to the category.


* [[:Category:文档质量较低的模板]]
* [[:Category:Templates with Poor Documentation Quality]]
* [[:Category:文档质量较低的模块]]
* [[:Category:Modules with Poor Documentation Quality]]




<includeonly>
<includeonly>
<!-- 模板分类/跨语言链接 -->
<!-- Template categories/interwiki links -->
[[Category:文档模板|*]]
[[zh:Template:Documentation]]
 
[[en:Template:Documentation]]
</includeonly>
</includeonly>
<noinclude>
<noinclude>
<!-- 文档分类/跨语言链接 -->
<!-- Documentation categories/interwiki links -->
[[en:Template:Documentation/doc]]
[[zh:Template:Documentation/doc]]
</noinclude>
</noinclude>

Latest revision as of 21:50, 9 November 2024

[ Purge ]
This is the documentation page, it should be placed in should. See Template:Documentation for more information.

This template uses Module:Documentation, this script is written in Lua.
For more details, please refer to Wikipedia:Lua and Extension:Scribunto.

For templates, insert {{subst:doc}} at the end and save the page. This will place {{documentation}} and a note suggesting where editors should place categories and interwiki links. For other types of pages, a documentation template should exist.

Clicking "Create" at the top of the page will open the documentation page with some preformatted content. You can also use {{subst:doc}} on the documentation page to create this format.

Documentation pages will be automatically added to Category:Documentation Pages. Using {{doc}} without subst: will add the page to Category:Pages Needing Template Substitution.

Optional Parameters

When creating a page, you can add this parameter to the {{subst:doc}} template or to the {{documentation}} template.

type

Set the "type" of documentation, such as template, module, message, etc. This will be used as part of some messages the template might display and for categorization.

Type is automatically based on the namespace, so it usually doesn't need to be set.

page

The page where the documentation is located. Defaults to a subpage of the current page called "doc."

content

Allows specifying the documentation content directly, rather than on a separate subpage. Useful for subpage templates specific to small pages, like Explosion/table.

nodoc

If the template has no documentation and you don't know how to use it, add nodoc=1 to the documentation template on the documentation page. The background of the documentation will turn red to draw attention, and the page will be added to the category.

If the documentation page doesn't exist or is empty, it's automatically set, so it usually doesn't need to be set.

baddoc

Similar to nodoc, it's used to mark templates that do have documentation, but it's not very good. This might mean it lacks enough examples, doesn't properly explain all features, or doesn't correctly explain the template's main points. The background of the documentation will turn yellow to stand out, and the page will be added to the category.