Content deleted Content added
Updating text due to move of this template. |
Updating this doc since this template now adds red links to possible doc pages and handles user skin files separately. |
||
Line 5:
This is the {{tl|script doc auto}} template.
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.
When this template is called on top of [[User:Davidgothberg/monobook.js]] it produces this output:
{{script doc auto| page = User:Davidgothberg/monobook.js }}
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]].▼
When this template is called on top of [[User:Davidgothberg/clock.js]] it produces this output:
Line 15:
{{script doc auto| page = User:Davidgothberg/clock.js }}
The above
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.
For testing and demonstration purposes this template can take a parameter named '''page'''. Like this:
Line 27 ⟶ 35:
=== Technical details ===
Internally this template uses the {{tl|str len}} template. Since {{tlf|str len}} is heavy on the servers this template only calls it once, then it feeds the result to {{tl|script doc auto/core}} which contains most of the code for this template, that template then in turn calls {{tl|script doc auto/core2}} which renders the green doc box and the actual text
'''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 <code><br></code> is not automatically converted to <code><br /></code> and missing <code></td></code> and <code></tr></code> 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.
|