Difference between revisions of "Parsoid and VisualEditor"
(Created page with "Category:Webserver") |
|||
(One intermediate revision by the same user not shown) | |||
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. Our LocalSettings.php is located at <code>/var/www/wiki.24pin.tech/LocalSettings.php</code> | |||
<code>wfLoadExtension( 'VisualEditor' );</code> | |||
<code>wfLoadExtension( 'Parsoid', __DIR__, '/vendor/wikimedia/parsoid/extension.json' );</code> | |||
=== Server Block Config === | |||
You will have to add the restbase server to your server block for this to work. Our server block is located at <code>/etc/nginx/sites-available/wiki.24pin.tech</code> | |||
<code>location /rest.php/ {</code> | |||
<code>try_files $uri $uri/ /rest.php?$query_string;</code> | |||
<code>}</code> | |||
These lines are just another location block that you will add at the end of your server block. | |||
=== 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. |
Latest revision as of 19:30, 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. Our LocalSettings.php is located at /var/www/wiki.24pin.tech/LocalSettings.php
wfLoadExtension( 'VisualEditor' );
wfLoadExtension( 'Parsoid', __DIR__, '/vendor/wikimedia/parsoid/extension.json' );
Server Block Config
You will have to add the restbase server to your server block for this to work. Our server block is located at /etc/nginx/sites-available/wiki.24pin.tech
location /rest.php/ {
try_files $uri $uri/ /rest.php?$query_string;
}
These lines are just another location block that you will add at the end of your server block.
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.