Template writing

As templates can often be fairly complex and depend on various external factors, this page outlines some guidelines for inclusion on Miraheze Template wiki.

Code

 * Templates should be self contained and avoid calling other templates (unless absolutely necessary).
 * Templates which include CSS calls in their design should mention so. Generally it's best avoided, unless the CSS classes exist as standard.
 * For icons use vector graphics where possible. A good source for these is Wikimedia commons Category:SVG_icons.

Usage

 * Templates should have usage and modification instructions. If they require other templates, this fact should be clearly documented, with links to the required templates.
 * Templates should aim to be easy to read and understand even without usage instructions.

Inputs

 * Don't try and make the most extensible template ever - don't make everything a variable for the user to provide. For example, alignment of boxes: just pick an alignment and hard-code it, or make it the default choice.

Layout
For details about how template pages should be structured, see Template layout.

Other notes

 * Templates that are not complete should be placed in the Category:Underconstruction templates via Underconstruction.