Difference between revisions of "Parsoid and VisualEditor"

From 24PinTech Wiki
Jump to navigation Jump to search
 
Line 4: Line 4:
[[File:Parsoid word logo.svg.png|thumb]]
[[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.
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 ==
== Setup ==
Line 10: Line 9:


=== LocalSettings.php ===
=== 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.
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( 'VisualEditor' );</code>
Line 17: Line 16:


=== Server Block Config ===
=== Server Block Config ===
You will have to add the rest base server to your server block for this to work.
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>location /rest.php/ {</code>
Line 24: Line 23:


<code>}</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 ===
=== If that doesn't work ===

Latest revision as of 19:30, 8 August 2022


About

Parsoid word logo.svg.png

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.