Template:Documentation: Difference between revisions

From Thadar En
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude>
<includeonly><div style="border: 1px solid black; margin: 3em 1em 1em;"><div style="background: Tan; color: Black; padding: 1em; margin: 0;">'''Template documentation''' <span style="font-size: 85%;">(for the above template, sometimes hidden or invisible)</span></div><div style="padding: 1em 1em 0; margin: 0;">
<!-- Add categories to the /doc subpage -->
{{#if: {{{namespace|}}}|{{:{{{namespace}}}:{{PAGENAME}}/doc}}|{{{{PAGENAME}}/doc}} }}
</div><br style="clear: both;"/><div style="background: Tan; color: Black; padding: 0.5em; margin: 0em; font-size: 85%; text-align: right;">Visit [[{{#if: {{{namespace|}}}|{{{namespace}}}|Template}}:{{PAGENAME}}/doc]] to edit this text! ([[Template:Documentation|How does this work]]?)</div></div></includeonly><noinclude>
{{Documentation}}
[[Category:Template documentation| ]]
[[Category:Template documentation| ]]
</noinclude>
</noinclude>

Latest revision as of 13:57, 25 December 2023

Template documentation (for the above template, sometimes hidden or invisible)

{{Documentation}} formats and displays documentation subpages.

Usage

{{Documentation
| namespace = 
}}
namespace (optional)
If a documented page's namespace isn't Template, enter it here.

This template transcludes the contents of the page's /doc subpage. If the page doesn't exist, it displays a red link to the page.

Example

On a Template page

<includeonly>(Template code)</includeonly><noinclude>
[[Category:Relevant template categories]]
{{Documentation}}
</noinclude>

Note that, depending on the template, you may need to add {{Clear}} or close any open <table> or <div> tags in the template before the {{Documentation}} template.

On a page in any other namespace

(Content)<noinclude>
{{Documentation|namespace=NamespaceName}}
</noinclude>

The namespace parameter lets you add documentation to pages on any namespace. For example, you can document widgets in the Widget namespace or complex CSS or Javascript in the MediaWiki namespace. See Widget:ArticleSpawner for an example.

On the Template/doc page

'''{{tl|Thistemplate}}''' is a template that (describe the template).

== Usage ==
<pre>
(Template usage and parameters)
</pre>

; parameter ''(optional)'': Describe each parameter, and note whether it's optional and has a default value.

== Example ==
<pre>
(Example template usage)
</pre>

produces 

(Example template usage)

Use any or all of the above description, usage, and example sections. You can also add "see also" or further usage information sections.