Example #1
0
func main () {
	html_t, err := gaml.GamlToHtml(gaml_template_1)
	if err != nil {
		fmt.Printf("error: %s", err.Error())
	}
	template,err := template.New("test_template").Parse(html_t)
	template.Execute(os.Stdout, "Hello World!")

	html_t, err = gaml.GamlToHtml(gaml_template_2)
	if err != nil {
		fmt.Printf("error: %s", err.Error())
	}
	template,err = template.New("test_template2").Parse(html_t)
	if err != nil {
		fmt.Printf("error: %s", err.Error())
	}
	template.Execute(os.Stdout, People)


	html_t, err = gaml.GamlToHtml(gaml_template_3)
	if err != nil {
		fmt.Printf("error: %s", err.Error())
	}
	template,err = template.New("test_template3").Parse(html_t)
	if err != nil {
		fmt.Printf("error: %s", err.Error())
	}
	template.Execute(os.Stdout, People)

}
Example #2
0
func main() {
	line := `
%html
	%head
		%body
			%h1
				Hello World`

	html, _ := gaml.GamlToHtml(line)
	println(html)
}