0

Tips & Tricks : MediaWiki 1.25.1 and VisualEditor

-

In case you want to deploy MediaWiki 1.25.1 with VisualEditor use following components:

Configuration details for LocalSettings.php for these components can be found here:

When you download VisualEditor from Git repository installation with MediaWiki 1.25.1 is more likely to fail.

0

How-To : Deploy VisualEditor extension for MediaWiki 1.24.2 on openSUSE 13.1 x64

-

In previous article I described how-to Deploy Parsoid on openSUSE 13.1 (which turns out to be quite a challenging task). Parsoid is component required for VisualEditor. Now it’s time for VisualEditor deployment.

Downloading VisualEditor

At the moment, when I’m doing deployment, stable version of MediaWiki is 1.24.2. VisualEditor is an extension written for certain version of MediaWiki, hence we can’t just download latest version and use it. It has to be specific release for specific MediaWiki version.

So, first we download VisualEditor for MediaWiki 1.24.2:

git clone -b REL1_24 https://github.com/wikimedia/mediawiki-extensions-VisualEditor.git
cd mediawiki-extensions-VisualEditor/
git submodule update --init

Once it’s done we need to place content of mediawiki-extensions-VisualEditor in extensions/VisualEditor folder under MediaWiki folder structure.

Finally, once we have all files in proper places it’s time to inform MediaWiki about VisualEditor.

Changes to LocalSettings.php

Changes which have to be applied to LocalSettings.php:

# VISUAL Editor
require_once("$IP/extensions/VisualEditor/VisualEditor.php");
$wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgHiddenPrefs[] = 'visualeditor-enable';
$wgVisualEditorParsoidURL = 'http://localhost:8000';
$wgVisualEditorParsoidPrefix = 'localhost';
Remember to adjust Parsoid URL and Prefix accordingly to setup of your Parsoid service.

From now on you can enjoy VisualEditor until you decide to upgrade to newer version of MediaWiki.
Prior to that I would suggest to check if there is VisualEditor available for new release and test it prior to live deployments.

1

How-To : Deploy Parsoid for MediaWiki on openSUSE 13.1 x64

-

I took a challenge of running MediaWiki with Visual Editor extension on openSUSE 13.1 x64. Task sounds maybe easy, but turned out to be little madness, so once I got this working I think it might be nice to share my steps.

Operating system has been deployed from ISO image: openSUSE-13.1-NET-x86_64.iso.

Installing Node.js

Basically Node.js package which is included in distro doesn’t work properly. For that reason first step is to add new repository for Node.js:

sudo zypper ar http://download.opensuse.org/repositories/devel:/languages:/nodejs/openSUSE_13.1/ Node.js
sudo zypper in nodejs nodejs-devel
yast -i nodejs

 

Updating NPM

Once Node.js is installed it’s not quite fully working yet and any attempt of using npm fails. Some symlinks are missing, so to fix it we can just update npm:

curl -L https://npmjs.org/install.sh | sudo sh

 

Parsoid deployment

Now we can download Parsoid and make it work:

cd /srv
git clone https://gerrit.wikimedia.org/r/p/mediawiki/services/parsoid
cd parsoid
npm install
npm test
npm start
Parsoid will be located in /srv/parsoid folder. Do not forget to modify /srv/parsoid/api/localsettings.js for your system.

This is quite brief description, however saves lot of time and fight with Node.js and npm on openSUSE.