![]() | This is a documentation subpage for Template:Script doc auto. It may contain usage information, categories and other content that is not part of the original template page. |
![]() | This template is used in system messages. Changes to it can cause immediate changes to the Wikipedia 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. |
![]() | This template can only be edited by administrators because it is transcluded onto one or more cascade-protected pages. |
![]() | This template uses Lua: |
This is the {{script doc auto}} template.
It is used in the MediaWiki:Clearyourcache system message that is shown on top of .css, .js, .json, and .vue pages. This template is only loaded when in "User:" and "Mediawiki" namespaces. It produces the small green doc box seen on top of user .css, .js, .json, and .vue pages.
Skin files
editWhen 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.
User scripts
editFor .css, .js, .json, and .vue 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 .css, .js, .json, or .vue page has accompanying files with the other three extensions and then links between them. It doesn't show a link if the other file does not exist.
Gadgets
editFor .css, .js, .json, and .vue pages in the Mediawiki namespace:
This template links to the section of Special:Gadgets for the gadget. It also shows either the number of users of the gadget or whether it is a hidden or default gadget.
This template also detects if a .css, .js, .json, or .vue page has accompanying files with the other three extensions and then links between them. It doesn't show a link if the other file does not exist.
Usage
editFor testing and demonstration purposes this template can take a parameter named page. Like this:
{{script doc auto| page = User:Davidgothberg/clock.js }}
The page parameter makes this template behave exactly as if on that page.
See also
edit- MediaWiki:Clearyourcache – The system message that uses this template.
- Wikipedia:WikiProject User scripts/Scripts – Lists many user scripts.