Allows uncategorized scores to be hidden from the book
This commit is contained in:
parent
19a4a2b85b
commit
d2a4a6b9f4
@ -55,14 +55,13 @@ var bookTempl = `
|
|||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{ if unknown .Scores }} \chapter{Others} \newpage {{end}}
|
{{if not .Settings.HideUncategorized }}{{ if unknown .Scores }} \chapter{Others} \newpage {{end}}
|
||||||
{{range .Scores}}
|
{{range .Scores}}
|
||||||
{{ if eq (len .Categories) 0 }}
|
{{ if eq (len .Categories) 0 }}
|
||||||
\phantomsection
|
\phantomsection
|
||||||
\addcontentsline{toc}{section}{{printf "{"}}{{ .Name }}{{printf "}"}}
|
\addcontentsline{toc}{section}{{printf "{"}}{{ .Name }}{{printf "}"}}
|
||||||
\includepdf[pages=-]{{printf "{"}}{{.OutputPath}}{{printf "}"}}
|
\includepdf[pages=-]{{printf "{"}}{{.OutputPath}}{{printf "}"}}
|
||||||
{{end}}
|
{{end}}{{end}}{{end}}
|
||||||
{{end}}
|
|
||||||
\end{document}
|
\end{document}
|
||||||
`
|
`
|
||||||
|
|
||||||
|
@ -25,11 +25,12 @@ import (
|
|||||||
// Settings provides a structure to interact with the settings
|
// Settings provides a structure to interact with the settings
|
||||||
// of a Ponder library
|
// of a Ponder library
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
Name string // Name of the Ponder library
|
Name string // Name of the Ponder library
|
||||||
Author string // Author of the Ponder library
|
Author string // Author of the Ponder library
|
||||||
IgnoreDirs []string // Directories to be ignored on search
|
IgnoreDirs []string // Directories to be ignored on search
|
||||||
LilypondIncludes []string // Directories to be included when running the lilypond compiler
|
LilypondIncludes []string // Directories to be included when running the lilypond compiler
|
||||||
OutputDir string // Directory in which all complete file are stored
|
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
|
// FromFile reads a settings file in json format and returns the Settings struct
|
||||||
|
Reference in New Issue
Block a user