Page MenuHomePhabricator

Parsoid API to "expand page X with parameter Y and Z"
Open, MediumPublic


Right now Parsoid only expands "top level pages". But eventually Parsoid is going to have to do template expansion, and on our roadmap is to do incremental parsing and caching of the components of the page.

A first step is to expand the RESTBase API that currently says "give me the HTML for the top level page [[Foo]]" to also allow "give me the HTML for the template [[Foo]] with parameters X and Y. This would then get cached like top level pages do.

This would solve issues like in {T259824: DiscussionTools doesn't work on featured article discussions on ko.wp} (where DiscussionTools has to chase down recursive transclusions to find the "true" page holding a given discussion topic/reply/etc), and get us a step further on our incremental parsing roadmap.

One big open question: how do we supply parameters 'X' and 'Y'? As wikitext, as tokens, as HTML? Allow any of the above? (In programming language terms, this is related to the eager-evaluation/lazy-evaluation decision.) Eventually we might have "wikitext 2.0" including templates written in "wikitext 1.0" (or vice versa) so being deliberate and careful about the type of the parameter string is important.