Page MenuHomePhabricator

Expose parsoid transformation API from MediaWiki core.
Closed, ResolvedPublic

Description

Problem: some clients like cxserver (T344982) need a way to convert between wikitext and HTML on the fly. Restbase provides the tranform API to address this need. If we deprecate RESTbase, we need a replacement.

Solution: expose the tranform API already implemented in core. That API is already accessible in development mode (in CI, on testwiki and on beta), and it is also the basis of the transformation API implemented by the parsoid extension which is what we currently expose through restbase.

NOTE: we probably don't want to enable support for the pagebundle format, just wikitext, html, and lint.

Event Timeline

@MSantos @ssastry Can the Conten Transform team commit to maintaining the transform endpoint as a public API? CT has been looking after this functionality when it lived in RESTbase, and has ported it to PHP. Derick and I moved it into core last year, and refactored it a bit.

Change 972322 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/core@master] REST: enable parsoid transform endpoints

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

Change 972322 merged by jenkins-bot:

[mediawiki/core@master] REST: enable parsoid transform endpoints

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

Duplicate of T310398? Subtask of T334238?

I'm happy you're working on this, by the way!

All new endpoints should be documented on the wiki page. Thanks!

daniel claimed this task.

The transform endpoint is now live, e.g. at https://en.wikipedia.org/w/rest.php/v1/transform/ (POST only).

All new endpoints should be documented on the wiki page. Thanks!

That page is getting huge, making it hard to read and hard to navigate. Editing is hard too, due to all the <translate> stuff...

What do you think of splitting it?

Also, the page could really benefit from some templates.