Add a generic extension registration mechanism
Closed, ResolvedPublic

Description

We need a way to register custom extensions from localsettings.js. These should provide handlers that work on the token stream (by emitting tokens) or on the DOM (by converting the extension tag into an HTML DOM), and in the serializer (to convert an extension node back to wikitext).

The details are hashed out in https://www.mediawiki.org/wiki/Parsoid/Extension_registration_interface.


Version: unspecified
Severity: normal

Details

Reference
bz53874

Related Objects

StatusAssignedTask
OpenNone
Resolvedmatmarex
OpenNone
OpenNone
OpenNone
OpenNone
Resolvedmatmarex
Resolvedmatmarex
OpenNone
OpenNone
ResolvedArlolra
OpenNone
OpenNone
OpenNone
ResolvedArlolra
OpenNone
OpenNone
ResolvedArlolra
ResolvedArlolra
bzimport raised the priority of this task from to Normal.
bzimport set Reference to bz53874.
Arlolra removed GWicke as the assignee of this task.Nov 25 2014, 8:04 PM
Arlolra set Security to None.
ssastry moved this task from Backlog to Needs Discussion on the Parsoid board.Feb 3 2015, 11:08 PM
GWicke added a comment.EditedMay 4 2015, 5:54 PM

Most extensions (both tag extensions and parser functions) operate independently and directly return the expected content. This enables parallel processing, caching and fairly straightforward preview of individual invocations in VE.

In the WMF projects the only exception to this rule is Cite, which needs to collect all citations in a page. I would caution against supporting general global content processing from extensions beyond Cite unless there is a really good reason to do so. In most cases I think it would be preferable to directly return the expected content from the parser function or tag extension.

Kelson added a subscriber: Kelson.May 4 2015, 6:02 PM
ssastry moved this task from Needs Discussion to In Progress on the Parsoid board.Oct 16 2015, 2:43 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 16 2015, 2:43 PM
Arlolra claimed this task.Oct 16 2015, 3:38 PM

Change 256171 had a related patch set uploaded (by Arlolra):
WIP: Add a generic extension registration mechanism

https://gerrit.wikimedia.org/r/256171

Change 256171 merged by jenkins-bot:
Add a generic extension registration mechanism

https://gerrit.wikimedia.org/r/256171

Arlolra closed this task as Resolved.Dec 29 2015, 11:31 PM

The mechanism exists ... but documenting the exposed API and determining the appropriate helpers will come as we iterate on a few use cases.