Template:Doc subpage/doc
Documentation
A call to this template (inside of a <noinclude>…</noinclude> element, as seen below) should be the first thing on every /doc subpage. Such subpages contain documentation of templates, modules, or data, and (almost) every template should have one (exceptions are listed at Category:Templates not using a documentation subpage). The template provides the boxed message seen above ("This is a subpage…").
See Template:Doc for more information about creating template documentation subpages, including sample code you can start with (beyond just the first line, as seen here) when creating new template documentation.
Usage
<noinclude>{{doc subpage}}[[Category:Template documentation]]</noinclude><noinclude>{{doc subpage}}[[Category:Module documentation]]</noinclude><noinclude>{{doc subpage}}[[Category:Data documentation]]</noinclude>
This template automatically adjusts its message according to what namespace
Sample /doc subpage contents
You can copy and paste the following wiki markup into any /doc subpage you are creating, as a starting point for your documentation. Obviously, this needs a little work before you can save the page. To be more specific, you should replace each … with whatever content is appropriate, flesh out the usage and examples items (replacing TN with the template name), remove the explanatory <!-- comments -->, and omit anything else that's not relevant for your template). See a typical template documentation subpage for how this might look when it's finalized.
For details on how to use the various "tc" templates, see the documentation of {{tc}}, {{tc-var}}, {{tc-numvar}}, {{tc-namevar}}, and {{tc-names}}.
<noinclude>{{doc subpage}}[[Category:Template documentation]]</noinclude>
== Documentation ==
<!-- replace "…" as appropriate and remove all these HTML comments -->
…<noinclude>[[Category:Incomplete template documentation]]</noinclude>
<!-- remove this category once the documentation is sufficiently detailed -->
=== Usage ===
* {{tc|TN}}<!-- replace TN everywhere by the template name -->
* {{tc|TN|…}}<!-- looks like: {{TN|…}} [with no special formatting] -->
* {{tc-var|TN|…|…}}<!-- {{TN|<var>…</var>|<var>…</var>}} -->
* {{tc-numvar|TN|…|…}}<!-- {{TN|1=<var>…</var>|2=<var>…</var>}} -->
* {{tc-namevar|TN|…|…}}<!-- {{TN|…=<var>…</var>|…=<var>…</var>}} -->
* {{tc-names|TN|…|…}}<!-- {{TN|…=|…=}} -->
* {{code|<nowiki>{{TN|…}}</nowiki>}}<!-- for more complex cases -->
<!-- use whichever forms are needed and delete the rest -->
=== Examples ===
* {{tc|TN}} ⇒ {{TN}}
* {{tc|TN|…}} ⇒ {{TN|…}}
* {{code|<nowiki>{{TN|…}}</nowiki>}} ⇒ {{TN|…}}
<includeonly>
[[Category:Templates]]
[[Category:Templates …]]<!-- see previous category for relevant subcats -->
</includeonly>
The code <noinclude>[[Category:Incomplete template documentation]]</noinclude> found immediately below the == Documentation == header is there merely for convenience, so the documentation can be saved before it is complete enough to be totally useful to readers. This causes the documentation subpage to be listed in Category:Incomplete template documentation, so it can be found later and expanded/improved upon. Once you feel like the amount of documentation you have provided is sufficient, that code can be removed.
Note that the categories listed in the <includeonly>…</includeonly> portion at the bottom apply to the template that you are documenting: every template should be listed in Category:Templates, and ideally in a few other template-related categories, based on what the template does and how it does it (see the subcategories of Category:Templates to find where your template should be listed). The only category that the /doc subpage itself should have is Category:Template documentation, provided by the first line of this sample code.
See also
{{doc}}– transcludes a template's documentation onto the template page itself (and provides a way of creating new documentation when it doesn't yet exist)