Extension:VisualEditor

The VisualEditor project aims to create a reliable rich-text editor for MediaWiki. More information can be found on the project page; this page is just about the 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.

Download
You can download the extension directly from the MediaWiki source code repository. You can get:


 * One of the extensions tags

Not all extensions have tags. Some extensions have tags for each release, in which case those tags have the same stability as the release. To download a tag


 * Go to the tags list
 * Click the name of the tag you want to download
 * Click "snapshot"


 * The latest version of one of the extensions branches

Each extension has a master branch containing the latest code (might be unstable). Extensions can have further branches as well.


 * Go to the branches list
 * Click the branch name
 * Click "snapshot"


 * A manual snapshot made for MediaWiki 1.23

This should work with MediaWiki 1.23 if you wish to avoid using git.


 * Download snapshot

After you've got the code, save it into the extensions/ directory of your wiki.

If you are familiar with git and have shell access to your server, you can obtain the extension, with all its tags and branches, as follows: cd extensions git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/.git

Basic setup instructions
With the "basic setup" (with the PHP part of Parsoid, but without the node.js part) you can experiment with this extension on your own wiki. To do this add the following lines to your wiki's  after you have downloaded the extension:

Congratulations, you should now have VisualEditor up and running! To test it you need to create a new page, depending on your setup you might end up in the standard editor or wikieditor but when you press the "Create" tab you should end up in the Visual editor.

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

Setup a Parsoid service
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.

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

Additionally, if you want to use a Parsoid instance with a wiki that isn't running on localhost, you will need to edit the following line (the default is fine for most people's configurations):

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!

Troubleshooting

 * 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.