Difference between revisions of "Wiki Monkey"

From ArchWiki
Jump to: navigation, search
(Tampermonkey (recommended): fixed upstream)
m (Installation: style)
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:Internet Applications]]
 
[[Category:Internet Applications]]
[https://github.com/kynikos/wiki-monkey/wiki Wiki Monkey] is a MediaWiki-compatible bot and editor assistant that can be used directly within wiki pages in the browser as a user script. Currently it is tested on [[Firefox]], [[Chromium]] and [[Opera]], but it is very likely to work also on other browsers out of the box or with minor adaptations. Wiki Monkey can also be easily extended through the creation of plugins, exploiting its high-level API.
+
[https://github.com/kynikos/wiki-monkey/wiki Wiki Monkey] is a MediaWiki-compatible bot and editor assistant that can be used directly within wiki pages in the browser as a user script. Currently it is tested on [[Firefox]], [[Chromium]] and [[Opera]], but it is very likely to work also on other browsers out of the box or with minor adaptations. Wiki Monkey can also be easily extended through the creation of plugins, exploiting its API.
  
 
The project is currently focused on ArchWiki, and as such most plugins address ArchWiki-specific problems.
 
The project is currently focused on ArchWiki, and as such most plugins address ArchWiki-specific problems.
Line 6: Line 6:
 
==Installation==
 
==Installation==
  
===Firefox===
+
Follow [https://github.com/kynikos/wiki-monkey/wiki/Getting-started the upstream documentation].
Make sure you have installed '''either''' the [https://addons.mozilla.org/en-US/firefox/addon/scriptish/ Scriptish] extension (recommended) '''or''' the [https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/ Greasemonkey] extension.
+
  
Now just click on the link of '''one''' of Wiki Monkey configurations from the "Scriptish/Greasemonkey/Tampermonkey" column in the [[#Configurations table]] and your browser should ask you to install it.
+
{{Note|since the ArchWiki is served through HTTPS, Opera users will have to follow the instructions in the related note.}}
  
===Chromium===
+
{{Tip|the names of ArchWiki-specific configurations appear in the configurations table with an "ArchWiki-" prefix.}}
Wiki Monkey can be installed in two ways: either using [[#Tampermonkey (recommended)|Tampermonkey]] or exploiting Chromium's [[#Native support|native support]] for user scripts.
+
  
====Tampermonkey (recommended)====
+
==Tour of the features==
Make sure you have installed the [https://chrome.google.com/webstore/detail/dhdgffkkebhmkfjojejmpbldmpobfkfo Tampermonkey] extension.
+
  
Now just click on the link of '''one''' of Wiki Monkey configurations from the "Scriptish/Greasemonkey/Tampermonkey" column in the [[#Configurations table]] and your browser should ask you to install it.
+
Discover the features of Wiki Monkey by following this tour. See [https://github.com/kynikos/wiki-monkey/wiki/Bundled-plugins Bundled plugins] for more detailed information.
  
{{Note|Chromium will first ask you whether you want to install the script with the native support or through Tampermonkey: of course you need to choose the latter by clicking on OK.}}
+
{{Tip|at the bottom of Wiki Monkey's interface you will always find a log area, on dark background, where Wiki Monkey and its plugins will output their messages.}}
  
{{Note|1='''Tampermonkey 2.5.xx cannot install user scripts by simply opening them in the browser, crashing instead in the attempt.''' If you experience this issue, you can still successfully install Wiki Monkey in Tampermonkey this way:
+
===Editor pages===
#Open the ''install'' link with another browser/HTTP-client and copy the content of the script
+
#In Chromium, go to ''Tools'' > ''Extensions''
+
#Click on Tampermonkey's ''Options''
+
#Click on the tab in the top-right corner with the little icon for installing new scripts
+
#Paste the content of the script in the ''Editor'''s text area
+
#Click on the ''Save'' icon on the top-left corner of the ''Editor'' and confirm with ''OK''
+
Wiki Monkey should be working at this point.
+
  
Alternatively install [https://chrome.google.com/webstore/detail/gcalenpjmijncebpfijmoaglllgpjagf the beta version] of Tampermonkey (>=2.6), which fixes the problem.}}
+
If you have installed the ''ArchWiki-Editor'', ''ArchWiki-Patrol'' or ''ArchWiki-Bot'' configuration, in every ''editor'' page (e.g. [https://wiki.archlinux.org/index.php?title=ArchWiki:Sandbox&action=submit ArchWiki:Sandbox's]) you will find Wiki Monkey's interface right below the ''Save page'' button row. As you can see there are some buttons, each of which will execute a plugin action:
  
====Native support====
 
Just click on the link of '''one''' of Wiki Monkey configurations from the "Chromium native" column in the [[#Configurations table]] and your browser should ask you to install it.
 
 
{{Note|Installing Wiki Monkey without Tampermonkey is '''not''' recommended since Chromium's native support is still [http://www.chromium.org/developers/design-documents/user-scripts limited] and some features may not work correctly, as is the case of updates. Besides, plugins that require cross-origin requests will not be available.}}
 
 
===Opera===
 
Go to: ''Opera menu > Settings > Preferences > Advanced > Content > JavaScript options'': in the ''User JavaScript folder'' field, select the directory where you will install user scripts.
 
 
Now download '''one''' of Wiki Monkey configurations from the "Opera" column in the [[#Configurations table]] and save it in the folder you've chosen earlier.
 
 
Finally, since the ArchWiki is accessed through the HTTPS protocol, you need to visit ''opera:config'' and enable the ''User Javascript on HTTPS'' setting under ''User Prefs''. You will be prompted to allow the execution of Wiki Monkey the first time you access the ArchWiki in each browsing session.
 
 
===Other browsers===
 
It should be possible to install Wiki Monkey in other browsers in ways similar to one of the browsers above. If your browser only supports raw JavaScript files, installing '''one''' of Wiki Monkey configurations from the "standalone" column in the [[#Configurations table]] may work.
 
 
==Configurations table==
 
This is the table with the predefined configurations: read the section above for instructions on which link you must choose.
 
 
{| class="wikitable" border="1"
 
!Name
 
!Description
 
!Scriptish/Greasemonkey/Tampermonkey
 
!Chromium native
 
!Opera
 
!standalone
 
|-
 
|Editor
 
|Provides only manual-editing aid functions in editor pages
 
|[https://raw.github.com/kynikos/wiki-monkey/master/src/configurations/WikiMonkey-archwikieditor.user.js install]
 
|[https://raw.github.com/kynikos/wiki-monkey/master/src/configurations/chromium/WikiMonkey-archwikieditor-chromium.user.js install]
 
|[https://raw.github.com/kynikos/wiki-monkey/master/src/configurations/opera/WikiMonkey-archwikieditor-opera.user.js download]
 
|[https://raw.github.com/kynikos/wiki-monkey/master/src/configurations/standalone/WikiMonkey-archwikieditor-standalone.js download]
 
|-
 
|Patrol-Lite
 
|Provides a quick-report function in diff pages
 
|[https://raw.github.com/kynikos/wiki-monkey/master/src/configurations/WikiMonkey-archwikipatrollite.user.js install]
 
|[https://raw.github.com/kynikos/wiki-monkey/master/src/configurations/chromium/WikiMonkey-archwikipatrollite-chromium.user.js install]
 
|[https://raw.github.com/kynikos/wiki-monkey/master/src/configurations/opera/WikiMonkey-archwikipatrollite-opera.user.js download]
 
|[https://raw.github.com/kynikos/wiki-monkey/master/src/configurations/standalone/WikiMonkey-archwikipatrollite-standalone.js download]
 
|-
 
|Patrol
 
|Editor + Patrol-Lite
 
|[https://raw.github.com/kynikos/wiki-monkey/master/src/configurations/WikiMonkey-archwikipatrol.user.js install]
 
|[https://raw.github.com/kynikos/wiki-monkey/master/src/configurations/chromium/WikiMonkey-archwikipatrol-chromium.user.js install]
 
|[https://raw.github.com/kynikos/wiki-monkey/master/src/configurations/opera/WikiMonkey-archwikipatrol-opera.user.js download]
 
|[https://raw.github.com/kynikos/wiki-monkey/master/src/configurations/standalone/WikiMonkey-archwikipatrol-standalone.js download]
 
|-
 
|Bot
 
|Patrol + automatic operations on list pages
 
|[https://raw.github.com/kynikos/wiki-monkey/master/src/configurations/WikiMonkey-archwikibot.user.js install]
 
|[https://raw.github.com/kynikos/wiki-monkey/master/src/configurations/chromium/WikiMonkey-archwikibot-chromium.user.js install]
 
|[https://raw.github.com/kynikos/wiki-monkey/master/src/configurations/opera/WikiMonkey-archwikibot-opera.user.js download]
 
|[https://raw.github.com/kynikos/wiki-monkey/master/src/configurations/standalone/WikiMonkey-archwikibot-standalone.js download]
 
|}
 
 
Alternatively, you can [https://github.com/kynikos/wiki-monkey/wiki/Custom-configuration create your own configuration].
 
 
{{Warning|Although it is possible to keep multiple configurations of Wiki Monkey installed together, make sure to enable only '''one''' at a time.}}
 
 
{{Note|Plugins that require cross-origin requests are not available for the Chromium-native, Opera and standalone versions.}}
 
 
==Updates==
 
 
===Firefox (Scriptish)===
 
Open Firefox's ''Add-ons Manager'' (''Tools -> Add-ons''), select ''User Scripts'', right-click on Wiki Monkey and choose ''Find Updates''.
 
 
If you want to enable '''automatic updates''', choose ''Show More Information'' instead, then set ''Automatic Updates'' to ''On''.
 
 
Scriptish's perferences are available in Firefox's ''Add-ons Manager'' (''Tools -> Add-ons''), selecting the ''Extensions'' tab.
 
 
===Firefox (Greasemonkey)===
 
{{Note|Experimental feature: please check periodically for new releases, and, in case Wiki Monkey is not updated, report a bug [https://github.com/kynikos/wiki-monkey/issues here].}}
 
 
Greasemonkey should enable automatic updates by default, you can check opening Firefox's ''Add-ons Manager'' (''Tools -> Add-ons''), selecting ''User Scripts'', right-clicking on ''Wiki Monkey'' and verifying ''Automatic check for updates'' is ticked.
 
 
Greasemonkey's perferences are available in Firefox's ''Add-ons Manager'' (''Tools -> Add-ons''), selecting the ''Extensions'' tab.
 
 
===Chromium (Tampermonkey)===
 
Tampermonkey should enable automatic updates by default, you can check opening ''Tools -> Extensions'', selecting Tampermonkey's options, selecting the ''Settings'' tab and verifying the settings for ''Check Interval'' in the ''Script Update'' section.
 
 
===Chromium (native)===
 
Chromium's native support for user scripts is rather limited and should not be able to update Wiki Monkey. If you want automatic or semi-automatic updates, it is recommended to use Tampermonkey as described in the Installation section.
 
 
===Opera (native)===
 
Due to how user scripts are installed in Opera, there is currently no way to have automatic or semi-automatic updates, you will have to check periodically and reinstall the script when a new version is released.
 
 
==Tour of the features==
 
After installing the desired version of Wiki Monkey, start visiting [https://wiki.archlinux.org/index.php?title=Wiki_Monkey&action=submit the editor of this very page], you will find Wiki Monkey's interface right below the ''Save page'' button row. As you can see there are some buttons, each of which will execute a plugin action (see [https://github.com/kynikos/wiki-monkey/wiki/Bundled-plugins Bundled plugins] for detailed information):
 
 
* ''Fix header'' reorders the elements in the header, warns about possible problems (e.g. lack of category) and tries to fix some.
 
* ''Fix header'' reorders the elements in the header, warns about possible problems (e.g. lack of category) and tries to fix some.
 
* ''Fix headings'' tries to fix the levels of section headings so that they start from level 2 and do not increase by more than 1 level with relation to the parent section.
 
* ''Fix headings'' tries to fix the levels of section headings so that they start from level 2 and do not increase by more than 1 level with relation to the parent section.
 +
* ''Fix links'' tries to turn external links into proper internal/interwiki links (e.g. Wikipedia), or templates (e.g. [[Template:Pkg]]).
 
* ''Use code templates'' replaces {{ic|<pre>}}, {{ic|<code>}} and {{ic|<tt>}} with [[Template:bc]] and [[Template:ic]], taking care of adding numbered parameters or {{ic|<nowiki>}} tags when necessary.
 
* ''Use code templates'' replaces {{ic|<pre>}}, {{ic|<code>}} and {{ic|<tt>}} with [[Template:bc]] and [[Template:ic]], taking care of adding numbered parameters or {{ic|<nowiki>}} tags when necessary.
 
* ''Expand contractions'' expands some common English contractions, e.g. "don't" becomes "do not".
 
* ''Expand contractions'' expands some common English contractions, e.g. "don't" becomes "do not".
 
* ''Multiple line breaks'' compresses multiple empty lines into one.
 
* ''Multiple line breaks'' compresses multiple empty lines into one.
 
* ''RegExp substitution'' lets you perform a regular expression substitution.
 
* ''RegExp substitution'' lets you perform a regular expression substitution.
* ''Sync interlanguage links'' <sup>'''*'''</sup> synchronizes the interlanguage links of the edited page with those of its translations.
+
* ''Sync interlanguage links'' synchronizes the interlanguage links of the edited page with those of its translations (the Chromium-native, Opera and standalone configurations can only synchronize local languages).
* ''Use Template:AUR'' <sup>'''**'''</sup> converts direct AUR package links to instances of [[Template:AUR]].
+
* ''Fix old AUR links'' converts direct AUR-1.x package links to instances of [[Template:AUR]] (available only for the Scriptish/Greasemonkey/Tampermonkey configurations).
  
 
By pressing one of them, the text in the editor will be modified, but note that the page will not be saved, so you will still be able to see the diff or the preview and perform other modifications manually. The ''Execute row'' and ''Execute all'' buttons are used to execute more plugins one after the other, thus saving some clicks.
 
By pressing one of them, the text in the editor will be modified, but note that the page will not be saved, so you will still be able to see the diff or the preview and perform other modifications manually. The ''Execute row'' and ''Execute all'' buttons are used to execute more plugins one after the other, thus saving some clicks.
  
At the bottom of Wiki Monkey's interface you will always find the log area, on dark background, where Wiki Monkey and its plugins will output their messages.
+
===Diff pages===
 +
 
 +
If you have installed the ''ArchWiki-Patrol-Lite'', ''ArchWiki-Patrol'' or ''ArchWiki-Bot'' configuration, in every ''diff'' page (e.g. [https://wiki.archlinux.org/index.php?title=ArchWiki:Sandbox&diff=262475&oldid=261738 one from ArchWiki:Sandbox's history]) you will find Wiki Monkey's interface right below the two diff panes. Here the only bundled plugin is ''Quick report'', which adds a row with a link to the visited diff in the specialized table of [[ArchWiki:Reports]]. See also [[ArchWiki:Maintenance Team]].
 +
 
 +
===Page lists (Bot)===
 +
 
 +
If you have installed the ''ArchWiki-Bot'' configuration you will find Wiki Monkey's Bot interface in many pages that show lists of pages (e.g. [[Special:Categories|Category pages]], [[Special:WhatLinksHere|What Links Here pages]] and many [[Special:SpecialPages|Special pages]]; see [[:Category:Sandbox]] for a specific example). The usage of the Bot interface is explained in [https://github.com/kynikos/wiki-monkey/wiki/Bot-interface the upstream documentation].
 +
 
 +
{{Note|the Bot interface is hidden by default, you will have to show it by clicking on the dedicated link.}}
  
Now, if you have installed the "Patrol Lite", "Patrol" or "Bot" configuration, visit [[Special:RecentChanges]] and select a diff from the list: right below the diff panes you will find Wiki Monkey's interface. Here the only bundled plugin is ''Quick report'', which adds a row with a link to the visited diff in the specialized table of [[ArchWiki:Reports]].
+
The available plugins for the Bot are a regular expression substitution function and a tool for synchronizing the interlanguage links of the pages with those of their translations (the Chromium-native, Opera and standalone configurations can only synchronize local languages); [[Special:LinkSearch]] also provides a plugin for converting direct AUR-1.x package links to instances of [[Template:AUR]] (the Bot is shown only if there is at least one item in the list; available only for the Scriptish/Greasemonkey/Tampermonkey configurations).
  
At this point, if you have installed the "Bot" configuration, visit [[Special:SpecialPages]]: at the top of the page you will find those plugins that have a generic purpose and are not based on a specific page: the only currently available plugin is a function to update Table of Contents pages.
+
===Special functions===
  
Finally, if you have installed the "Bot" configuration, visit the [[:Category:Internet Applications|''Category'']] of this article: right at the top you will find Wiki Monkey's bot interface, whose usage is explained in [https://github.com/kynikos/wiki-monkey/wiki/Bot-interface the upstream documentation]; other pages where you can find the bot are [[Special:WhatLinksHere/Wiki_Monkey|''What Links Here'']] pages and many of the list pages linked from [[Special:SpecialPages]]. The available plugins for the bot are a regular expression substitution function and a tool for synchronizing the interlanguage links of the pages with those of their translations<sup>'''*'''</sup>. The [https://wiki.archlinux.org/index.php?title=Special%3ALinkSearch&target=https%3A%2F%2Fwiki.archlinux.org ''External links search''] page also provides a plugin for converting direct AUR package links to instances of [[Template:AUR]]<sup>'''**'''</sup>.
+
If you have installed the ''ArchWiki-Bot'' configuration you will also find Wiki Monkey's interface at the top of [[Special:SpecialPages]]: here you will find those plugins that have a generic purpose and are not based on a specific page. The available plugins are a function to update [[Table of Contents]] pages, and a function to fix [[Special:DoubleRedirects|double redirects]].
  
<sup>'''*'''</sup> ''The Chromium-native, Opera and standalone configurations can only synchronize local languages.''
+
===Recent Changes===
  
<sup>'''**'''</sup> ''Available only for the Scriptish/Greasemonkey/Tampermonkey configurations.''
+
If you have installed the ''ArchWiki-Patrol-Lite'', ''ArchWiki-Patrol'' or ''ArchWiki-Bot'' configuration, at the top of [[Special:RecentChanges]] you will find Wiki Monkey's Recent Changes filter. Currently the bundled filter only groups the changes by the language of the affected article.
  
==Contributions==
+
{{Note|the default filter is designed to work on top of MediaWiki's Recent Changes filter, which can be enabled in [[Special:Preferences#mw-prefsection-rc]]. This also means that you must be logged on in order to use it.}}
Of course any help in the resolution of bugs or the development of new plugins is appreciated: if you are interested, [https://wiki.archlinux.org/index.php/Special:EmailUser/Kynikos send an email] to the original author (or use [[User_talk:Kynikos|his talk page]]) and urge him to finally complete the documentation about the [https://github.com/kynikos/wiki-monkey/wiki/Plugin-development development of plugins], which is actually quite straightforward.
+
  
 
==See also==
 
==See also==
 
* [https://github.com/kynikos/wiki-monkey/wiki/Troubleshooting Troubleshooting]
 
* [https://github.com/kynikos/wiki-monkey/wiki/Troubleshooting Troubleshooting]
 
* [https://github.com/kynikos/wiki-monkey/issues Bug reports, feature requests, questions]
 
* [https://github.com/kynikos/wiki-monkey/issues Bug reports, feature requests, questions]

Revision as of 13:43, 18 July 2013

Wiki Monkey is a MediaWiki-compatible bot and editor assistant that can be used directly within wiki pages in the browser as a user script. Currently it is tested on Firefox, Chromium and Opera, but it is very likely to work also on other browsers out of the box or with minor adaptations. Wiki Monkey can also be easily extended through the creation of plugins, exploiting its API.

The project is currently focused on ArchWiki, and as such most plugins address ArchWiki-specific problems.

Installation

Follow the upstream documentation.

Note: since the ArchWiki is served through HTTPS, Opera users will have to follow the instructions in the related note.
Tip: the names of ArchWiki-specific configurations appear in the configurations table with an "ArchWiki-" prefix.

Tour of the features

Discover the features of Wiki Monkey by following this tour. See Bundled plugins for more detailed information.

Tip: at the bottom of Wiki Monkey's interface you will always find a log area, on dark background, where Wiki Monkey and its plugins will output their messages.

Editor pages

If you have installed the ArchWiki-Editor, ArchWiki-Patrol or ArchWiki-Bot configuration, in every editor page (e.g. ArchWiki:Sandbox's) you will find Wiki Monkey's interface right below the Save page button row. As you can see there are some buttons, each of which will execute a plugin action:

  • Fix header reorders the elements in the header, warns about possible problems (e.g. lack of category) and tries to fix some.
  • Fix headings tries to fix the levels of section headings so that they start from level 2 and do not increase by more than 1 level with relation to the parent section.
  • Fix links tries to turn external links into proper internal/interwiki links (e.g. Wikipedia), or templates (e.g. Template:Pkg).
  • Use code templates replaces <pre>, <code> and <tt> with Template:bc and Template:ic, taking care of adding numbered parameters or <nowiki> tags when necessary.
  • Expand contractions expands some common English contractions, e.g. "don't" becomes "do not".
  • Multiple line breaks compresses multiple empty lines into one.
  • RegExp substitution lets you perform a regular expression substitution.
  • Sync interlanguage links synchronizes the interlanguage links of the edited page with those of its translations (the Chromium-native, Opera and standalone configurations can only synchronize local languages).
  • Fix old AUR links converts direct AUR-1.x package links to instances of Template:AUR (available only for the Scriptish/Greasemonkey/Tampermonkey configurations).

By pressing one of them, the text in the editor will be modified, but note that the page will not be saved, so you will still be able to see the diff or the preview and perform other modifications manually. The Execute row and Execute all buttons are used to execute more plugins one after the other, thus saving some clicks.

Diff pages

If you have installed the ArchWiki-Patrol-Lite, ArchWiki-Patrol or ArchWiki-Bot configuration, in every diff page (e.g. one from ArchWiki:Sandbox's history) you will find Wiki Monkey's interface right below the two diff panes. Here the only bundled plugin is Quick report, which adds a row with a link to the visited diff in the specialized table of ArchWiki:Reports. See also ArchWiki:Maintenance Team.

Page lists (Bot)

If you have installed the ArchWiki-Bot configuration you will find Wiki Monkey's Bot interface in many pages that show lists of pages (e.g. Category pages, What Links Here pages and many Special pages; see Category:Sandbox for a specific example). The usage of the Bot interface is explained in the upstream documentation.

Note: the Bot interface is hidden by default, you will have to show it by clicking on the dedicated link.

The available plugins for the Bot are a regular expression substitution function and a tool for synchronizing the interlanguage links of the pages with those of their translations (the Chromium-native, Opera and standalone configurations can only synchronize local languages); Special:LinkSearch also provides a plugin for converting direct AUR-1.x package links to instances of Template:AUR (the Bot is shown only if there is at least one item in the list; available only for the Scriptish/Greasemonkey/Tampermonkey configurations).

Special functions

If you have installed the ArchWiki-Bot configuration you will also find Wiki Monkey's interface at the top of Special:SpecialPages: here you will find those plugins that have a generic purpose and are not based on a specific page. The available plugins are a function to update Table of Contents pages, and a function to fix double redirects.

Recent Changes

If you have installed the ArchWiki-Patrol-Lite, ArchWiki-Patrol or ArchWiki-Bot configuration, at the top of Special:RecentChanges you will find Wiki Monkey's Recent Changes filter. Currently the bundled filter only groups the changes by the language of the affected article.

Note: the default filter is designed to work on top of MediaWiki's Recent Changes filter, which can be enabled in Special:Preferences#mw-prefsection-rc. This also means that you must be logged on in order to use it.

See also