Template:Dochead/doc: Difference between revisions
Do not use blockquotes for this purpose. The rendered result is unpredictable. Misc. cleanup |
ArrowHead294 (talk | contribs) mNo edit summary |
||
(10 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{ {{ROOTPAGENAME}} }} | |||
This template automatically | This template automatically categorizes documentation by namespace, which eliminates the need to do this manually. Currently, it is configured to place modules and their documentation inside their respective categories ([[:Category: Lua modules]] and [[:Category: Module documentation]]). | ||
=== Usage === | === Usage === | ||
This template is invoked by placing <code>{{ | This template is invoked by placing <code><nowiki>{{dochead}}</nowiki></code> at the top of a module or template's <code>/doc</code> subpage. | ||
On modules, unless <code>header=none</code> is passed, a header will appear to inform users that modules should be called via templates instead of being invoked directly: | On modules, unless <code>header=none</code> is passed, a header will appear to inform users that modules should be called via templates instead of being invoked directly: | ||
'''Note:''' Do not invoke this module directly; use the corresponding template instead: [[mw:Help:Magic words#Page names|Template:ROOTPAGENAME]]. | '''Note:''' Do not invoke this module directly; use the corresponding template instead: [[mw:Help:Magic words#Page names|Template:<nowiki>{{ROOTPAGENAME}}</nowiki>]]. | ||
where " | where <code>ROOTPAGENAME</code> is a [[mw:Help:Magic words|"magic word"]] that returns the name of the page without the namespace or subpages. | ||
This way, the link in the header will attempt to point to a template with the same name as the module, since this is mostly the case. If the template which calls the module has a different name, pass in <code>temp=</code> followed by the name of the template. | |||
=== See also === | === See also === | ||
* [[Template: Documentation]] | * [[Template: Documentation]] – inserts a documentation section onto a template or module. | ||
* [[Template: Doc head Wikipedia]] | * [[Template: Doc head Wikipedia]] – similar template, used mainly for templates borrowed from Wikipedia. | ||