Template:Doc
Documentation
A call to this template (placed inside of a <noinclude>…</noinclude> element, as seen below) should be the last thing in (almost) every template on this wiki. It transcludes the contents of the template's /doc subpage, which contains the template's documentation. (Templates intentionally not following this system should be listed at Category:Templates not using a documentation subpage. See Special:UncategorizedTemplates and Special:WantedTemplates for templates lacking /doc subpages, or Category:Incomplete template documentation for templates whose /doc subpages are lacking key information.)
It also provides handy links to edit the template documentation and to update the appearance of the template page when that documentation has been changed (if necessary — this will happen eventually without any special actions beyond just saving your changes to the /doc subpage, but the "show changes" link provided by this template can make that happen faster).
After saving a newly created template containing a call to this template, simply follow the resulting "redlink" to create the template's documentation subpage. Sample wikitext for /doc subpages, suitable for copy-pasting can be found at Template:Doc subpage.
Note that calls to this template are not necessary — and in fact not even possible — on pages in the Module and Data namespaces. Those namespaces have different mechanisms for giving users access to their /doc subpages.
Usage
For templates only:
active content of template here<noinclude>{{doc}}</noinclude><includeonly>active content of template here</includeonly><noinclude>{{doc}}</noinclude>
The active content of the template should be immediately followed, on the same line, by the <noinclude> tag. This is to prevent extra whitespace from being introduced into the calling template's output, which can have very strange side-effects in some cases.
See also
{{doc subpage}}– marks a/docsubpage as being documentation- Category:Templates especially useful in template documentation
- Category:Templates for illustrating wiki markup – more templates that may be useful in template documentation