Template:Script doc auto
This template is used in system messages. Changes to it can cause immediate changes to the Wikimedia user interface. To avoid major disruption, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. Please discuss changes on the talk page before implementing them. |
It is used in the MediaWiki:Clearyourcache system message that is shown on top of .css and .js pages. This template is only loaded when in "User:" space. It produces the small green doc box seen on top of user .css and .js pages.
Usage
{{script doc auto}}
Template parameters
Parameter | Description | Default | Status | |
---|---|---|---|---|
page | Page title | {{FULLPAGENAME}} | optional | |
lang | language code | {{int:lang}} | optional |
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard. Existing template documentation Newly created template documentation and imports Wikipedia's help about TemplateData • Commons-specific information It is used in the [[MediaWiki:Clearyourcache]] system message that is shown on top of .css and .js pages. This template is only loaded when in "User:" space. It produces the small green doc box seen on top of user .css and .js pages.
|
Additional information
The template is intended to be used in the following namespaces: the MediaWiki namespace
The template is intended to be used by the following user groups: no user group specified
Examples
{{script doc auto|page=User:Davidgothberg/monobook.js}}
renders as:
The accompanying .css page for this skin can be added at User:Davidgothberg/monobook.css. |
{{script doc auto|page=User:Davidgothberg/clock.js}}
renders as:
Documentation for this user script can be added at User:Davidgothberg/clock. |
See also
Localization
العربية ∙ Deutsch ∙ English ∙ français ∙ македонски ∙ Nederlands ∙ русский
This template makes use of {{Autotranslate}} and the translate extension.
When this template is called on a user skin file such as "/monobook.css" it gives a link to the accompanying "/monobook.js" file. It shows that link even if the accompanying skin file does not exist, but it then uses slightly different text.
For .css and .js pages in user space other than the skin files:
This template links to the documentation page for the script. It shows that link even if the documentation has not been created, but it then uses slightly different text. The doc pages of scripts are the page name but without the ending ".css" or ".js". For instance User:Davidgothberg/clock.js has its documentation at User:Davidgothberg/clock.
This template also detects if a .js page has an accompanying .css file and then links between them. It doesn't show that link if the other file does not exist.
Technical details
Internally this template uses the {{Str len}} template. Since {{str len}} is heavy on the servers this template only calls it once, then it feeds the result to {{Script doc auto/core}} which contains most of the code for this template, that template then in turn calls {{Script doc auto/core2}} which renders the green doc box and the actual text messages.
Note to admins: MediaWiki does not parse and convert HTML wikimarkup in system messages the same way as it does for normal pages. This means for instance that <br>
is not automatically converted to <br />
and missing </td>
and </tr>
tags are not automatically added. Thus see to that any HTML code you use in this template is valid XHTML. That is, close all tags that you begin. However, regular wikimarkup works fine in most system messages.
For more technical details see the talk page.