Template:Documentation
This template uses Module:Documentation, this script is written in Lua.
For more details, please refer to Wikipedia:Lua and Extension:Scribunto.
For templates, insert {{subst:doc}}
at the end and save the page. This will place {{documentation}}
and a note suggesting where editors should place categories and interwiki links. For other types of pages, a documentation template should exist.
Clicking "Create" at the top of the page will open the documentation page with some preformatted content. You can also use {{subst:doc}}
on the documentation page to create this format.
Documentation pages will be automatically added to Category:Documentation Pages. Using {{doc}} without subst:
will add the page to Category:Pages Needing Template Substitution.
Optional Parameters
When creating a page, you can add this parameter to the {{subst:doc}}
template or to the {{documentation}}
template.
type
Set the "type" of documentation, such as template, module, message, etc. This will be used as part of some messages the template might display and for categorization.
Type is automatically based on the namespace, so it usually doesn't need to be set.
page
The page where the documentation is located. Defaults to a subpage of the current page called "doc."
content
Allows specifying the documentation content directly, rather than on a separate subpage. Useful for subpage templates specific to small pages, like Explosion/table.
nodoc
If the template has no documentation and you don't know how to use it, add nodoc=1 to the documentation template on the documentation page. The background of the documentation will turn red to draw attention, and the page will be added to the category.
If the documentation page doesn't exist or is empty, it's automatically set, so it usually doesn't need to be set.
baddoc
Similar to nodoc, it's used to mark templates that do have documentation, but it's not very good. This might mean it lacks enough examples, doesn't properly explain all features, or doesn't correctly explain the template's main points. The background of the documentation will turn yellow to stand out, and the page will be added to the category.