Template:Documentation: Difference between revisions

Template page
(what was I thinking)
(forgot the rest)
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
<div style="display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.5em">
<div style="display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.5em">
<div style="font-size: 1.5em; font-weight: bold">Template documentation</div>
<div style="font-size: 1.5em; font-weight: bold">Template documentation</div>
<div><nowiki>[</nowiki>[[{{FULLPAGENAME}}/doc|view]]<nowiki>]</nowiki> <span class="plainlinks"><nowiki>[</nowiki>[{{fullurl:{{FULLPAGENAME}}/doc|action=edit}} edit]<nowiki>]</nowiki></span></div>
<div><nowiki>[</nowiki>[[{{{1|{{FULLPAGENAME}}/doc}}}|view]]<nowiki>]</nowiki> <span class="plainlinks"><nowiki>[</nowiki>[{{fullurl:{{{1|{{FULLPAGENAME}}/doc}}}|action=edit}} edit]<nowiki>]</nowiki></span></div>
</div>
</div>
<div class="steel" style="padding: 1.25em">{{#ifexist: {{FULLPAGENAME}}/doc | {{{{FULLPAGENAME}}/doc}} | Documentation for this template does not exist yet at [[{{FULLPAGENAME}}/doc]]. Click the link to create it. }}</div>
<div class="steel" style="padding: 1.25em">{{#ifexist: {{{1|{{FULLPAGENAME}}/doc}}} | {{ {{{1|{{FULLPAGENAME}}/doc}}} }} | Documentation for this template does not exist yet at [[{{{1|{{FULLPAGENAME}}/doc}}}]]. Click the link to create it. }}</div>
</div>
</div>

Latest revision as of 19:24, 26 October 2025

Template documentation
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

<noinclude>{{Documentation|<optional page name>}}</noinclude>

By default, this template retrieves documentation at Template:YOURTEMPLATE/doc. The unnamed first parameter is optional and can be used to point to documentation on a different page.

Template:Documentation 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, add the documentation template like this:

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

If your template is named Template:Bold, and you want to reuse documentation from Template:Italics, fill in the first parameter like this:

'''{{{1}}}'''<noinclude>{{Documentation|Template:Italics/doc}}</noinclude>