diff --git a/internal/gig/gig_test.go b/internal/gig/gig_test.go index f57e9ea..ca64c98 100644 --- a/internal/gig/gig_test.go +++ b/internal/gig/gig_test.go @@ -26,7 +26,11 @@ func TestNew(t *testing.T) { Name: "MyBand @ Grand Ole Opry", Sections: []Section{ { - Header: []byte("# Set 1\n\nSay Hello"), + Header: []byte{}, + SongTitles: []string{"Preamble"}, + }, + { + Header: []byte("\n\n# Set 1\n\nSay Hello"), SongTitles: []string{"Frankie and Johnnie", "On the Alamo", "Her Song"}, }, { diff --git a/internal/repertoire/repertoire_test.go b/internal/repertoire/repertoire_test.go index 8027fcf..32b7102 100644 --- a/internal/repertoire/repertoire_test.go +++ b/internal/repertoire/repertoire_test.go @@ -28,6 +28,7 @@ func TestNew(t *testing.T) { {Title: "On the Alamo"}, {Title: "Frankie and Johnnie"}, {Title: "Nowhere to go"}, + {Title: "Preamble"}, {Title: "Her Song"}, }, }, diff --git a/internal/sheet/sheet.go b/internal/sheet/sheet.go index 780ed9f..4dec7bd 100644 --- a/internal/sheet/sheet.go +++ b/internal/sheet/sheet.go @@ -113,13 +113,15 @@ func ForGig(band config.Band, gig gig.Gig) error { sh := sectionHeaders{} for _, section := range gig.Sections { h := section.HeaderText() - sh.add(h) - html, err := section.HeaderHTML() - if err != nil { - return err + if h != "" { + sh.add(h) + html, err := section.HeaderHTML() + if err != nil { + return err + } + header := Sheet{band: band, name: sh.filename(h), content: html} + sheets = append(sheets, header) } - header := Sheet{band: band, name: sh.filename(h), content: html} - sheets = append(sheets, header) for _, title := range section.SongTitles { song := Sheet{band: band, name: title, content: title} sheets = append(sheets, song) diff --git a/test/Repertoire/Band/Gigs/Grand Ole Opry.md b/test/Repertoire/Band/Gigs/Grand Ole Opry.md index b74a59f..d28792e 100644 --- a/test/Repertoire/Band/Gigs/Grand Ole Opry.md +++ b/test/Repertoire/Band/Gigs/Grand Ole Opry.md @@ -1,3 +1,5 @@ +* Preamble + # Set 1 Say Hello @@ -7,4 +9,5 @@ Say Hello * Her Song # Encore + * Nowhere To Go diff --git a/test/Repertoire/Band/Repertoire.md b/test/Repertoire/Band/Repertoire.md index 45fd17e..8cb1a16 100644 --- a/test/Repertoire/Band/Repertoire.md +++ b/test/Repertoire/Band/Repertoire.md @@ -4,5 +4,5 @@ | On the Alamo | 1922 | Lyrics: Gus Kahn | Isham Jones | Chris Lae | 3m 2s | | Frankie and Johnnie | 1904 | | Hughie Cannon | Chris Lae | 2m 30s | | Nowhere to go | 2024 | Instrumental | Chris Lae | Chris Lae | 7m | -| [[Her Song]] | 2024 | | Unknown | Chris Lae | 55s | - +| Preamble | 2024 | Get started | Chris Lae | Chris Lae | 1m | +| [[Her Song]] | 2024 | | Unknown | Chris Lae | 55s |