A small application to manage Lilypond music repositories

Adds Choice of categories for the book command

+6 -1
+5 -1
compiler/book.go
··· 37 37 38 38 templ, err := parseBookTemplate(opts) 39 39 40 + if len(opts.DefaultCategories) == 0 { 41 + opts.DefaultCategories = scoreCategories(&scores) 42 + } 43 + 40 44 texPath := filepath.Join(opts.OutputDir, opts.Name+".tex") 41 45 log.WithFields(log.Fields{ 42 46 "path": texPath, ··· 50 54 }{ 51 55 Scores: &scores, 52 56 Settings: opts, 53 - Categories: scoreCategories(&scores), 57 + Categories: opts.DefaultCategories, 54 58 }) 55 59 helpers.Check(err, "error executing book template") 56 60 f.Close()
+1
settings/settings.go
··· 39 39 LatexResources []string // Files to be copied to compile the book template 40 40 KeepBookTemplate bool // Leave the LaTeX source for the book in the output directory 41 41 FlatOutputDir bool // Keep all output file in a flat output directory 42 + DefaultCategories []string // Categories included in the book by default 42 43 } 43 44 44 45 // FromFile reads a settings file in json format and returns the Settings struct