Jump to: navigation, search

Parsoid is an application which can translate back and forth, at runtime, between MediaWiki's wikitext syntax and an equivalent HTML/RDFa document model with enhanced support for automated processing and rich editing. It has been under development by a team at the Wikimedia Foundation since 2012. It is currently used extensively by VisualEditor, Flow, Content Translation and other applications.

Parsoid is structured as a web service, and is written in JavaScript, making use of Node.js. It is intended to provide flawless back-and-forth conversion, i.e. to avoid information loss and also prevent "dirty diffs".

On Wikimedia wikis, for several applications, Parsoid is currently proxied behind RESTBase, which stores the HTML translated by Parsoid.

For more on the overall project, see this blog post from March 2013. To read about the HTML model being used, see MediaWiki DOM spec.

For a quick overview, you can test drive Parsoid (production Parsoid service).

Artist's impression of the Parsoid HTML5 + RDFa wiki runtime

Parsoid setup[edit | edit source]

See Parsoid/Setup for detailed instructions. If you use the MediaWiki-Vagrant development environment using a virtual machine, you can simply add the role visualeditor to it and it will set up a working Parsoid along with Extension:VisualEditor.

Troubleshooting[edit | edit source]

See the troubleshooting page.

Contacting us[edit | edit source]

If you need help or have questions, you can contact us in #mediawiki-parsoidconnect or the wikitext-l mailing list. If all that fails, you can also contact us by email at parsing-team at the domain.

The Parsoid web API + DOM Spec[edit | edit source]

See Parsoid/API for the web API

See Parsoid/MediaWiki DOM spec to make sense of the HTML that you get from the API. This is the wiki content model spec using HTML/XML DOM and RDFa and is designed to be useful as a future storage format.

Plans for Q4 2014[edit | edit source]

Our plans for Q4 2014 are spelled out in task T92643. All pending tasks and bugs are tracked in our bug list.

Development[edit | edit source]

Development happens in the Parsoid service in Git (see tree). Code review happens in Gerrit. See Gerrit/Getting started to set up an account for yourself.

Running the tests[edit | edit source]

To run all parser tests and mocha tests:

npm test

parserTests has quite a few options now which can be listed using node parserTests --help.

Converting simple wikitext[edit | edit source]

You can convert simple wikitext snippets from the command line using the parse.js script in the tests/ directory:

echo '[[Foo]]' | node parse

The parse script has a lot of options. node parse --help gives you information about this.

In Ubuntu 13 and 14, node has been renamed to nodejs. There, either create a symbolic link (or equivalent) or type:

echo '[[Foo]]' | nodejs parse

Debugging Parsoid (for developers)[edit | edit source]

See Parsoid/Debugging for debugging tips.

Technical documents[edit | edit source]

Useful links for Parsoid developers[edit | edit source]

See also[edit | edit source]