Archived
1
0

Allows uncategorized scores to be hidden from the book

This commit is contained in:
Jip J. Dekker 2016-04-14 17:47:46 +02:00
parent 19a4a2b85b
commit d2a4a6b9f4
2 changed files with 8 additions and 8 deletions

View File

@ -55,14 +55,13 @@ var bookTempl = `
{{end}}
{{end}}
{{ if unknown .Scores }} \chapter{Others} \newpage {{end}}
{{if not .Settings.HideUncategorized }}{{ if unknown .Scores }} \chapter{Others} \newpage {{end}}
{{range .Scores}}
{{ if eq (len .Categories) 0 }}
\phantomsection
\addcontentsline{toc}{section}{{printf "{"}}{{ .Name }}{{printf "}"}}
\includepdf[pages=-]{{printf "{"}}{{.OutputPath}}{{printf "}"}}
{{end}}
{{end}}
{{end}}{{end}}{{end}}
\end{document}
`

View File

@ -30,6 +30,7 @@ type Settings struct {
IgnoreDirs []string // Directories to be ignored on search
LilypondIncludes []string // Directories to be included when running the lilypond compiler
OutputDir string // Directory in which all complete file are stored
HideUncategorized bool // Hide scores without a category from the book
}
// FromFile reads a settings file in json format and returns the Settings struct