Jump to content

Topic on User talk:Amire80/Flow

BoldLuis (talkcontribs)

An user answered me:


SSastry (WMF) (talkcontribs) The current wikitext model requires the processed template output (= wikitext) to be merged into the top-level page before the output of the full page is converted to HTML. This is the preprocessing model where a transclusion ({{some-tpl|..args..}}) is evaluated. This preprocessing will fetch other templates where necessary, and so on recursively. I should go look at the code to be sure, but in the current model, every one of these template fetches will be resolved to a target. And, so if template target resolution goes through a global template repository, then it is likely every recursively referenced template will be impacted by that. An alternative model of course is to change the code so that during template preprocessing, all template references resolve on the local wiki where the top-level template target resolves to.

<tangent>Parsoid is eventually trying to get to a model where a transclusion is processed independent of everything on the page and so the output of the transclusion is always HTML / DOM (or if we are able to arrive at typed templates, then it will be some typed value, with the default being HTML/DOM always). In addition, we are trying to get to a place where Parsoid doesn't care what component generated it as long as the types match up. So, both the above preprocessing systems would be compatible with Parsoid. And, at some level, extension are no different than templates in that regard. Everything produces a typed value. So, you can build whatever transclusion system you want as long as you adhere to the type contract. Getting to this point is a bit slow since we are still trying to get to Parsoid being the only wikitext engine.

For example, Scribunto could be considered to be a different templating model from the native wikitext templating model. They look the same on the surface because editors have adopted a mechanism where the module #invoke calls are hidden behind a typical wikitext transclusion.

So, from the ideal Parsoid POV, the qn. of global templates vs local templates or some-other-form-of-templates is an implementation decision of the implementor and they can all coexist as long as they can be appropriately namespaced / disambiguated. But, of course from a product POV, wikis might choose to pick a single mechanism.</tangent>

Hope that helps.

Reply to "Interesting"