From 52d9c872e340cad8da00dbde80f6c90cd3ee1f66 Mon Sep 17 00:00:00 2001 From: Audrey Lim Date: Sun, 3 Apr 2016 16:27:25 -0700 Subject: [PATCH] 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 --- present/parse.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/present/parse.go b/present/parse.go index 034a83cb30..39d44f356b 100644 --- a/present/parse.go +++ b/present/parse.go @@ -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)