Extension:VisualEditor

The VisualEditor project aims to create a reliable rich-text editor for the Web and for MediaWiki. More information can be found on the project page; this page is just about the VisualEditor-MediaWiki extension itself. The extension relies on the separate nodeJS-based Parsoid parser service to be up and running in order to edit pages. Stable release is planned for 2014-15.

Download
You can download the VisualEditor-MediaWiki extension directly from the MediaWiki source code repository (browse code). We recommend that you get it via git using the following instructions in your shell: cd extensions git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/VisualEditor.git cd VisualEditor git submodule update --init

If you cannot use git (e.g. you are in an air-gapped installation), you can download a snapshot of VisualEditor-MediaWiki for master or for a release version of MediaWiki from the ExtensionDistributor page. After you've got the code, save it into the extensions/VisualEditor directory of your wiki.
 * VisualEditor-MediaWiki's master branch contains the latest code, as used at Wikimedia. This code is potentially slightly buggy or unstable, but is likely to have fewer bugs and more features than old builds.
 * The master branch requires alpha builds of MediaWiki (currently, 1.25wmf13 ) and will not work with the older, official releases of MediaWiki like 1.24.1, for that use the REL1_24 branch.
 * The  command is vital, as MediaWiki-VisualEditor needs the core VisualEditor submodule to work. If you do not use this command, VisualEditor will fail to work.

Setup a Parsoid service
Without the Parsoid node.js service you will not be able to edit existing pages or save pages!

If you want to be able to edit existing pages and save pages with VisualEditor you need a Parsoid service.

To setup your own Parsoid service follow the Parsoid installation instructions first. Note that it is particularly complicated to set up Parsoid in non-standard systems for running NodeJS, like those running Windows or Debian.

Basic configuration for MediaWiki-VisualEditor
For the initial setup, before you have installed the Parsoid node.js service you can experiment with loading MediaWiki-VisualEditor on your own wiki.

Add the following lines to your wiki's  after you have downloaded the extension:

Linking with Parsoid
To get VisualEditor to talk to the parser, add the following code to your  to specify your Parsoid instance:

Additionally, the prefix needs to be set to the unique name you gave to the wiki in your localsettings.js parsoid configuration file. If you only run a single wiki then you will most likely have left it's unique ID as "localhost" and therefore will not need to set the prefix here. But if you are running multiple wikis on the same host then each will need to have a different unique ID (see Parsoid/Setup for more detail), and you specify which one you're referring to here:

Linking with Parsoid in private wikis
ONLY enable this on private wikis and ONLY IF you understand the SECURITY IMPLICATIONS of sending Cookie headers to Parsoid over HTTP!

Note that this configuration is not available in the old version of VisualEditor that is compatible with MediaWiki 1.22.

Note for MediaWiki 1.23 users
For MediaWiki 1.23, as well as the Parsoid nodejs service, you will also need to install the the Parsoid PHP extension. Without this, VisualEditor will fail to load (as it supplied key styling code until that was moved in MediaWiki itself in MediaWiki 1.24 onwards).

Note for Parsoid on Windows, Debian and other systems
Note that it is particularly complicated and time consuming to set up VisualEditor with Parsoid in non-standard systems, like those running Windows or Debian - those difficulties might even prevent the successful installation of VisualEditor for some people on some platforms.

Troubleshooting

 * parsoidserver-http-curl-error: couldn't connect to host.
 * Parsoid is not running, or  is not set correctly


 * parsoidserver-http-curl-error : Failed to connect to .... : Permission denied.
 * Can be caused by a cURL request on a Security-Enhanced Linux (SELinux, like CentOS) to a non standard port like 8000 in the example configuration above, see http://www.akashif.co.uk/php/curl-error-7-failed-to-connect-to-permission-denied


 * parsoidserver-http-bad-status : 401
 * Caused by read or edit restrictions. If you've set up a private wiki and don't want to use cookie forwarding, you can explicitly remove restrictions for Parsoid by IP address.


 * parsoidserver-http-not-found : 404 (or timeout)
 * Caused by wrong path to MediaWiki API endpoint. Set correct url to the right path to  in Parsoid's   config file. If you have set up following the recommendations, your API path would be "http://localhost/w/api.php". Add this API path to "localsettings.js" like "parsoidConfig.setInterwiki( 'localhost', 'http://localhost/w/api.php' );".