Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Documentation/doc: Difference between revisions

Template page
Telinchei (talk | contribs)
As far as I can tell there are no preloads required or broken templates, so I am removing the top section. It did say I could do it, after all!
Telinchei (talk | contribs)
updating with useful and accurate info
Line 1: Line 1:
;Description
;Description
:This template is used to insert documentation on template pages.
:This template is used to insert documentation on template pages.
;Syntax
;Syntax and Parameters
:Type <code>&lt;noinclude>{{t|documentation}}&lt;/noinclude></code> at the end of the template page.
:Type <code><nowiki><noinclude>{{t|documentation|<var>{{FULLPAGENAME}}/doc</var>}}</noinclude></nowiki></code> at the end of the template page. Include the full (exact, including namespace) name of the documentation page as a parameter where posible.


==General usage==
==General usage==
===On the Template page===
===On the Template page===
You should attach <code><nowiki><noinclude>{{t|documentation|{{subst:FULLPAGENAME}}/doc}}</noinclude></nowiki></code> to the end of the template page, so it looks like the below:
<pre>
<pre>
Template code<includeonly>Any categories to be inserted into articles by the template</includeonly><noinclude>
<includeonly> TEMPLATE CODE HERE
{{documentation}}</noinclude>
Any categories to be inserted into articles by the template</includeonly><noinclude>
{{documentation|{{subst:FULLPAGENAME}}/doc}}</noinclude>
</pre>
</pre>
This will fill in add the documentation template to the template-page, ''but not pages where the template is used'' due to the inclusion tags. The subst:FULLPAGENAME serves as a wikimedia "Magic Word" and will be replaced by the wikispace and page name once the edit is completed, and serves to direct the template towards the appropriate page for substitution in case the automatic code fails to work.


===On the Template/doc page===
===On the Template/doc page===
You should fill this out with information on how to use the template. For example,
:''See also [[Template:Documentation/preload]]''
:''See also [[Template:Documentation/preload]]''
<pre>
<pre>
Line 23: Line 28:


<includeonly>Any categories for the template itself</includeonly><noinclude>[[Category:Template documentation|{{PAGENAME}}]]</noinclude>
<includeonly>Any categories for the template itself</includeonly><noinclude>[[Category:Template documentation|{{PAGENAME}}]]</noinclude>
</pre>
</pre> <!-- why should the tags be the same as the main template page? - Telinchei, 2015 -->


Use any or all of the above description/syntax/sample output sections. You may also want to add "see also" or further usage information sections.
Use any or all of the above description/syntax/sample output sections. You may also want to add "see also" or further usage information sections.


Note that the above example also uses {{t|T}}.
Note that the above example also uses {{t|T}} to display the formatting of the template code, without actually calling the template for transclusion (as normally happens with the squiggly brackets).


==Rationale==
==Rationale==