Skip to content
Dario Giovannetti edited this page Jan 4, 2022 · 35 revisions

Wiki Monkey is initialized by reading its configuration from several sources in the following cascading order, i.e. the values set by each source override those set by all the preceding:

The current configuration can be inspected and managed from the about tab of the Main WM menu.

Defaults

These are the configuration values hard-coded in the application.

From server

If using the Server/Client version, the next location where configuration values are sourced is a JSON file whose path is specified by the --client-conf (command line) or client_conf (server configuration file) options in the server configuration.

The structure of the JSON file is the same as that required by the localStorage source.

localStorage

Both the Server/Client version and the Standalone version at this stage can source configuration values from an optional JSON object stored in the browser's localStorage. A JSON file can be imported from the about tab of the Main WM menu.

The JSON file must be structured as an object whose root keys are either #default or a wiki User name. Each of these keys maps to a configuration object structured as required by the User script source. The configuration object stored under the #default key applies to all users; the User name keys can be used to set user-specific configurations.

For example:

{
  "#default": {
    "global_option1": "value",
    "PluginA": {
      "enabled": true,
      "plugin_option1": "value"
    },
  },
  "MyUserName": {
    "global_option1": "overriding_value"
  }
}

User script

Both the Server/Client version and the Standalone version finally look for an optional wikiMonkeyConfig object which must be defined before the mw.loader.load() line in your User:Example/common.js page.

The configuration object's key-value pairs are either global configuration options, or a plugin name and its specific configuration keys.

For example:

wikiMonkeyConfig = {
    global_option1: value,
    global_option2: other_value,
    PluginA: {enabled: true,
              plugin_option1: value},
    PluginB: {enabled: false}
}
mw.loader.load('https://rawcdn.githack.com/kynikos/wiki-monkey/v5.5.3/dist/WikiMonkey-ArchWiki.min.js');

Global options

  • default_bot_plugin: "SimpleReplace" The name of the plugin to select by default in the bot interface. Set to null to use the first option.
  • default_recentchanges_plugin: "ArchWikiRCFilter" The name of the plugin to select by default in the RecentChanges page. Set to null to use the first option.
  • default_recentchanges_plugin_autoexecute: true Set to true to have the default RecentChanges filter applied automatically as the page is loaded; set to false to let the user apply the filter manually.
  • default_newpages_plugin: "ArchWikiNPFilter" The name of the plugin to select by default in the NewPages page. Set to null to use the first option.
  • default_newpages_plugin_autoexecute: true Set to true to have the default NewPages filter applied automatically as the page is loaded; set to false to let the user apply the filter manually.
  • default_all_plugins_disabled: false Set to true to configure all plugins as disabled by default, thus allowing to explicitly enable one by one only those that are required.
  • update_check_wdays: [6] This array defines what day(s) of the week Wiki Monkey should check for the release of a new version (0-Sunday to 6-Saturday). See Server/Client version#updates and Standalone version#updates for more information on version update automation.
  • update_check_branch: master The name of the branch in the upstream repository where to read the latest version number (do not change this value unless you know what you are doing).
  • hide_rollback_links: true Set to true to hide the rollback links in User Contributions and RecentChanges pages, to avoid involuntary clicking on them; set to false to preserve the default functionality.
  • disable_edit_summary_submit_on_enter: true Set to true to suppress the default browser behavior of saving a page when, usually accidentally, pressing Enter in the Summary field of an editor page; set to false to preserve the default functionality.
  • scroll_to_first_heading: false Set to true to make an editor page scroll automatically to the title heading after opening it.

Plugin options

See Bundled plugins for the available plugins and their specific configuration options.

Some options are shared by all or multiple plugins:

  • enabled Can be set to true or false to explicitly enable or disable any plugin. Some plugins are enabled by default, while others are disabled.
  • editor_menu Used by editor plugins to set up their activation button in the menu; this is an array of strings that defines the path of submenus and the final button label associated to the plugin. If some strings in the menu path are used by other plugins, they will be grouped under the same submenu.
  • diff_menu Same as editor_menu, but used by diff-page plugins.
  • special_menu Same as editor_menu, but used by Special:SpecialPages plugins.
  • bot_label Used by bot plugins as their option's label in the plugin selector.
  • filter_label Used by filter plugins as their option's label in the plugin selector.

Automatic/manual launch

Instead of starting automatically at every page load, Wiki Monkey can be set to only start after manually clicking a simple "WM" link at the top of the page.

When automatic launch is disabled, the application does not even read its configuration until the "WM" link is manually followed, therefore this mode cannot be configured together with the other options, but it must be switched directly from the dedicated entry in about tab of the Main WM menu.