Template:Doc-code

To use, create a sub-page from the template called doc, put doc/start at the start of your documentation, and doc/end at the end.

Go back to your main template page and put &lt;noinclude&gt;/doc&lt;/noinclude&gt; on a newline after the end of the template. /doc pages will automatically be added to Category:Documentation pages.

clear
If your main template page has floating content and you would like to stop it going over the documentation, put clear instead of doc/start on your documentation page.

This is also useful for templates not using &lt;includeonly&gt;, as it will put some space between the template and the documentation box.

d=missing
If a template has no documentation and you don't know how to use it, put doc/start (or if the template needs clear as well, clear) instead of doc/start on your documentation page.

The documentation's background will become red to make it more noticeable, and the page will also be added to Category:Templates with no documentation.