Template:Dochead/doc: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
Do not use blockquotes for this purpose. The rendered result is unpredictable. Misc. cleanup
Line 1: Line 1:
<includeonly><hr /><span style="font-size: 0.75em;">Documentation transcluded from [[/doc]]</span></includeonly>
<includeonly><hr /><span style="font-size: 0.75em;">Documentation transcluded from [[/doc]]</span></includeonly>
This template automatically inserts the default documentation header:
This template automatically inserts the default documentation header onto the main pages for certain items (mostly templates and modules), while also providing a link to the documentation subpage.


<blockquote class="toccolours">
It also places items inside their respective categories, 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]]).
<div><hr /><span style="font-size: 75%;">Documentation transcluded from [[/doc]]</span></div>
</blockquote>
 
onto the main pages for certain items (mostly templates and modules), while also providing a link to the documentation subpage.
 
It also places items inside their respective categories, 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 ===
Line 15: Line 9:
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:


<blockquote class="toccolours">
'''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:ROOTPAGENAME]].
</blockquote>


where {{nowrap|&laquo;ROOTPAGENAME&raquo;}} refers to 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, but the template which calls the module is named differently, pass in <code>temp=</code> followed by the name of the template.
where "ROOTPAGENAME" refers to 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, but the template which calls the module is named differently, pass in <code>temp=</code> followed by the name of the template.


=== See also ===
=== See also ===
* [[Template:Documentation]] &ndash; Inserts a documentation section onto a template or module.
* [[Template: Documentation]] &ndash; inserts a documentation section onto a template or module.
* [[Template:Doc head Wikipedia]] &ndash; Similar template, used mainly for templates borrowed from Wikipedia.
* [[Template: Doc head Wikipedia]] &ndash; similar template, used mainly for templates borrowed from Wikipedia.


<noinclude>[[Category:Template documentation]]</noinclude>
<noinclude>[[Category:Template documentation]]</noinclude>