Template:Documentation/doc: Difference between revisions

Template page
(Created page with "'''Template:Documentation''' is used to add instructions on how to use a template, including an explanation of its syntax and parameters, recommended usage, and example code. When added to a page, it will transclude a subpage, found at <code>Template:YOURTEMPLATE/doc</code> (which initially will be a red link) – write your documentation on that subpage. ==Usage== Place the following at the bottom of a template: <pre><noinclude>{{Documentation}}</noinclude></pre> Thi...")
 
(tweaks)
 
Line 1: Line 1:
'''Template:Documentation''' is used to add instructions on how to use a template, including an explanation of its syntax and parameters, recommended usage, and example code. When added to a page, it will transclude a subpage, found at <code>Template:YOURTEMPLATE/doc</code> (which initially will be a red link) – write your documentation on that subpage.
'''Template:Documentation''' is used to add instructions on how to use a template, including an explanation of its syntax and parameters, recommended usage, and example code. When added to a page, it will transclude a subpage found at <code>Template:YOURTEMPLATE/doc</code> (which initially will be a red link) – write your documentation on that subpage.


==Usage==
==Usage==
Line 6: Line 6:
<pre><noinclude>{{Documentation}}</noinclude></pre>
<pre><noinclude>{{Documentation}}</noinclude></pre>


This '''must''' come directly after the last character in your template (do not place it on a new line).
This '''must''' come directly after the last character in your template do not place it on a new line.


==Example==
==Example==

Latest revision as of 20:57, 22 October 2025

Template:Documentation is used to add instructions on how to use a template, including an explanation of its syntax and parameters, recommended usage, and example code. When added to a page, it will transclude a subpage found at Template:YOURTEMPLATE/doc (which initially will be a red link) – write your documentation on that subpage.

Usage

Place the following at the bottom of a template:

<noinclude>{{Documentation}}</noinclude>

This must come directly after the last character in your template – do not place it on a new line.

Example

If you have a template to create bold text that looks like this:

'''{{{1}}}'''

Add the documentation template like this:

'''{{{1}}}'''<noinclude>{{Documentation}}</noinclude>