Template:Documentation: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>JulienDethurens
No edit summary
>JulienDethurens
Too close to the template in certain cases.
 
(32 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{documentation}}
<noinclude>{{documentation}}</noinclude><includeonly>{{ifexist|1=:{{FULLPAGENAME}}/doc|2=<div class="visualClear" style="margin-top: 1em; 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>
 
<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 rgb(170, 170, 170); font-weight: bold; font-size: 125%; margin-bottom: 1em;">[[File:Template-info.png|50px]] Template Documentation</div>
{{:{{FULLPAGENAME}}/doc}}
</div></onlyinclude></includeonly>

Latest revision as of 05:24, 30 April 2012

[purge] Template documentation

Documentation subpage icon

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.