Template:Documentation

From Predecessor Wiki
Jump to navigation Jump to search
Template-info.svg Documentation

Description

This template is used to insert descriptions on template pages.

Syntax

Add <noinclude>{{Documentation}}</noinclude> or <noinclude>{{doc}}</noinclude> at the end of the template page.

Optional Parameters

clear

If your main template page has floating content and you would like to stop it going over the documentation, put {{doc|clear}} instead of {{doc}} on your main template page.
This is also useful for templates not using <includeonly>, as it will put some space between the template and the documentation box.

nodoc=1

If a template has no documentation and you don't know how to use it, put {{doc|nodoc=1}} (or if the template needs clear as well, {{doc|clear|nodoc=1}}) instead of {{doc}} on your main template page.
The documentation's background will become red to make it more noticeable, and the page will be added to Category:Templates with no documentation.

baddoc=1

Similar to nodoc, this is used to mark templates that do have documentation, but it isn't very good. This can mean it doesn't have enough examples, doesn't explain all the functions properly, or doesn't explain the point of the template properly.
The documentation's background will become yellow to make it more noticeable, and the page will be added to Category:Templates with bad documentation.

Usage

On the Template page

This is the normal format when used:

TEMPLATE CODE
<includeonly>Any categories to be inserted into articles by the template</includeonly>
<noinclude>{{Documentation}}</noinclude>

If your template is not a completed div or table, you may need to close the tags just before {{Documentation}} is inserted (within the noinclude tags).

A line break right before {{Documentation}} can also be useful as it helps prevent the documentation template "running into" previous code.

On the documentation page

The documentation page is located on the /doc subpage for a template.

Normally, you will want to write something like the following on the documentation page:

==Description==
This template is used to do something.

==Syntax==
Type <code>{{t|templatename}}</code> somewhere.

==Examples==
<code>{{tl|templatename|input}}</code> 

results in...

{{templatename|input}}

<includeonly>Any categories for the template itself</includeonly>
<noinclude>[[Category:Template documentation]]</noinclude>

Use any or all of the above description/syntax/sample output sections. You may also want to add "see also" or other sections.

Note that the above example also uses the {{t}} and {{tl}} templates.