User:Mooeypoo/VisualEditor:Getting Started

Here's the process of getting started with VisualEditor development.

Preliminaries
If you're under Windows, I found that the best course of action for me was to install Ubuntu in a Virtual Machine. However, there are other options, like running git for windows and mediawiki-vagrant. Vagrant didn't work for me (mainly because of several issues with Git under Windows8) so VirtualMachine was a good solution for me.

VirtualMachine
Download your flavor of Virtual Machine (if you have Windows 8, Hyper-V is included, or you can choose the free Oracle VirtualBox).

The process is fairly straight forward, just follow the instructions:
 * Installing Ubuntu in Hyper-V (Windows 8)
 * Installing Ubuntu in VirtualBox

MediaWiki Development
In order to start out with MediaWiki development, you will need a MediaWiki developer access. You can request one in here.

Note: This may sound ridiculous to the experienced users, but it wasn't immediately clear for me: When you sign up for a development account, the field "Instance shell account" is the username you will use in your shell in git. It's public, so, unlike me, try to find something that makes sense, like your username.

Install Git and Gerrit-Review
Follow the instructions in this page to install Git, SSH keys and Gerrit Review. Make sure you submit your new SSH Keys (as the tutorial points out) to your gerrit account settings.

Parsoid
Go into your new mediawiki core installation, into /extensions/ and clone the Parsoid repository: git clone ssh://USERNAME@gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid.git

Install node.js
So, we're supposed to be using nodejs v0.8 and not the latest nodejs. That is a little trickier than expected for us newbies, especially since "nodejs-legacy" (like the Parsoid page suggests) doesn't quite seem to download the proper version.

Here's what worked for me (hat tip Amir Aharoni)

Get nodeJS from its GitHub repository:

I did this in the home folder so I don't mix nodejs repository with the Parsoid repository. git clone https://github.com/joyent/node.git Switch to the v0.8 branch/tag: git checkout v.0.8.0 Configure and install: ./configure make sudo make install And just to make sure nodejs was successfully installed, run node -v If you get the response "v0.8.0" you're good to go.

Set up Parsoid
Go back to your Parsoid extension (if you're not already there) and into mediawiki-core/extensions/Parsoid/js folder. Finish up the installation with: npm install This will install the modules that are required. If it ends well (no errors) then you're ready to go. If you installed nodeJS properly, this should run smoothly.

After that's done, you will have to run the server. Type this: node api/server.js You'll have to run Parsoid every time you restart your system. Remember the above command, you'll need to go to the Parsoid/js folder and run it every time you restart your system so your local wiki can use it.

Adjust Parsoid for your Local Wiki
By default, Parsoid expects your wiki to be under localhost/wiki. If you call it any other way you will need to let Parsoid know about it by setting up localsettings.js in the Parsoid/js/api folder. See insructions for that here.

VisualEditor
Now, install VisualEditor extension. We want to be able to work on its code for development, so we'll clone it with our git shell credentials. These instructions are also available in the VisualEditor extension page.

Go to the wiki/extensions/ folder, and clone the VisualEditor master: git clone ssh://USERNAME@gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor.git Now you have the basics. In order to make it run right, you'll need to add this to your LocalSettings.php:

Now that's set up, you'll need to link Parsoid to VisualEditor:

If you have a unique setup - like a wiki that's not running on the local machine, etc., please see the original installation instructions for both Parsoid and VisualEditor.