Template:Documentation: Difference between revisions
>JulienDethurens Added automatic clearance of floats. |
>JulienDethurens No edit summary |
||
Line 1: | Line 1: | ||
<includeonly>{{ifexist|1=:{{FULLPAGENAME}}/doc|2=<div class="visualClear" style="background-color: rgb(95%, 95%, 95%); border-color: grey; border-style: solid; border-width: 1px; padding: 1em"><div style="padding-bottom: 1em; border-bottom: 1px solid #aaa; margin-bottom: 1ex"><span style="float: right">[{{purge|purge}}]</span><span style="font-weight: bold; font-size: 125%">[[File:Template-info.png{{!}}50px]] Template | <includeonly>{{ifexist|1=:{{FULLPAGENAME}}/doc|2=<div class="visualClear" style="background-color: rgb(95%, 95%, 95%); border-color: grey; border-style: solid; border-width: 1px; padding: 1em"><div style="padding-bottom: 1em; border-bottom: 1px solid #aaa; margin-bottom: 1ex"><span style="float: right">[{{purge|purge}}]</span><span style="font-weight: bold; font-size: 125%">[[File:Template-info.png{{!}}50px]] Template documentation</span></div>{{:{{FULLPAGENAME}}/doc}}</div>[[Category:Templates]]|3=<p class="error">The documentation page does not exist and must be created.</p>}}</includeonly><noinclude>{{documentation}}</noinclude> |
Revision as of 04:05, 9 April 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.