Parsoid allows an editor to use MediaWiki extensions such as VisualEditor.
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.
Parsoid 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.
GitHub Repository: https://github.com/wikimedia/parsoid
- Releases - List of releases made for parsoid
- /API - for the web API
- MediaWiki DOM spec - to make sense of the HTML that you get from the API, designed to be useful as a future storage format
- /LanguageConverter - notes on Parsoid's implementation of mw:LanguageConverter
- /Known differences with PHP parser output
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.
See our PHP porting notes if you are helping with the PHP port.
Running the tests
To run all parser tests and mocha tests:
$ npm test
The parser tests have quite a few options now which can be listed using
node bin/parserTests.js --help.
To run tests on the PHP port:
$ composer test
Converting simple wikitext
You can convert simple wikitext snippets from the command line using the
parse.js script in the bin/ directory:
echo 'Foo' | node bin/parse.js
The parse script has a lot of options.
node bin/parse.js --help gives you information about this.
(In Ubuntu 13 and 14,
node has been renamed to
nodejs. There, either type
nodejs or create a symbolic link or equivalent.)
Debugging Parsoid (for developers)
See Parsoid/Debugging for debugging tips.
- /Internals: documentation about Parsoid internals with links to other details.
- PHP Porting notes and help-wanted tasks
- Parsoid deployment agenda on Wikimedia cluster (code normally deployed every Monday and Wednesday between 1pm - 1:30pm PST)
- /Round-trip testing: The round-trip testing setup we are using to test the wikitext -> HTML DOM -> wikitext round-trip on actual Wikipedia content.
- /Visual Diffs Testing: Info about visual diff testing for comparing Parsoid's html rendering with php parser's html rendering + a testreduce setup for doing mass visual diff tests.
- /limitations: Limitations in Parsoid, mainly contrived templating (ab)uses that don't matter in practice. Could be extended to be similar to the preprocessor upgrade notes (Might need updating)
- /Bibliography: Bibliography of related literature
Links for Parsoid developers
- See Parsoid/Debugging for debugging tips.
- Upgrading or adding packages to Parsoid
- See these instructions for syncing Parsoid's copy of parser tests to/from core
- Parsoid has a limited library interface for invoking it programatically.
Links for Parsoid deployers (to the Wikimedia cluster)
- RT testing commits (useful to check regressions and fixes)
- Deployment instructions for Parsoid
- Kibana dashboard
- Grafana dashboard for wt2html metrics
- Grafana dashboard for html2wt metrics
- Grafana dashboard for non-200 responses
- Prometheus breakdown for the Parsoid cluster on eqiad
- Prometheus breakdown for the Parsoid cluster on codfw
- Jenkins Job Builder docs for updating jenkins jobs
- RESTBase: a caching / storing API proxy for page HTML translated by Parsoid
- Quarterly review meetings of the Parsoid team: April 2015, January 2015 (earlier)
- Future/Parser plan: Early (now relatively old) design ideas and issues
- Special:PrefixIndex/Parsoid/: Parsoid-related pages on this wiki
- parsoid-jsapi: a high-level interface for extraction and transformation of wikitext, similar to the mwparserfromhell API.
- Alternative parsers
If you need help or have questions/feedback, you can contact us in connect or the wikitext-l mailing list. If all that fails, you can also contact us by email at parsing-team at the wikimedia.org domain.