This page is a resource for users maintaining scripts on Dev Wiki. For code review, see Board:Code Review. To request a new script, see Board:Script Suggestions.

Writing a script

Scripts that other wikis can import must be added to the MediaWiki namespace, and their documentation typically is added in the mainspace. For example, AjaxRC documentation can be found here, and its source code can be found on MediaWiki:AjaxRC/code.js. Historically, the main js and css files for a script have been named code.js and code.css respectively and were kept on subpages of the documentation page. Since then, all js was moved to the MediaWiki namespace. Titles such as MediaWiki:AjaxRC.js are also acceptable. For organisation, any extra scripts needed to support or supplement the main script should be kept on subpages of the main script, e.g., MediaWiki:AjaxRC.js/Example.js.

What to include on a documentation page

A script's documentation likely includes a number of things. The most common are:

  • A description of the script
  • Import instructions and any setup instructions

Much of the information you might want to include is in ready-to-use templates, such as {{Infobox JavaScript}}, {{Infobox CSS}}, and {{ImportArticles}}.