Template:Wikipedia documentation/doc

From finiki, the Canadian financial wiki

Many Wiki templates were cloned (copied) from Wikipedia. Many are built as nested templates, meaning that to implement a higher-level template, a number of underlying "helper" templates are also required.

Wikipedia's standard method of documenting templates is to add the {{Documentation}}, which displays a green doc box like you are seeing now, and automatically loads the content from a /doc subpage.

When cloning Wikipedia templates, generally the /doc subpage for the top-level template is also cloned so that other editors can read how to use the template. Many of the "helper" templates will never be used directly by a wiki editor, so often their /doc subpage is not cloned. This usually occurs if the /doc subpage contains complexities or dependencies that make it difficult to clone.

The {{Wikipedia documentation}} template attempts to assist in this endeavour, making it very simple to create a /doc subpage that just refers to the corresponding Wikipedia template.

Usage

Suppose your template is named Template:X. Create a subpage with the name Template:X/doc. See the details at {{Documentation subpage}} or start the page by copy-pasting the following standard wikitext:

{{Documentation subpage}}
{{wikipedia documentation}}

<!-- Please place categories where indicated at the bottom of this page -->
== Usage ==


<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
<!-- Categories below this line, please -->

}}</includeonly>

You'll likely need to consult the Wikipedia /doc subpage for which categories they've used and map them into our wiki category system as appropriate. Save the subpage.

You've now created the need /doc subpage which will point the reader to the corresponding Wikipedia template (and documentation).