mirror of
https://github.com/golang/go
synced 2024-11-18 13:04:46 -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:
parent
83f918d66b
commit
52d9c872e3
@ -97,6 +97,7 @@ type Section struct {
|
|||||||
Number []int
|
Number []int
|
||||||
Title string
|
Title string
|
||||||
Elem []Elem
|
Elem []Elem
|
||||||
|
Notes []string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s Section) Sections() (sections []Section) {
|
func (s Section) Sections() (sections []Section) {
|
||||||
@ -338,6 +339,8 @@ func parseSections(ctx *Context, name string, lines *Lines, number []int, doc *D
|
|||||||
}
|
}
|
||||||
lines.back()
|
lines.back()
|
||||||
e = List{Bullet: b}
|
e = List{Bullet: b}
|
||||||
|
case strings.HasPrefix(text, ": "):
|
||||||
|
section.Notes = append(section.Notes, text[2:])
|
||||||
case strings.HasPrefix(text, prefix+"* "):
|
case strings.HasPrefix(text, prefix+"* "):
|
||||||
lines.back()
|
lines.back()
|
||||||
subsecs, err := parseSections(ctx, name, lines, section.Number, doc)
|
subsecs, err := parseSections(ctx, name, lines, section.Number, doc)
|
||||||
|
Loading…
Reference in New Issue
Block a user