Template:Documentation: Difference between revisions

From Yasunori Hayashi Laboratory English
Jump to navigation Jump to search
yhlab>Bsherr
consistent with new substitution template format
 
Created page with "{{Documentation subpage}} {{Template shortcut|TemplateStyles}} {{Lua{{\sandbox}}|Module:Uses TemplateStyles}} <!-- Categories go at the bottom of this page, and interwikis go on Wikidata. --> '''Preview:''' This template is used to show that templates have been converted to use 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|defa..."
Line 1: Line 1:
{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude>
{{Documentation subpage}}
<!-- Add categories to the /doc subpage -->
{{Template shortcut|TemplateStyles}}
</noinclude>
{{Lua{{\sandbox}}|Module:Uses TemplateStyles}}
<!-- Categories go at the bottom of this page, and interwikis go on Wikidata. -->
 
'''Preview:'''
 
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.
 
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).
 
== Usage ==
 
; Basic : <syntaxhighlight lang="wikitext" inline>{{Uses TemplateStyles|TemplateStyles page name}}</syntaxhighlight>
 
; All parameters : <syntaxhighlight lang="wikitext" inline>{{Uses TemplateStyles|TemplateStyles page 1|TemplateStyles page 2|TemplateStyles page 3|...|category=custom category|nocat=true}}</syntaxhighlight>
 
The first TemplateStyles page name is required.
 
===TemplateStyles sandboxes===
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>
 
== 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>

Revision as of 21:08, 23 March 2025

Template:Template shortcut {{LuaTemplate:\sandbox|Module:Uses TemplateStyles}}

Preview:

This template is used to show that templates have been converted to use TemplateStyles. It is placed at the top of the template's /doc page. It automatically adds the template to [[:Category:Script error: No such module "Data".]], or to one of its subcategories.

The syntax for actually doing a TemplateStyles is, of course: <syntaxhighlight lang="wikitext" inline>TemplateStyles' src attribute must not be empty.</syntaxhighlight> (with the page name in the quotation marks).

Usage

Basic
<syntaxhighlight lang="wikitext" inline>Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/Uses TemplateStyles.tab.</syntaxhighlight>
All parameters
<syntaxhighlight lang="wikitext" inline>Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/Uses TemplateStyles.tab.</syntaxhighlight>

The first TemplateStyles page name is required.

TemplateStyles sandboxes

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 Template:Foo/styles.css, then the sandbox version should be Template:Foo/sandbox/styles.css

Examples

One style page

<syntaxhighlight lang="wikitext" inline>Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/Uses TemplateStyles.tab.</syntaxhighlight> {{Uses TemplateStylesTemplate:\sandbox|Template:Arrowlist/styles.css|nocat=true}} Template:Clear

Multiple style pages

<syntaxhighlight lang="wikitext" inline>Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/Uses TemplateStyles.tab.</syntaxhighlight> {{Uses TemplateStylesTemplate:\sandbox|Template:Arrowlist/styles.css|Template:Routemap/styles.css|nocat=true}} Template:Clear

Sandbox version of style page exists

<syntaxhighlight lang="wikitext" inline>Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/Uses TemplateStyles.tab.</syntaxhighlight> {{Uses TemplateStylesTemplate:\sandbox|Template:Uses TemplateStyles/example.css|nocat=true}} Template:Clear

No style pages specified

<syntaxhighlight lang="wikitext" inline>Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/Uses TemplateStyles.tab.</syntaxhighlight> {{Uses TemplateStylesTemplate:\sandbox|nocat=true}} Template:Clear

Categories

Template category

This template adds pages to [[:Category:Script error: No such module "Data".]] 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 Template:Para parameter, e.g. Template:Para.

Error category

If no modules are specified, the transcluded page will be added to [[:Category:Script error: No such module "Data".]].

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:Script error: No such module "Data".]].

Category suppression

To suppress all categories, use Template:Para. (As well as "true", the values "yes", "y", and "1" will also work.)

TemplateData

Template:TemplateData header Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:Templatedata/Uses TemplateStyles.tab.

See also