Template:Userscript/doc

This is an old revision of this page, as edited by Equazcion (talk | contribs) at 11:38, 7 October 2013 (Usage). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

This template is used to create userscript listings, primarily for use at Wikipedia:User scripts, but it can be used on any page.

Usage

{{userscript |code= [.js address] |name= [script name] |doc= [documentation page address] }}

Either |code, - or - |name + |doc, are required. If you enter only name and doc without a code address, make sure the documentation page contains complete installation instructions, along with any page addresses required.

  • The name will be linked to the documentation page.
  • The code page will be linked from a separate "(source)" link.

Defaults

If you enter a code address and no name, the name defaults to the code page's name, without its path or ".js".

  • Example: Entering |code=User:TheDJ/sharebox.js defaults to "sharebox".

If you enter a code address and no doc, and a documentation page exists with a name that matches the code page name (without its .js extension), that documentation page will be linked by default.

  • Example: Entering |code=User:TheDJ/Sharebox.js will look for a page named User:TheDJ/Sharebox, and if found, will be linked as the documentation page.

You can override the default name and/or documentation page defaults by entering those parameters explicitly.

Examples

All parameters specified: {{userscript|name=Sharebox|code=User:TheDJ/sharebox.js|doc=User:TheDJ/Sharebox}}

Name + doc specified: {{userscript|name=Sharebox|doc=User:TheDJ/Sharebox}}

Code only: {{userscript|code=User:TheDJ/sharebox.js}}

Additional parameter

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:

|noautoinstall=yes


  1. ^ Copy the following code, edit your user JavaScript, then paste:
    {{subst:lusc|1=User:TheDJ/sharebox.js}}
  2. ^ Copy the following code, edit your user JavaScript, then paste:
    {{subst:lusc|1=User:TheDJ/sharebox.js}}