Template:Documentation: Difference between revisions

From Yasunori Hayashi Laboratory English
Jump to navigation Jump to search
m 1 revision imported
bsd>Shirayuki
m make Wikipedia links translatable!
Line 1: Line 1:
{{Documentation subpage}}
<noinclude>
{{Template shortcut|TemplateStyles}}
<languages/>
{{Lua{{\sandbox}}|Module:Uses TemplateStyles}}
</noinclude><includeonly>{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}</includeonly><noinclude>
<!-- Categories go at the bottom of this page, and interwikis go on Wikidata. -->
{{documentation|content=


'''Preview:'''
{{Lua|Module:Documentation}}
<translate><!--T:12--> This template automatically displays a documentation box like the one you are seeing now, of which the content is sometimes transcluded from another page.</translate>
<translate><!--T:13--> It is intended for pages which are [[<tvar name=1>Special:MyLanguage/Help:Transclusion</tvar>|transcluded]] in other pages, i.e. templates, whether in the template namespace or not.</translate>


This template is used to show that templates have been converted to use [[WP:TemplateStyles|TemplateStyles]]. It is placed at the top of the template's /doc page. It automatically adds the template to [[:Category:{{#invoke:Data|Module:Uses TemplateStyles/config|default_category}}]], or to one of its subcategories.
<translate>
== Usage == <!--T:2-->


The syntax for ''actually'' doing a TemplateStyles is, of course: <syntaxhighlight lang="wikitext" inline><templatestyles src="" /></syntaxhighlight> (with the page name in the quotation marks).
=== Customising display === <!--T:3-->


== Usage ==
<!--T:4-->
Overrides exist to customise the output in special cases:
</translate>
* <nowiki>{{</nowiki>documentation{{!}}'''heading'''=<nowiki>}}</nowiki> - <translate><!--T:5--> change the text of the "documentation" heading.</translate> <translate><!--T:10--> If this is set to blank, the entire heading line (including the first [edit] link) will also disappear.</translate>


; Basic : <syntaxhighlight lang="wikitext" inline>{{Uses TemplateStyles|TemplateStyles page name}}</syntaxhighlight>
<translate>
== Rationale == <!--T:6-->
</translate>
<translate><!--T:7--> This template allows any page to use any documentation page, and makes it possible to protect templates while allowing anyone to edit the template's documentation and categories.</translate>
<translate><!--T:8--> It also reduces server resources by circumventing a [[w:Wikipedia:Template limits|technical limitation of templates]] (see a [[<tvar name=1>:en:Special:Diff/69888944</tvar>|developer's explanation]]).</translate>


; All parameters : <syntaxhighlight lang="wikitext" inline>{{Uses TemplateStyles|TemplateStyles page 1|TemplateStyles page 2|TemplateStyles page 3|...|category=custom category|nocat=true}}</syntaxhighlight>
<translate>
== See also == <!--T:9-->
</translate>
* <translate><!--T:14--> [[w:Template:Documentation subpage]]</translate>
* {{tim|Documentation}}
* <translate><!--T:11--> [[w:Wikipedia:Template documentation]]</translate>


The first TemplateStyles page name is required.
}}
 
[[Category:Formatting templates{{#translation:}}|Template documentation]]
===TemplateStyles sandboxes===
[[Category:Template documentation{{#translation:}}| ]]
Note that if a sandbox version of the TemplateStyle exists, it will also be linked. This is only for sandbox versions. The subpage name of the sandbox version should be the same, but as a subpage of the templates sandbox. For example, if the TemplateStyles page name is <code>Template:Foo/styles.css</code>, then the sandbox version should be <code>Template:Foo/sandbox/styles.css</code>
</noinclude><includeonly>{{#if:{{{content|}}}|
 
[[Category:Template documentation pages{{#translation:}}]]
== Examples ==
===One style page===
<syntaxhighlight lang="wikitext" inline>{{Uses TemplateStyles|Template:Arrowlist/styles.css}}</syntaxhighlight>
{{Uses TemplateStyles{{\sandbox}}|Template:Arrowlist/styles.css|nocat=true}}
{{clear}}
===Multiple style pages===
<syntaxhighlight lang="wikitext" inline>{{Uses TemplateStyles|Template:Arrowlist/styles.css|Template:Routemap/styles.css}}</syntaxhighlight>
{{Uses TemplateStyles{{\sandbox}}|Template:Arrowlist/styles.css|Template:Routemap/styles.css|nocat=true}}
{{clear}}
===Sandbox version of style page exists===
<syntaxhighlight lang="wikitext" inline>{{Uses TemplateStyles|Template:Uses TemplateStyles/example.css}}</syntaxhighlight>
{{Uses TemplateStyles{{\sandbox}}|Template:Uses TemplateStyles/example.css|nocat=true}}
{{clear}}
===No style pages specified===
<syntaxhighlight lang="wikitext" inline>{{Uses TemplateStyles}}</syntaxhighlight>
{{Uses TemplateStyles{{\sandbox}}|nocat=true}}
{{clear}}
 
== Categories ==
===Template category===
This template adds pages to [[:Category:{{#invoke:Data|Module:Uses TemplateStyles/config|default_category}}]] if the page is in the template namespace, and it is not on any of the subpages /doc, /sandbox, /sandbox2 or /testcases. You can specify a different category with the {{para|category}} parameter, e.g. {{para|category|Uses list TemplateStyles}}.
 
===Error category===
If no modules are specified, the transcluded page will be added to [[:Category:{{#invoke:Data|Module:Uses TemplateStyles/config|error_category}}]].
 
===Protection level category===
TemplateStyles should have the same protection level as the template they are used on. If a difference is detected, the transcluded page will be added to [[:Category:{{#invoke:Data|Module:Uses TemplateStyles/config|protection_conflict_category}}]].
 
=== Category suppression ===
To suppress all categories, use {{para|nocat|true}}. (As well as "true", the values "yes", "y", and "1" will also work.)
 
== TemplateData ==
{{TemplateData header}}
{{#invoke:TNT|doc|Uses TemplateStyles}}
 
== See also ==
* [[Wikipedia:TemplateStyles]]
* {{tl|Lua}}
* {{tl|Uses Wikidata}}
<includeonly>{{Sandbox other|| <!-- Categories go here, and interwikis go on Wikidata. -->
[[Category:Template namespace templates]]
}}</includeonly>
}}</includeonly>

Revision as of 08:13, 3 May 2025

<languages/>

[[Category:Template documentation pages{{#translation:}}]]

[[Category:Formatting templates{{#translation:}}|Template documentation]] [[Category:Template documentation{{#translation:}}| ]]