Manual:HTML templates

As of MediaWiki 1.25, HTML content can be generated within MediaWiki using Mustache templates. Currently, template parsing is supported on the server-side via the TemplateParser class, which acts as a wrapper around the lightncandy library. Support for client-side template parsing is pending for core, although you can currently utilize the Mantle extension for this purpose.

Creating templates
To utilize HTML templates in your code, first create a Mustache template file with a ".mustache" file extension, for example, "MyWidget.mustache". It is recommended that templates contain as little logic as possible so that they are easily readable and provide proper separation of concerns.