VisualEditor: Difference between revisions

The educational technology and digital learning wiki
Jump to navigation Jump to search
Line 28: Line 28:


* [https://www.mediawiki.org/wiki/Extension:VisualEditor Extension:VisualEditor]
* [https://www.mediawiki.org/wiki/Extension:VisualEditor Extension:VisualEditor]
* [https://www.mediawiki.org/wiki/Parsoid Parsoid]
* [https://www.mediawiki.org/wiki/Parsoid Parsoid], implemented with [http://en.wikipedia.org/wiki/Node_js Node.js]


I managed to get this installed and working. I took me about 3 hours (mostly because I didn't think enough and because I am not a sysadmin ...). Anyhow, it does work on MediaWiki 1.24. It also seems to handle pages that include templates and semantic forms. I don't think that semantic tags will work, but since we always semantic forms that's ok. Will have to do some extra testing on a production server however - [[User:Daniel K. Schneider|Daniel K. Schneider]] ([[User talk:Daniel K. Schneider|talk]]) 18:38, 26 June 2014 (CEST)
I managed to get this installed and working, both on a test server and in the french version of this wiki. I took me about 3 hours (mostly because I didn't think enough and because I am not a sysadmin ...). Anyhow, it does work on MediaWiki 1.24. It also seems to handle pages that include templates and semantic forms. I don't think that semantic tags will work, but since we always semantic forms that's ok. Will have to do some extra testing however - [[User:Daniel K. Schneider|Daniel K. Schneider]] ([[User talk:Daniel K. Schneider|talk]]) 18:38, 26 June 2014 (CEST)


== MediaWiki 1.24 alpha installation notes ==
== MediaWiki 1.24 alpha installation notes ==

Revision as of 01:06, 27 June 2014

Category:MediaWiki extension
VisualEditor
Extension name VisualEditor
About this article / disclaimer [[Has about meta information::The VisualEditor project aims to create a reliable rich-text editor for MediaWiki. [...] 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.]]
Logo VisualEditor-logo.svg.png
Screenshot MW1 24-visual-editor-test.png
Location of the main author Berlin
Coordinates of the main authors 52.510885, 13.398937
Developers
Licences
Description
Mediawiki requirements 1.23 (or better)
Dependencies
Related extensions (documented here)
Related extensions
Discussion
Language support
Status beta
First release date
Last release date (as of 2014/06/20!)
Last version number 0.1.0 (as of June 2014)
Programming language
Alternatives
Website home page
Publications
Support websites web site
Example websites
Last edited 2014/06/20

Introduction

The MediaWiki Visual Editor (operational since 2013 and more fully deployed on Wikipedia since 2014) is a Wysiwyg editor. It requires two components:

I managed to get this installed and working, both on a test server and in the french version of this wiki. I took me about 3 hours (mostly because I didn't think enough and because I am not a sysadmin ...). Anyhow, it does work on MediaWiki 1.24. It also seems to handle pages that include templates and semantic forms. I don't think that semantic tags will work, but since we always semantic forms that's ok. Will have to do some extra testing however - Daniel K. Schneider (talk) 18:38, 26 June 2014 (CEST)

MediaWiki 1.24 alpha installation notes

Made for Ubuntu 12LTS (and should be somewhat useful for most Debian systems)

  • I did not manage to make it work for MW 1.23. But you can try. Upgrade the wiki to the latest patches
git branch -r

Trying out the alpha version. Not really recommended on production systems, unless you really want this editor....

cd installdir
git checkout master
or maybe
git checkout origin/master -B master
then
git pull

If this fails, try:

git checkout origin/master -B master

Download and install the extension

cd installdir

Update your wiki first to the recent patches

git pull

Get and install the VisualEditor extension

git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/VisualEditor.git
cd VisualEditor

Initialize the submodule (whatever that is ...)

git submodule update --init

Backtrack to an older version if your work with an older wiki version ! However, I did not manage to make this work with MW 1_23. If you want to try yourself for MW 1_23, use:

git checkout REL1_23

Download and install the parsoid

This depends on your OS. For Ubuntu 12.04 LTS you cannot use the official distro as explained in the official setup documentation.

Install Parsoid

Firstly edit the /etc/apt/sources.list file:

deb http://parsoid.wmflabs.org:8080/debian wmf-production/

Then get/install Parsoid

sudo apt-get update
sudo apt-get install parsoid

This will create:

  • a user parsoid (uid = 118)
  • A Parsoid server that runs on port 8142

Check it it runs, e.g.

more  /var/log/parsoid/parsoid.log 

Files:

/usr/lib/parsoid # the parsoid installation directory
/etc/default/parsoid # default settings
/etc/mediawiki/parsoid/settings.js # MEdiawiki-specific stuff
/var/log/parsoid/parsoid.log

Install NodeJS

Then get a different NodJS first

sudo apt-get update
sudo apt-get install -y python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs=0.10*

Test if it's there:

 nodejs --version
 v0.10.28

Configure Parsoid

Continue parsoid install

Go to the Parsoid source directory

cd /usr/lib/parsoid/src

Type

npm install
This will take a while and will download extra stuff. npm seems to be a kind of node management tool (yes I don't understand anything here...)

Test it (again in the src directory)

npm test

Your will get something like

3206 total passed tests (expected 3206), 1927 total failures (expected 1927)
--> NO UNEXPECTED RESULTS <--
==========================================================
WARNING: parserTests.txt not up-to-date with upstream.
        Run fetch-parserTests.txt.js to update.

Configure parsoid install

The instructions are a bit confused on the official web sites, e.g. not even the directory locations are clear. According to this, if you would like to point the Parsoid web service to your own wiki, go to the parsoid/api directory and create a localsettings.js file based on localsettings.js.example.

However, Ubuntu reads the config file from here:

/etc/mediawiki/parsoid/settings.js

because:

/etc/init.d/parsoid reads from /etc/default/parsoid the following configuration defaults:
PARSOID_LOG_FILE=/var/log/parsoid/parsoid.log
PARSOID_SETTINGS_FILE=/etc/mediawiki/parsoid/settings.js

Therefore do this:

cd /etc/mediawiki/parsoid/settings.js
Edit settings.js and define parsoidConfig.setInterwiki as in the examples below:
   // parsoidConfig.setInterwiki( 'test', 'http://localhost/test/api.php' ); // does not work
    parsoidConfig.setInterwiki( 'test', 'http://edutechwiki.unige.ch/test/api.php' ); // works
   // parsoidConfig.setInterwiki( 'noconn', 'http://213.127.84.12:80/wikiarst/api.php' );
   //parsoidConfig.setInterwiki( 'disney', 'http://disneychannel.wikia.com/api.php' );

In other installs, you may have to edit file /usr/lib/parsoid/src/api/localsettings.js to add your wikis (you can use several of these). Of course you also should test if the api.php URL works. If you use server aliases, http://localhost/yourwiki may not work at all.

After making changes to the config file, restart the parsoid

/etc/init.d/parsoid restart

Configure the extension

In Localsettings.php, add something like this:

# VISUAL Editor
// If this breaks, then you likely have a version mismatch - downgrade visual editor or upgrade the wiki to alpha code
require_once("$IP/extensions/VisualEditor/VisualEditor.php");
 
// OPTIONAL: Enable VisualEditor in other namespaces
// By default, VE is only enabled in NS_MAIN
//$wgVisualEditorNamespaces[] = NS_PROJECT;
 
// Enable by default for everybody
$wgDefaultUserOptions['visualeditor-enable'] = 1;
 
// Don't allow users to disable it
$wgHiddenPrefs[] = 'visualeditor-enable';
 
// OPTIONAL: Enable VisualEditor's experimental code features
//$wgVisualEditorEnableExperimentalCode = true;

// Interwiki prefix to pass to the Parsoid instance - must match what you declared in the parsoid settings
// Parsoid will be called as $url/$prefix/$pagename
$wgVisualEditorParsoidPrefix = 'test';

// Declare the Parsoid - Make sure to get the right port
$wgVisualEditorParsoidURL = 'http://localhost:8142';