code: func parseLesson(tmpl *template.Template, path string) ([]byte, error) {
  	f, err := os.Open(path)
  	if err != nil {
  		return nil, err
  	}
  	defer f.Close()
  	doc, err := present.Parse(prepContent(f), path, 0)
  	if err != nil {
  		return nil, err
  	}
  
  	lesson := Lesson{
  		doc.Title,
  		doc.Subtitle,
  		make([]Page, len(doc.Sections)),
  	}
  
  	for i, sec := range doc.Sections {
  		p := &lesson.Pages[i]
  		w := new(bytes.Buffer)
  		if err := sec.Render(w, tmpl); err != nil {
  			return nil, fmt.Errorf("render section: %v", err)
  		}
  		p.Title = sec.Title
  		p.Content = w.String()
  		codes := findPlayCode(sec)
  		p.Files = make([]File, len(codes))
  		for i, c := range codes {
  			f := &p.Files[i]
  			f.Name = c.FileName
  			f.Content = string(c.Raw)
  			hash := sha1.Sum(c.Raw)
  			f.Hash = base64.StdEncoding.EncodeToString(hash[:])
  		}
  	}
  
  	w := new(bytes.Buffer)
  	if err := json.NewEncoder(w).Encode(lesson); err != nil {
  		return nil, fmt.Errorf("encode lesson: %v", err)
  	}
  	return w.Bytes(), nil
  }
docs: // parseLesson parses and returns a lesson content given its name and
  // the template to render it.