Wrinkle / Templates

From WhyNotWiki

Jump to: navigation, search
<%= has_aliases ["source code management", "revision control", "version control"] =>

would call the has_aliases template, which could then iterate through the array that was passed to it.

'''Aliases''': <%= aliases.map(&:to_link).join(", ") %>

You couldn't do that in MediaWiki, because MediaWiki templates don't support iteration, arrays, ... really they don't have any data types other than strings for their arguments.

In short, MediaWiki templates suck. They're not very powerful at all.

[edit] Questions

If templates are written in Ruby and have the full power of ruby, how do we prevent users from creating unsafe templates?

Personal tools