Visual Editor

From Void-Byte
Revision as of 22:21, 26 July 2020 by Bgrambo (talk | contribs)
Jump to navigation Jump to search

Simple overview on how to install the Parsoid service, and Visual Editor for MediaWiki.


Resources:

https://www.mediawiki.org/wiki/Parsoid/Setup#Ubuntu_/_Debian

https://www.howtoforge.com/tutorial/how-to-install-visualeditor-for-mediawiki-on-centos-7/

https://www.mediawiki.org/wiki/Extension:VisualEditor


Parsoid Installation (Unbuntu 18.04, 20.04)

#Import the repository gpg key: (key created on 2019-06-13 with validity 2029-04-23)

1. sudo apt install dirmngr

2. sudo apt-key advanced --keyserver keys.gnupg.net --recv-keys AF380A3036A03444

#Add the Wikimedia repository

1. sudo apt-add-repository "deb https://releases.wikimedia.org/debian jessie-mediawiki main"

#Installation

1. sudo apt install apt-transport-https

2. sudo apt update && sudo apt install parsoid

#Configuration

1. vim /etc/mediawiki/parsoid/config/yaml

2. change mwApis section to include:

2a. uri: 'http(s)://fqdn.com/api.php'

2b. domain: 'fqdn.com'

3. wq!


Visual Editor Installation


#Download

1. wget https://extdist.wmflabs.org/dist/extensions/VisualEditor-REL1_34-74116a7.tar.gz

2. tar -xzf VisualEditor-REL1_34-74116a7.tar.gz -C /var/www/html/mediawiki/extensions/


#Add the following lines to the LocalSettings.php (after downloading extension.

wfLoadExtension( 'VisualEditor' );

// Enable by default for everybody
$wgDefaultUserOptions['visualeditor-enable'] = 1;

// Optional: Set VisualEditor as the default for anonymous users
// otherwise they will have to switch to VE
// $wgDefaultUserOptions['visualeditor-editor'] = "visualeditor";

// Don't allow users to disable it
$wgHiddenPrefs[] = 'visualeditor-enable';

// OPTIONAL: Enable VisualEditor's experimental code features
#$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;
$wgVirtualRestConfig['modules']['parsoid'] = array(
    // URL to the Parsoid instance
    // Use port 8142 if you use the Debian package
    'url' => 'http://fqdn.org:8142',
    // Parsoid "domain", see below (optional)
    'domain' => 'fqdn.org',
    // Parsoid "prefix", see below (optional)
    #'prefix' => 'localhost'
);

#Allow port 8142

3. sudo ufw allow 8142