code: func (ui *webInterface) render(w http.ResponseWriter, tmpl string,
  	rpt *report.Report, errList, legend []string, data webArgs) {
  	file := getFromLegend(legend, "File: ", "unknown")
  	profile := getFromLegend(legend, "Type: ", "unknown")
  	data.Title = file + " " + profile
  	data.Errors = errList
  	data.Total = rpt.Total()
  	data.SampleTypes = sampleTypes(ui.prof)
  	data.Legend = legend
  	data.Help = ui.help
  	html := &bytes.Buffer{}
  	if err := ui.templates.ExecuteTemplate(html, tmpl, data); err != nil {
  		http.Error(w, "internal template error", http.StatusInternalServerError)
  		ui.options.UI.PrintErr(err)
  		return
  	}
  	w.Header().Set("Content-Type", "text/html")
  	w.Write(html.Bytes())
  }
docs: // render generates html using the named template based on the contents of data.