Template:Documentation/doc: Difference between revisions

[checked revision][checked revision]
Content deleted Content added
Created page with "{{template shortcut|doc}} <noinclude>{{pp-semi-indef}} </noinclude>{{Distinguish|Template:Documentation subpage}} {{Documentation subpage}} {{High-use| 71768 }} {{stack|{{Lua|..."
m Text replacement - "CSS" to "CSS"
 
(5 intermediate revisions by the same user not shown)
Line 3:
</noinclude>{{Distinguish|Template:Documentation subpage}}
{{Documentation subpage}}
{{High-use| 71768 }}
{{stack|{{Lua|Module:Documentation}}}}
<!---- Categories where indicated at the bottom of this page, please; interwikis at Wikidata ---->
Line 10:
This is the '''{{tlf|Documentation}}''' template used on almost every [[Help:A quick guide to templates|template page]] to contain that template's documented instructions and information, including [[Wikipedia:TemplateData|<templatedata>]].
 
For detailed instructions on how and when to use this template, see [[Wikipedia:Template documentation]] (shortcut: [[WP:TDOC]]).
 
This template displays a green documentation box like you are seeing now and automatically loads the content from a /doc subpage. It can also load the content from other places if instructed to.
Line 101:
:<code><nowiki>{{Documentation |heading=}}</nowiki></code>
 
The '''heading-style''' parameter can be fed optional [[Wikipedia:Cascading Style Sheets|CSS]] values. Without quotation marks <code>" "</code> but with the ending semicolons <code>;</code>. For example:
:<code>heading-style=font-size:150%;color:red;</code>
 
Line 114:
|link box=This documentation is automatically generated by [[Template:Country showdata]]
</pre>
 
===Automatic functions===
If the documentation page does not exist, the [create] link includes a [[mw:Manual:Creating pages with preloaded text|preload]] page so that clicking it will pre-fill the edit form with the basic documentation page format. Preload text is also used for the /sandbox and /testcases [create] links.
 
When this template is on a protected template page it now automatically adds {{tl|pp-template}}, which shows the grey or red padlock in the top right corner. So no need to manually add {{tlf|pp-template}} to templates that use {{tl|Documentation}}.
 
When this template is on a /sandbox subpage it automatically adds the {{tl|Template sandbox notice}}.
 
===Subject namespaces vs. talk namespaces===
Line 135 ⟶ 128:
This template automatically points its [create] links for the /doc, /sandbox and /testcases to the right namespace.
 
===Testing===
You can simulate the output for a given page by using the {{para|page}} parameter. For example, if you use the code {{para|page|Template:Edit protected}}, the template will behave exactly as if it were on the page [[Template:Edit protected]], including showing the documentation from [[Template:Edit protected/doc]], linking to [[Template:Edit protected/sandbox]], etc. This parameter is useful for testing and is used extensively on the [[Module:Documentation/testcases|module testcases page]].
 
===Technical details===
The preload page for the /doc [create] link is [[Template:Documentation/preload]]. The preload pages for the /sandbox and /testcases [create] links are [[Template:Documentation/preload-sandbox]] and [[Template:Documentation/preload-testcases]]. The preload page for the /sandbox [mirror] link is [[Template:Documentation/mirror]].
 
For more details, see the [[Template talk:Documentation|talk page]].
 
====Full syntax====
Line 161 ⟶ 147:
===See also===
* {{tl|Documentation subpage}}, a notice placed at the top of a /doc subpage explaining its role and including a link to the page it documents.
* {{tl|Barnstar documentation}}, a variant of {{tl|Documentation}} for use with [[Wikipedia:Barnstars|barnstar]] templates.
* {{tl|Documentation/color scheme}} presents the color scheme used by {{tl|Documentation}}.
* [[Wikipedia:Template documentation]] is a how-to guide to template documentation.
* [[Wikipedia:Template sandbox and test cases]] explains the use of /sandbox and /testcases subpages and includes more information about template testing.
* [[User:Technical 13/Scripts/editTemplateNoDoc.js]], a beta script that enables documentation to be hidden by default when editing templates.
 
<includeonly><!-- Make sure that only page [[Template:Documentation]] is categorised. No other page (no subpages, not when transcluded).