Some files in a theme are simply copied in the destination folder, while others are used as templates to generate the destination file. Normally, the .html, .css, and .js files are used as templates.
The template engine used is Velocity. You can read the Velocity User Guide here, and the language reference here. Some useful tools are included in Gianadda:
The following Gianadda objects are accessible from within a template:
To see examples of templates, you can have a look a the source files for the default theme, most notably folder/index.html.