Difference between revisions of "Template:Documentation"

From Team Fortress Wiki
Jump to: navigation, search
m (1 revision: Imported from TF2 Wiki.)
m (fix create link)
 
(27 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<includeonly>
+
<div id="template-documentation" style="clear: both; margin: 1em 0 0 0; border: 1px solid #aaa; background-color: #ecfcf4; padding: 1em; font-family: sans-serif">
<div style="border:1px solid #aaa;background:#F2F2FC;width=100%;padding:0.5em">
+
<div style="padding-bottom:3px; border-bottom:1px solid #aaa; margin-bottom:1ex">
<div style="float: right;">&#91;[[{{{1|{{NAMESPACE}}:{{PAGENAME}}/doc}}}|view]]&#93;&nbsp;&#91;[{{SERVER}}{{localurl:{{{1|{{NAMESPACE}}:{{PAGENAME}}}}}/doc|action=edit}} edit]&#93;
+
<span style="font-weight:bold; font-size:125%">Template documentation</span>
 +
<span id="doc-editlinks" class="plainlinks">{{#ifexist:{{FULLPAGENAME}}/doc|&#91;[[{{FULLPAGENAME}}/doc|view]]&#93; &#91;[{{fullurl:{{FULLPAGENAME}}/doc|action=edit}} edit]&#93; &#91;[{{fullurl:{{FULLPAGENAME}}/doc|action=history}} history]&#93; &#91;[{{fullurl:{{FULLPAGENAME}}|action=purge}} purge]&#93;|{{#if:{{{1|}}}||&#91;[[{{FULLPAGENAME}}/doc|create]]&#93;}}}}</span>
 
</div>
 
</div>
<span style="font-size:188%">Documentation for ''{{{1|{{PAGENAME}}}}}''</span>
+
{{#ifexist:{{FULLPAGENAME}}/doc|{{{{FULLPAGENAME}}/doc}}|{{{1|}}}}}
----
 
{{ #ifexist: {{{1|{{NAMESPACE}}:{{PAGENAME}}/doc}}} | <!-- /doc exists -->::[[Image:Icon-tf2wiki-policy.png|25px|link={{NAMESPACE}}:{{PAGENAME}}/doc]]  ''This [[:Category:Template documentation|documentation]] is transcluded from [[{{{1|{{NAMESPACE}}:{{PAGENAME}}/doc}}}]]''. |<!-- no /doc --> }}
 
{{ #ifexist: {{{content|{{NAMESPACE}}:{{PAGENAME}}/doc}}| {{{{{content|{{NAMESPACE}}:{{PAGENAME}}/doc}}}}} | }}
 
 
</div>
 
</div>
__NOEDITSECTION__
 
</includeonly>
 
 
<noinclude>
 
{{Template doc}}
 
[[Category:Templates|{{PAGENAME}}]]
 
 
[[Category:Every page]]</noinclude>
 

Latest revision as of 00:53, 4 March 2025

Template documentation [view] [edit] [history] [purge]

This template is used to show documentation that explains other templates.

Usage

Add this template to the end of other templates while wrapped in <noinclude> tags to show the documentation. It will show the /doc subpage of the template in a green box.

<!--Last line of your template code--><noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage, not here -->
</noinclude>

Alternatively, you can use a parameter for documentation instead of creating a /doc page:

<!--Last line of your template code--><noinclude>
{{Documentation|
<!--Documentation goes here-->
}}
</noinclude>