MediaWiki-Docker/Extension/VisualEditor

From mediawiki.org
Jump to navigation Jump to search

Follow Quickstart instructions at MediaWiki-Docker page. Once MediaWiki is running and available at http://localhost:8080, add the following code at the bottom of your LocalSettings.php:

wfLoadSkin( 'Vector' );

wfLoadExtension( 'VisualEditor' );

$PARSOID_INSTALL_DIR = 'vendor/wikimedia/parsoid'; # bundled copy
#$PARSOID_INSTALL_DIR = '/my/path/to/git/checkout/of/Parsoid';

// For developers: ensure Parsoid is executed from $PARSOID_INSTALL_DIR,
// (not the version included in mediawiki-core by default)
// Must occur *before* wfLoadExtension()
if ( $PARSOID_INSTALL_DIR !== 'vendor/wikimedia/parsoid' ) {
    AutoLoader::$psr4Namespaces += [
        // Keep this in sync with the "autoload" clause in
        // $PARSOID_INSTALL_DIR/composer.json
        'Wikimedia\\Parsoid\\' => "$PARSOID_INSTALL_DIR/src",
    ];
}

wfLoadExtension( 'Parsoid', "$PARSOID_INSTALL_DIR/extension.json" );

# Manually configure Parsoid
$wgVisualEditorParsoidAutoConfig = false;
$wgParsoidSettings = [
    'useSelser' => true,
    'rtTestMode' => false,
    'linting' => false,
];
$wgVirtualRestConfig['modules']['parsoid'] = []

Run the following in the directory where you installed MediaWiki:

git clone "https://gerrit.wikimedia.org/r/mediawiki/skins/Vector" skins/Vector

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

cd extensions/VisualEditor
git submodule update --init

docker-compose exec mediawiki php maintenance/update.php

See Also[edit]