Template:Documentation: Difference between revisions

From Space Station 14 Wiki
m 1 revision imported
Aliser (talk | contribs)
erroneous import
Tag: Manual revert
 
Line 1: Line 1:
<includeonly><!--
<includeonly><!--
-->{{#vardefine: docpage_link|{{{1|{{FULLPAGENAMEE}}/doc}}}}}<!--


--><div class="documentation"><!--
--><div style="
--><div class="documentation-header"><!--
    display: flow-root;
-->[[File:Template-{{#ifexist:{{#vardefineecho:docpage|{{{1|Template:{{#replace:{{{1|{{PAGENAME}}/doc}}}|Template:|}}}}}<!-- end vde -->}}|{{#if:{{{baddoc|}}}|bad}}|no}}info.svg|50px|link=]] <!--
    border: 2px solid var(--border-color);
--><span style="font-weight: bold; font-size: 125%; margin-right: 10px;">Documentation</span> <!--
    padding: 0.4rem;
-->{{#ifeq:{{SUBPAGENAME}}|doc|<!--nothing-->|<!--
    background-color: color-mix(in srgb, var(--action-color-dark-x2) 5%, transparent);
-->{{#ifexist:{{#var:docpage}}|<!--
    border-radius: .2rem;
--><span style="font-size: 90%; font-style: italic;"><!--
"><!--
-->[{{fullurl:{{#var:docpage}}|action=edit}} Edit] this documentation at [{{fullurl:{{#var:docpage}}|redirect=no}} {{FULLPAGENAMEE:{{#var:docpage}}}}].<!--
    --><div style="text-align:center; margin-bottom: 1rem;"><!--
--></span><!--
    --><div style="font-weight: bold; font-size: large;">Template documentation</div><!--
-->}}<!--
    --><span style="font-size: 1.05em;">[[{{#var:docpage_link}}|view]]</span> or <span style="font-size: 1.05em;">[https://wiki.spacestation14.com/wiki/{{#var:docpage_link}}?action=edit edit]</span> this documentation {{colored text|gray|}} [[Template:Documentation|about template documentation]]<!--
-->}}<!--
    --><hr>
--><div style="text-align: right; margin-left: 5px;"><!--
</div><!--
-->([{{fullurl:{{FULLPAGENAMEE}}/doc|action=edit}} edit] • [{{fullurl:{{FULLPAGENAMEE}}/doc|action=history}} history] • [{{fullurl:{{FULLPAGENAMEE}}|action=purge}} purge])<!--
--></div><!--
--></div><!--
<!-- leave line break here -->
{{#if:{{{lua|}}}|{{UsesLua|{{{lua}}} }} }}
<!-- documentation text/error box begins here -->
<div style="border-radius: 5px; border: 2px solid var(--wiki-content-border-color); margin: 0.5em auto 1em; padding: 0.8em 1.2em; background: var(--wiki-content-background-color--secondary);">
<!--
-->{{#ifexist:{{#var:docpage}}|<!--


-->{{#vardefine: below_banner|{{{below banner|{{{bb|}}}}}}}}<!--


If there is documentation
-->{{#if: {{#var:below_banner}}<!--
    -->|{{{below banner|{{{bb|}}}}}}<!--
    -->|<!--
-->}}<!--


-->
-->__TOC__<!--
{{ {{#var:docpage}} }}
-->{{clear}}<!--
<!--
--><br>
{{{{{1|{{PAGENAME}}/doc}}}}}</div></includeonly><noinclude>


{{Documentation|bb=
{{has alias templates|docs}}
}}


Else
[[Category:Templates for documenting other templates]]
 
<templatedata>
-->|<!--
{
-->No documentation subpage exists yet for this template. [{{fullurl:{{FULLPAGENAMEE:Template:{{{1|{{PAGENAME}}}}}}}/doc|action=edit&preload=Template:Doc/preload}} Create one now].<!--
"params": {
-->[[Category:Templates with no documentation]]<!--
"1": {
-->}}<!-- leave line break here -->
"label": "Link override",
<!-- documentation text/error box ends here -->
"description": "Override for the documentation link.",
</div>
"type": "wiki-page-name",
<!-- -->{{#ifeq:{{SUBPAGENAME}}|doc|<!--
"default": "/doc (relative to the page, where this template is included)."
-->{{#ifeq:{{BASEPAGENAME}}|Doc|<!--nothing-->|<!-- only if page is not Template:Doc
},
-->This is the documentation page, it should be transcluded into the main template page. See {{tlx|doc}} for more information. <!--
"below banner": {
-->[[Category:Template documentation]]<!--
"label": "Content below banner",
-->}}<!--
"description": "Content to insert below banner and above documentation.",
-->}}<!--
"type": "content",
--></div><!--
"aliases": [
 
"bb"
--></includeonly><!--
]
 
}
--><noinclude>{{Documentation}}
},
[[Category:Documentation templates| ]]
"description": "This template is used to insert descriptions on template pages.",
</noinclude>
"format": "inline"
}
</templatedata></noinclude>

Latest revision as of 22:29, 19 May 2025


Template documentation
view or edit this documentation about template documentation
Has an alias
This template has an alternative name:

Syntax

Add <noinclude>{{Documentation}}</noinclude> at the end of the template page.

Add <noinclude>{{Documentation}}</noinclude> to transclude an alternative page from the /doc subpage.

Usage

On the Template page

This is the normal format when used:

TEMPLATE CODE
<includeonly>Any categories to be inserted into articles by the template</includeonly>
<noinclude>{{Documentation}}</noinclude>

If your template is not a completed div or table, you may need to close the tags just before {{Documentation}} is inserted (within the noinclude tags).

A line break right before {{Documentation}} can also be useful as it helps prevent the documentation template "running into" previous code.

On the documentation page

The documentation page is usually located on the /doc subpage for a template, but a different page can be specified with the first parameter of the template (see Syntax).

Normally, you will want to write something like the following on the documentation page:

==Description==
This template is used to do something.

==Syntax==
Type <code>{{t|templatename}}</code> somewhere.

==Samples==
<code><nowiki>{{templatename|input}}</nowiki></code> 

results in...

{{templatename|input}}

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

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

Note that the above example also uses the Template:T template.

This template is used to insert descriptions on template pages.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Link override1

Override for the documentation link.

Default
/doc (relative to the page, where this template is included).
Page nameoptional
Content below bannerbelow banner bb

Content to insert below banner and above documentation.

Contentoptional