Parsoid (Deprecated)

From 24PinTech Wiki
Revision as of 20:19, 14 December 2018 by Tgriego (talk | contribs)
Jump to navigation Jump to search

Introduction

Parsoid is the back-end for VisualEditor (VE). Essentially, it takes the HTML contents from VE and parses it into wikitext, which is the syntax that MediaWiki uses to display pages. It runs off of node.js and can be installed as a service from a package through apt-get, but I've only been able to get it to work when using the running developer setup through PM2.

Installation

This part has already been documented on the MediaWiki website. If you want to install it traditionally, click here, but if you'd like to install a developer setup, click here. I basically followed the same process for the developer setup, but I'll still document what was completed.

.

First, you'll want to install node.js and git by running sudo apt-get install nodejs git. Verify that it's been installed by running node --version and then git --version. Next, create and navigate to /etc/mediawiki/ by running sudo mkdir /etc/mediawiki && cd /etc/mediawiki. Once you're ready to pull the contents from the Parsoid git directory, run sudo git clone https://gerrit.wikimedia.org/r/p/mediawiki/services/parsoid and wait for the download to finish. Move into the newly created parsoid directory by running cd parsoid, and then completing the install by running sudo npm install.

Configuration

In order to create and then edit the configuration file, run sudo cp config.example.yaml config.yaml && sudo vim config.yaml. In there, you'll see something that looks like this:

        mwApis:
        - # This is the only required parameter, the URL of you MediaWiki API endpoint.
          uri: 'http://localhost/w/api.php'
          # The "domain" is used for communication with Visual Editor and RESTBase.
          # It defaults to the hostname portion of the `uri` property below, but you can manually set it to an arbitrary string.
          domain: 'localhost'  # optional

PM2

In order to run the developer setup of Parsoid headless and in the background, you'll want to use PM2

Troubleshooting