Paper Nuavo.png This Page Documents an Official Wiki Policy.
This Page is generally accepted by the community as a guideline for the wiki. Changes should reflect consensus or be approved by a Administrator.
If you Disagree with this Policy, Please Discuss it with an Administrator or on its talk page.
< 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[edit source]

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[edit source]

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[edit source]

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[edit source]

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}}.
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[edit source]

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.
  • It is best to have more than 1 example, it helps the reader think to how to use the template.

Other Sections[edit source]

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[edit source]


{{Green}} is a color template used to add a Green color to text it is applied to.



  • <text> - The text to color.
    • Note the Template uses <span> tags to format the text color.



{{Green|Foo Bar Baz}}

Foo Bar Baz


{{Gold|Foo Bar Baz}}

Foo Bar Baz


{{Yellow|Foo Bar Baz}}

Foo Bar Baz


{{Red|Foo Bar Baz}}

Foo Bar Baz


{{Black|Foo Bar Baz}}

Foo Bar Baz


{{Pink|Foo Bar Baz}}

Foo Bar Baz

List of Color Templates

{{Documentation subpage}}

{{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.
<pre>{{Green|Foo Bar Baz}}</pre>
{{Green|Foo Bar Baz}}
<pre>{{Gold|Foo Bar Baz}}</pre>
{{Gold|Foo Bar Baz}}
<pre>{{Yellow|Foo Bar Baz}}</pre>
{{Yellow|Foo Bar Baz}}
<pre>{{Red|Foo Bar Baz}}</pre>
{{Red|Foo Bar Baz}}
<pre>{{Black|Foo Bar Baz}}</pre>
{{Black|Foo Bar Baz}}

<pre>{{Pink|Foo Bar Baz}}</pre>
{{Pink|Foo Bar Baz}}
==List of Color Templates==


Best Practices[edit source]

  • 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.
Community content is available under CC-BY-SA unless otherwise noted.