Jump to content

Help:Extension:ParserMigration

From mediawiki.org
Revision as of 03:02, 15 November 2023 by Cscott (talk | contribs) (→‎Switching between Parsoid and the legacy parser: Describe the "switch back to legacy parser" link added to the tools menu.)

The ParserMigration extension allows users to compare the output of the legacy wikitext parser with the latest Parsoid wikitext parser.

Enabling via user preference

This extension adds Enable parser migration tool and Use Parsoid by default to the list of Developer tools options at the bottom of the Editing preferences for a user. To opt-in to test Parsoid read views, ensure Use Parsoid by default is checked.

User preferences items added by the ParserMigration extension

Opting in to Parsoid read views on all wikis

To opt in to Parsoid read views on all wikis, you will need to select Use Parsoid by default in your global preferences. First, click the Set your global preferences button on the "User profile" page of your user preferences:

Global Preferences button in MediaWiki user preferences

After you have switched to global preferences, select the Enable parser migration tool and Use Parsoid by default options at the bottom of your Editing preferences tab:

The two global preferences added by the ParserMigration extension

Switching between Parsoid and the legacy parser

When Use Parsoid by default is selected, article and discussion pages will use the new Parsoid parser by default. To compare the output to the legacy parser, or to temporarily switch back to the legacy parser, a Use legacy parser link is added to the user tools sidebar.

Link added to the Tools menu which allows switching back to legacy parser output

Comparing article rendering

When Use parser migration tool is enabled, an Edit with migration tool link is added to the Tools menu in the sidebar for article pages.

Page tools menu item added by the ParserMigration extension

Clicking this on an article page will bring up a variant of the "preview edit" page which allows you to compare the legacy parser output against Parsoid output.

Parser output comparison page added by the ParserMigration extension

Action API

This extension also adds action=parser-migration to the MediaWiki action API, which parses a page with two different parser configurations and returns one or both variants in the API response.

Action API added by the ParserMigration extension