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:


 * Via git

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:

If you want to use the version for MediaWiki 1.23, then do:


 * A manual tarball 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.

For MediaWiki 1.23, as well as the Parsoid nodejs service, you will also need to install the the Parsoid PHP extension or VisualEditor will fail to load.

Basic setup instructions
With the "basic setup" (without the Parsoid node.js service, but with Parsoid helper extension, if required) 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.