Documentation
From DramaWiki
Purpose
This is the {{documentation}} template. It is intended for documenting templates and other pages which are transcluded onto other pages. Using this template allows templates to be made read-only where necessary, while allowing anyone to edit the documentation and categories.
This template displays a coloured text box like you are seeing now, and automatically loads the content from a /doc subpage or other places. The idea and the usage of this template was adopted from Wikipedia. For most of the instructions about how and when to use this template, see Wikipedia's article on template documentation.
Usage
In most cases this template is used without any parameters, placed at the bottom of the template or page being documented, within <noinclude>
tags:
<!--Last line of your template code--><noinclude> {{documentation}} <!-- Add categories to the /doc subpage, not here! --> </noinclude>
Then this template automatically loads the content from the /doc subpage of the template it is used on.
This template can also load the content from any other page. Like this:
<!--Last line of your template code--><noinclude> {{documentation|Template:Other page/doc}} </noinclude>
Best practice
The {{documentation}} tag should be added at the bottom of the template code, with no space before <noinclude>
(which would cause extra space on pages where the template is used).
Categories that apply to the template itself should be added to the bottom of the /doc subpage, inside <includeonly>...</includeonly>
tags.
The Categorization of the template its documentation and of the pages that use the template works as follows:
- To place the template itself into a category, add the
[[Category:Category name]]
code inside an<includeonly>
...</includeonly>
section on the /doc subpage. - To place the /doc subpage into a category, add the
[[Category:Category name]]
code inside a<noinclude>
...</noinclude>
section on the /doc subpage. - To make the template place an article into a category (when the article includes the template), add the
[[Category:Category name]]
code inside an<includeonly>
...</includeonly>
section on the template page.
Note: This template is a much less complex version of the Wikipedia template. We support only the parameters described here. Some convenience and customization functions, as well as support for sandbox and testcases are not available here.
See also
- Wikipedia article on template documentation
- {{Documentation subpage}} – Infobox that explains that what follows is documentation, and links to the documented page
- <noinclude> and <includeonly> tags explained on Meta-Wiki