Page MenuHomePhabricator

TextExtracts may expose a parse-like API
Open, LowPublic

Description

As additional feature, the TextExtracts extension may provide a new API entry point suitable for an arbitrary input, much like we are doing for the MediaWiki's action=parse API.

See:
https://www.mediawiki.org/wiki/API:Parsing_wikitext

This could be useful to extend functionalities of the edit page. For example, to provide more information in the edit preview. Doing some stats on the plain text content, saying how much words, newlines, etc., getting rid of wikitext, you know.

For example:

action=textextracts
text=[[The quick brown fox|Well]] thank you
explaintext=1

Well thank you

What do you think about?

Event Timeline

Jdlrobson added a subscriber: Jdlrobson.

TextExtracts currently has no active maintainers and it's future is unclear per T258964 so we're not considering feature requests right now. Sorry about that.

TextExtracts currently has no active maintainers and it's future is unclear per T258964 so we're not considering feature requests right now. Sorry about that.

Are you aware if Parsoid provides a similar API for some reasons (even internal)?

Thanks

@valerio.bozzolan I don't believe arbitrary parsing for summaries exists. However, I could imagine the following API supporting a POST. I believe Mobile-Content-Service is the correct tag to request that but I can't see it being a high priority.

curl -X GET "https://en.wikipedia.org/api/rest_v1/page/summary/Spain" -H  "accept: application/json; charset=utf-8; profile="https://www.mediawiki.org/wiki/Specs/Summary/1.4.2""