These policies should be accepted by the community. Changes should reflect consensus or be approved by the Staff Team.
To dispute a policy, please discuss on the talk page or contact the Staff Team.
- < Policies
Template Documentation are pages documenting how to use a template. In general, they should follow a specific Format. Documentation (Doc for short) pages should also be easy to understand. They can come in any format, but should in general follow this format. Doc are always subpages of the parent template they are describing.
Templates to use for Doc Pages[]
The Following Templates are used for doc pages to describe a page.
{{T}}
- Allows for formatting of template parameters and/or linking templates{{Lua}}
- Creates a Float-right box that indicates this template invokes lua.{{Template shortcut}}
- Indicates the template has a shortcut, or alias created through a redirect to the template's main page.{{Documentation subpage}}
- Used at the top of every template documentation to categorize and notify the readers.- <pre> - Used for Displaying the source code of examples, sometimes used for a template that has too many parameters to display with
{{T}}
. {{Code}}
- Used to format code for arguments.{{Param}}
- Formats text to represent a template argument/parameter{{Documentation}}
- Transcludes the documentation on the template page.
General Layout[]
On the parent template, add the following code to transclude the documentation page: <noinclude>{{Documentation}}</noinclude> This will make the documentation subpage appear on the parent template.
Overview Section[]
The Documentation page should start with {{Documentation subpage}}
. Then you should write a short summary of what the template does.
If the template uses lua, place {{Lua}}
on the top of the page. After that you should add {{TocClear}}
to the end of the section. This will move any excess elements away from the section and add a TOC (Table of contents).
- This is not the only way to write the top section. If you feel the Need to add more information, please feel free to do so.
Syntax[]
This is the most important part. This will describe how to use the template to the reader. There are many styles of syntax documentation, but in general, the following methods are used.
- When describing a parameter, write the parameter name with
{{Param}}
, then go into further detail about the template argument. - When a Template has a shortcut, be sure to use
{{Template shortcut}}
at the beginning of the section to notify the reader of the existence of a shortcut. - Method 1 using
{{T}}
- Example: Template:Green/doc
- Start the section with the
{{T}}
. Then add any parameters the template has. Example:{{Green|<Text>}}
Then, use{{Param}}
to describe any parameters the template has in further details.- Most Documentation pages will use this method, it is the most intuitive and easy to read.
- If the template has too many parameters to fit into 1 line, you can add the m parameter to
{{T}}
to make each line house a parameter instead of just all of the parameters on a single line.
- Method 2 using <pre>
- Example: Template:ArmorStats/doc
- Start the Section with <pre>. Then Write all the template parameters blank, as if you were to actually use the template. Then, In the Parameter arguments, Write a general description of the parameter.
- This method is less easy to read, and should in general only be used if the template has too many parameters to use with
{{T}}
.
- This method is less easy to read, and should in general only be used if the template has too many parameters to use with
- Method 3 Using a Table
- Start the Section with a wikitable. The table layout should follow the following format:
Parameter | Possible Input | Use |
---|---|---|
... |
- Next, Fill the Parameter with the parameter name. Then, in the next column, put its possible inputs. Examples Include A few words, numbers or just anything. In the Third column, elaborate on the parameters uses. This will explain what the parameter does to the output of the template.
- This Method is easier to read than the <pre> method, and is best for templates for a large number of parameters.
- Syntax Section Notes
- If the Parameters are complex even for 1 of these methods, you can create a second section where you elaborate even further on the parameters.
- You can add notes to any of the parameters to alert the user of bugs or other issues or thing that reader should be alerted of.
Examples[]
The examples section of a documentation page shows examples of using the template. This section is just as important if not more than the Syntax section.
- 1 example
- Start the section with <pre>. Write the template example's code in the tag. This shows what source code is shown in the example. Then add a Produces (Can be bold text or a heading) separator between the template output and the source code. Then copy the text in the <pre> tag and paste it below the Produces heading.
- Multiple examples
- Start the section with the same method as above. Then between the examples, add some sort of separator indicating a different example.
- Notes
- It is best to have more than 1 example, it helps the reader think to how to use the template.
Other Sections[]
It is recommended to have other sections besides the ones listed above, to help the reader even more. Possible other sections include See Also, Template Parameter Definitions and more.
- Any Other Sections Should go below the Examples Section.
Example Documentation Subpage[]
Overview
{{Green}}
is a color template used to add a Green color to text it is applied to.
Syntax
{{Green|<text>}}
<text>
- The text to color.- Note the Template uses
<span>
tags to format the text color.
- Note the Template uses
Examples
Green
{{Green|Foo Bar Baz}}
- Produces
Foo Bar Baz
Gold
{{Gold|Foo Bar Baz}}
- Produces
Foo Bar Baz
Yellow
{{Yellow|Foo Bar Baz}}
- Produces
Foo Bar Baz
Red
{{Red|Foo Bar Baz}}
- Produces
Foo Bar Baz
Black
{{Black|Foo Bar Baz}}
- Produces
Foo Bar Baz
Pink
{{Pink|Foo Bar Baz}}
- Produces
Foo Bar Baz
List of Color Templates
==Overview==
{{T|Green}} is a color template used to add a Green color to text it is applied to.
==Syntax==
{{T|Green|text}}
*{{S|text}} - The text to color.
**{{B|Note}} the Template uses {{s|span}} tags to format the text color.
==Examples==
===Green===
<pre>{{Green|Foo Bar Baz}}</pre>
;Produces
{{Green|Foo Bar Baz}}
===Gold===
<pre>{{Gold|Foo Bar Baz}}</pre>
;Produces
{{Gold|Foo Bar Baz}}
===Yellow===
<pre>{{Yellow|Foo Bar Baz}}</pre>
;Produces
{{Yellow|Foo Bar Baz}}
===Red===
<pre>{{Red|Foo Bar Baz}}</pre>
;Produces
{{Red|Foo Bar Baz}}
===Black===
<pre>{{Black|Foo Bar Baz}}</pre>
;Produces
{{Black|Foo Bar Baz}}
===Pink===
<pre>{{Pink|Foo Bar Baz}}</pre>
;Produces
{{Pink|Foo Bar Baz}}
==List of Color Templates==
*{{T|Aqua}}
*{{T|Black}}
*{{T|Blue}}
*{{T|Bronze}}
*{{T|DarkGray}}
*{{T|DarkGreen}}
*{{T|Orange}}
*{{T|DarkPurple}}
*{{T|DarkRed}}
*{{T|Gold}}
*{{T|Gray}}
*{{T|Green}}
*{{T|LightPurple}}
*{{T|Red}}
*{{T|Silver}}
*{{T|Turquoise}}
*{{T|White}}
Best Practices[]
- When creating a documentation subpage, try to make it as understandable as possible. It helps the reader to use their intuition to understand how to use the template.
All Wiki Information | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||
| |||||||||||
| |||||||||||
| |||||||||||
|