1using GLib; 2using Template; 3 4static int main (string[] argv) 5{ 6 var file = GLib.File.new_for_path("simple.tmpl"); 7 var tmpl = new Template.Template (null); 8 9 try { 10 tmpl.parse_file (file, null); 11 12 var scope = new Template.Scope (); 13 14 var title = scope.get ("title"); 15 title.assign_string ("Example Title"); 16 17 var expanded = tmpl.expand_string (scope); 18 stdout.printf ("%s\n", expanded); 19 } catch (GLib.Error ex) { 20 stderr.printf ("%s\n", ex.message); 21 return 1; 22 } 23 24 return 0; 25} 26