#funwhilelostMediaWiki has a templating system that's heavily leveraged on Wikipedia. They often use the "ParserFunctions" extension to add logic to them as well. The source for the MediaWiki about template is at https://en.wikipedia.org/wiki/Template:About