1
0
mirror of https://github.com/golang/go synced 2024-11-18 10:04:43 -07:00

x/tools/present: parse presenter notes and record them in Section struct

This is the first of a series of changes that add support for
speaker notes to the Go present tool. This is done by displaying
slides with speaker notes on a second window, and synchronizing
both windows.

Updates golang/go#14654

Change-Id: Ic7b158d1e40f9e7e58d01791c88909f5619ce87f
Reviewed-on: https://go-review.googlesource.com/21485
Reviewed-by: Andrew Gerrand <adg@golang.org>
This commit is contained in:
Audrey Lim 2016-04-03 16:27:25 -07:00 committed by Andrew Gerrand
parent 83f918d66b
commit 52d9c872e3

View File

@ -97,6 +97,7 @@ type Section struct {
Number []int
Title string
Elem []Elem
Notes []string
}
func (s Section) Sections() (sections []Section) {
@ -338,6 +339,8 @@ func parseSections(ctx *Context, name string, lines *Lines, number []int, doc *D
}
lines.back()
e = List{Bullet: b}
case strings.HasPrefix(text, ": "):
section.Notes = append(section.Notes, text[2:])
case strings.HasPrefix(text, prefix+"* "):
lines.back()
subsecs, err := parseSections(ctx, name, lines, section.Number, doc)