Fandom

Wikia Developers Wiki

Dev Wiki:Code help

859pages on
this wiki
Add New Page
Talk0

This page is a resource for users maintaining scripts on Dev Wiki. For code review, see Portal:Code review. To request a new script, see Portal: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}}.

Content Moderators

Experienced users can request membership to the Content Moderator user group at Dev Wiki:Requests for Content Moderator. Note that scripts are not immediately available for import until they are reviewed and approved by staff . See Help:JavaScript review process for more information.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.