Template:Documentation: Difference between revisions
>JulienDethurens Actually, I'm going to remove the edit button because it isn't that useful and logged out users still see it. |
>NXTBoy Added purge link - very useful |
||
Line 2: | Line 2: | ||
<includeonly><onlyinclude><div style="background-color: rgb(244, 244, 244); border-color: grey; border-style: solid; border-width: 1px; padding: 1em;"> | <includeonly><onlyinclude><div style="background-color: rgb(244, 244, 244); border-color: grey; border-style: solid; border-width: 1px; padding: 1em;"> | ||
<div style="border-bottom: 1px solid | <div style="padding-bottom: 3px; border-bottom: 1px solid #aaa; margin-bottom: 1ex"><span style="float: right">[{{purge}}]</span><span style="font-weight: bold; font-size: 125%">[[File:Template-info.png|50px]] Template documentation</span></div> | ||
{{:{{FULLPAGENAME}}/doc}} | {{:{{FULLPAGENAME}}/doc}} | ||
</div></onlyinclude></includeonly> | </div></onlyinclude></includeonly> |
Revision as of 08:18, 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.