Template:Userscript/doc: Difference between revisions

Content deleted Content added
No edit summary
 
(27 intermediate revisions by 8 users not shown)
Line 8:
<code><nowiki>{{userscript |code= [.js address] |name= [script name] |doc= [documentation page address] }}</nowiki></code>
 
At least <code>|code=</code> ''' -or- ''' <code>|doc=</code> is required. The template will attempt to determine defaults for any information not entered.
The name will be linked to the documentation page, and the code page will be linked from a separate "(source)" link.
* '''Check tothe makeaccuracy sureof the links are accurate after placing this template!''' If any defaults are inaccurateincorrect for your script, enter the necessary parameters explicitly.
* If you end up leaving the template with no "(source)" link produced, make sure your documentation page includes complete installation instructions, along with any necessary code page addresses.
* You can make up any name for the <code>|name</code> parameter. It is just for display purposes, and does not need to match any actual page address.
 
{{collapse top|1=Default logic details}}
* All parameters are optional. The template will attempt to fill in defaults for the missing information. Enter any explicit parameters to override defaults.
* '''Check to make sure the links are accurate after placing this template!''' If any defaults are inaccurate, enter the necessary parameters explicitly.
* You can make up any name for the <code>|name</code> parameter. It is just for display purposes, and does not need to match any actual page address.
 
=== Logic ===
* The template will add .js to the documentation page name to get a default code page, or remove .js from the code page name to get a default documentation page.
** Entering <code>|code='''User:TheDJ/Sharebox'''.js</code> will look for a page named '''User:TheDJ/Sharebox''', and if found, will be linked as the documentation page.
** Entering <code>|doc='''User:TheDJ/Sharebox'''</code> will look for a page named '''User:TheDJ/Sharebox<span style="color:red">.js</span>''', and if found, will be linked as the code page.
* If the default pages don't actually exist, they won't be linked (so nodefaults shouldn't produce red links should be produced).
* If no name is entered, a default name will be produced from the code or doc page name (whichever is entered).
{{collapse bottom}}
 
=== Additional parameterparameters ===
* This template enables an automatic installation link for editors who use automatic installer scripts like [[User:Enterprisey/script-installer]] or [[User:Equazcion/ScriptInstaller]]. If you have reason to disable automatic installation for a particular script (ege.g. because it requires more than just the usual importScript line), add the following parameter: {{para|noautoinstall|yes}}.
* To suppress the creation of a footnote with installation instructions, set {{para|noref|yes}}.
 
== Examples ==
All parameters specified: <code><nowiki>{{userscript|name=sharebox!!!!!|code=User:TheDJ/sharebox.js|doc=User:TheDJ/sharebox}}</nowiki></code>
*Produces: {{userscript|name=sharebox!!!!!|code=User:TheDJ/sharebox.js|doc=User:TheDJ/sharebox}}
Name + doc specified: <code><nowiki>{{userscript|name=sharebox!!!!!|doc=User:TheDJ/sharebox}}</nowiki></code>
*Produces: {{userscript|name=sharebox!!!!!|doc=User:TheDJ/sharebox}}
Code only: <code><nowiki>{{userscript|code=User:TheDJ/sharebox.js}}</nowiki></code>
*Produces: {{userscript|code=User:TheDJ/sharebox.js}}
Line 31 ⟶ 33:
*Produces: {{userscript|doc=User:TheDJ/sharebox}}
 
Use <code><nowiki>{{reflist}}</nowiki></code> to produce specific installation instructions:
== Additional parameter ==
{{reflist}}
This template enables an automatic installation link for editors who use automatic installer scripts like [[User:Equazcion/ScriptInstaller]]. If you have reason to disable automatic installation for a particular script (eg. because it requires more than just the usual importScript line), add the following parameter:
 
<code><nowiki>|noautoinstall=yes</nowiki></code>
 
==See also==
<includeonly>
* [[Wikipedia:User scripts/List]]
<!-- Categories go here, and interwikis go in Wikidata -->
 
{{Wikipedia:User scripts/Navbox}}
</includeonly>{{Sandbox other||
[[Category:Wikipedia scripts|*]]
[[Category:Wikipedia user script templates]]
}}</includeonly>