Template:Documentation: Difference between revisions

Template page
imported>76561198045853337
(add edit/view links)
m (MV to Module)
Line 1: Line 1:
<includeonly><div style="clear: both; border: 1px solid black; margin:1em;">
<includeonly>{{#invoke:Documentation|doc}}__NOEDITSECTION__{{#seo:
<div style="background-color:#AD5300; padding:1em;">'''Template documentation''' <span style="font-size: 85%;">(for the above template, sometimes hidden or invisible)</span><div style="float:right">[[{{fullurl:{{{1|{{FULLPAGENAME}}/doc}}}|action=edit}} edit] &bull; [[{{{1|{{FULLPAGENAME}}/doc}}}|view]]]</div></div>
|type = website
<div style="background-color:#222222; padding:1em;"><!--
|description = {{FULLPAGENAME}} is a template page used on the Star Citizen Wiki. Templates are pages that are embedded (transcluded) into other pages to allow for the repetition of information.
-->{{#ifexist: {{{1|{{FULLPAGENAME}}/doc}}}
|site_name = Star Citizen Wiki
    | {{tocright}}{{{{#ifeq: {{NAMESPACE}} | {{ns:Template}} |
|locale = {{PAGELANGUAGE}}
                    | :{{NAMESPACE:{{{1|{{FULLPAGENAME}}}}}}}:
}}</includeonly><noinclude>{{/doc}}</noinclude>
                    }}{{ #if: {{{1|}}} | {{PAGENAME:{{{1}}}}} | {{PAGENAME}}/doc}} }}
    | :<strong class="error">This template currently doesn't have any documentation!</strong> Help out by [{{fullurl:{{{1|{{FULLPAGENAME}}/doc}}}|action=edit&preload=Template:Documentation/preload}} writing some]. [[Category:Templates without documentation]]
  }}{{clear}}</div>
<div style="background-color:#666666; padding:0.5em; font-size: 85%; text-align: right;"><!--
-->Visit {{ #ifexist: {{{1|{{FULLPAGENAME}}/doc}}} | [[{{{1|{{FULLPAGENAME}}/doc}}}]] | [{{fullurl:{{{1|{{FULLPAGENAME}}/doc}}}|action=edit&preload=Template:Documentation/preload}} {{{1|{{FULLPAGENAME}}/doc}}}] }} to edit this text! ([[Template:Documentation|How does this work]]?) ([{{fullurl:{{FULLPAGENAME}}|action=purge}} Refresh] this text - [[Help:Purge|why?]])</div>
</div></includeonly><noinclude>
{{Documentation|Template:documentation/doc}}
</noinclude>

Revision as of 22:57, 15 January 2024

Description
This template is used to insert documentation on template pages.
Syntax and Parameters
Type <noinclude>{{t|documentation|<var>{{FULLPAGENAME}}/doc</var>}}</noinclude> at the end of the template page. Include the full (exact, including namespace) name of the documentation page as a parameter where possible.

General usage

On the Template page

You should attach <noinclude>{{t|documentation|{{subst:FULLPAGENAME}}/doc}}</noinclude> to the end of the template page, so it looks like the below:

<includeonly> TEMPLATE CODE HERE
Any categories to be inserted into articles by the template</includeonly><noinclude>
{{documentation|{{subst:FULLPAGENAME}}/doc}}</noinclude>

This will fill in and 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

You should fill this out with information on how to use the template. For example,

See also Template:Documentation/preload
;Description
:This template is used to do something.
;Syntax
:Type <code>{{t|templatename}}</code> somewhere.
;Sample output
:<code><nowiki>{{templatename|foo}}</nowiki></code> gives...
:{{templatename|foo}}

<includeonly>Any categories for the template itself</includeonly><noinclude>[[Category:Template documentation|{{PAGENAME}}]]</noinclude>

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}} to display the formatting of the template code, without actually calling the template for transclusion (as normally happens with the squiggly brackets).

🍪 We use cookies to keep session information to provide you a better experience.