Template:Documentation: Difference between revisions
>JulienDethurens No edit summary |
>JulienDethurens No edit summary |
(No difference)
|
Revision as of 02:04, 13 March 2012
This is a documentation subpage for Template:Documentation.
It contains usage information, categories and other content that is not part of the original template page.
This template is used for documentation of other templates. It creates a box that will contain the documentation, which should be located on the doc subpage.
Usage
<noinclude>{{Documentation}}</noinclude>
Notes
- This template should be put completely at the bottom of the page.
- This template must be contained in a <noinclude> element, or not be contained in any <onlyinclude> element, if there is at least one in the page. This is so the template is not transcluded with the template, and instead only appears on the template's page itself.
- This template will automatically add the Templates category, so you don't need to add it manually on the page if this template is already used on it.
Consistency
When documenting a template, try to use the same format as the format used by other templates. The top of the page, outside of any section, should contain a brief summary of the description of the template. Then, there should be an usage section containing the usage, where all optional text is between brackets, elements that much be replaced are in bold, and the rest, which much be kept as is, is in a normal form.
Then, there should be a section called "parameters" or "arguments" which uses a description list to describe each parameter.
It is also good to give examples of using the template. There is no preferred way of giving examples, though you should always give the code and the result of it.
Then, add all additional information in other sections. A good example would be this documentation, the one you are currently reading, but it does not have any parameter, so you can not see how they are used here. A good example is the documentation of the {{tag}} template, which you can find on this page, because it contains everything mentioned here, but that is also the case of many other templates.