Difference between revisions of "Parsoid and VisualEditor"
(Created page with "Category:Webserver") |
|||
Line 1: | Line 1: | ||
[[Category:Webserver]] | [[Category:Webserver]] | ||
== About == | |||
[[File:Parsoid word logo.svg.png|thumb]] | |||
VisualEditor is the plugin that allows MediaWiki to edit pages through the web format. It makes creating pages a seamless process with copy and paste functionality from Google Docs or anywhere else with formatting. VisualEditor runs through a service called Parsoid though. Parsoid takes the text inputted on the VisualEditor, and it parses it into wikitext. | |||
== Setup == | |||
To setup Parsoid with VisualEditor you have to configure two files. | |||
=== LocalSettings.php === | |||
LocalSettings.php is located in the root directory of your website. In this file you must find where the extensions are loaded. If VisualEditor is not already loaded, you must load it manually. Add these following lines to the plugins. | |||
<code>wfLoadExtension( 'VisualEditor' );</code> | |||
<code>wfLoadExtension( 'Parsoid', __DIR__, '/vendor/wikimedia/parsoid/extension.json' );</code> | |||
=== Server Block Config === | |||
You will have to add the rest base server to your server block for this to work. | |||
<code>location /rest.php/ {</code> | |||
<code>try_files $uri $uri/ /rest.php?$query_string;</code> | |||
<code>}</code> | |||
=== If that doesn't work === | |||
There could be a multitude of reasons that Parsoid does not work, so the best way to figure it out is researching. The only other fix I could recommend, is adding this to the end of your LocalSettings.php file. | |||
<code>$wgDefaultUserOptions['visualeditor-enable'] = 1;</code> | |||
<code>$wgDefaultUserOptions['visualeditor-editor'] = "visualeditor";</code> | |||
<code>$wgHiddenPrefs[] = 'visualeditor-enable';</code> | |||
This is it... It's not as complicated as we thought. |
Revision as of 18:46, 8 August 2022
About
VisualEditor is the plugin that allows MediaWiki to edit pages through the web format. It makes creating pages a seamless process with copy and paste functionality from Google Docs or anywhere else with formatting. VisualEditor runs through a service called Parsoid though. Parsoid takes the text inputted on the VisualEditor, and it parses it into wikitext.
Setup
To setup Parsoid with VisualEditor you have to configure two files.
LocalSettings.php
LocalSettings.php is located in the root directory of your website. In this file you must find where the extensions are loaded. If VisualEditor is not already loaded, you must load it manually. Add these following lines to the plugins.
wfLoadExtension( 'VisualEditor' );
wfLoadExtension( 'Parsoid', __DIR__, '/vendor/wikimedia/parsoid/extension.json' );
Server Block Config
You will have to add the rest base server to your server block for this to work.
location /rest.php/ {
try_files $uri $uri/ /rest.php?$query_string;
}
If that doesn't work
There could be a multitude of reasons that Parsoid does not work, so the best way to figure it out is researching. The only other fix I could recommend, is adding this to the end of your LocalSettings.php file.
$wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgDefaultUserOptions['visualeditor-editor'] = "visualeditor";
$wgHiddenPrefs[] = 'visualeditor-enable';
This is it... It's not as complicated as we thought.