Template:Userscript/doc

From the AARoads Wiki: Read about the road before you go
Jump to navigation Jump to search

This template is used to create userscript listings, but it can be used on any page.

Usage

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

At least |code= -or- |doc= is required. The template will attempt to determine defaults for any information not entered.

  • Check the accuracy of the links after placing this template! If any defaults are incorrect 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 |name parameter. It is just for display purposes.
Default logic details
  • 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=User:TheDJ/Sharebox.js will look for a page named User:TheDJ/Sharebox, and if found, will be linked as the documentation page.
    • Entering |doc=User:TheDJ/Sharebox will look for a page named User:TheDJ/Sharebox.js, and if found, will be linked as the code page.
  • If the default pages don't actually exist, they won't be linked (so defaults shouldn't produce red links).
  • If no name is entered, a default name will be produced from the code or doc page name.

Examples

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

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

Doc only: {{userscript|doc=User:TheDJ/sharebox}}

Use {{reflist}} to produce specific installation instructions:

  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}}

See also

{{Wikipedia:User scripts/Navbox}}