"**Transclusion / Template s..."


by Eric Bruylant Feb 16 2016

Transclusion / Template system

Templates and Scribunto power most of the strucured information across Wikimedia (exception: Wikidata), most notably the infoboxes, links to related pages, and notice templates, but also a huge number of other specific functions. They are an incredibly flexible tool which makes it possible for users to create and maintain things that would never be done if each page had to be updated by hand, and hides complexity from less technical users who can easily include them in pages by copying existing examples.

This is not an easy feature to get right, but something which fills their function is essential to attract editors from any existing mediawiki wiki.

MW started off with basic transclusion+parameters, then added various parser functions in a way which turned out to be ugly and inefficient to the point where they were forced to add (limited) lua scripting.

(WIP, will come back to this with more thoughts)


Eric Bruylant

Seems like there's main two parts:

How do we make it intuitive for editors

Displaying template parameters in the text scales badly, is not a natural way of entering information, and generally scares away editors. My current best idea for solving this is copying TemplateData's method (click on the infobox template, it lets you open a form to edit template parameters), but have the template call code highlighted in source editor (highlight), and make clicking that bring up a form to edit the parameters.

A bonus is storing the parameters separately makes it much easier to reuse the structured information.

What features does it need to be handle the major use cases



Would be good:


Eric Bruylant

(This part was written first, but the conclusion/outline seemed more valuable than this background thought) I realized why I'm struggling to come up with good ideas for this one: I only really know much about MW's system.

So, did a bit of research into how it's done on other software. They mostly do similar things, and all major wiki software includes some form of templating, but many have different takes on the core idea (e.g. Cofluence is clearly optimized for non-technical users).

Misc thoughts/findings:

Some other links: