code: func initTour(root, transport string) error {
  	// Make sure playground is enabled before rendering.
  	present.PlayEnabled = true
  
  	// Set up templates.
  	action := filepath.Join(root, "template", "action.tmpl")
  	tmpl, err := present.Template().ParseFiles(action)
  	if err != nil {
  		return fmt.Errorf("parse templates: %v", err)
  	}
  
  	// Init lessons.
  	contentPath := filepath.Join(root, "content")
  	if err := initLessons(tmpl, contentPath); err != nil {
  		return fmt.Errorf("init lessons: %v", err)
  	}
  
  	// Init UI
  	index := filepath.Join(root, "template", "index.tmpl")
  	ui, err := template.ParseFiles(index)
  	if err != nil {
  		return fmt.Errorf("parse index.tmpl: %v", err)
  	}
  	buf := new(bytes.Buffer)
  
  	data := struct {
  		SocketAddr string
  		Transport  template.JS
  	}{socketAddr(), template.JS(transport)}
  
  	if err := ui.Execute(buf, data); err != nil {
  		return fmt.Errorf("render UI: %v", err)
  	}
  	uiContent = buf.Bytes()
  
  	return initScript(root)
  }
docs: // initTour loads tour.article and the relevant HTML templates from the given
  // tour root, and renders the template to the tourContent global variable.