correction yaml creation - extraction yaml + html preparation
This commit is contained in:
@@ -14,21 +14,21 @@ func SaveChapter(cfg config.Cfg, chapter *config.Chapter) (error){
|
||||
var chapterYaml models.Yaml
|
||||
|
||||
for i, verse:= range chapter.Verses{
|
||||
strophe := models.Strophe{}
|
||||
parts := SplitInPart(verse, cfg.ProperName)
|
||||
for _, part := range parts{
|
||||
line := models.Line{
|
||||
Verse: i+1,
|
||||
Text: part,
|
||||
poeticLine := models.PoeticLine{
|
||||
Who: "",
|
||||
To: "",
|
||||
Of: "",
|
||||
}
|
||||
}
|
||||
cola := SplitInPart(verse, cfg.ProperName)
|
||||
for _, colon := range cola{
|
||||
|
||||
strophe.Lines = append(strophe.Lines, line)
|
||||
poeticLine.Cola = append(poeticLine.Cola, models.Colon{
|
||||
Verse: i+1,
|
||||
Text: colon,
|
||||
})
|
||||
}
|
||||
chapterYaml.Strophes = append(chapterYaml.Strophes, strophe)
|
||||
log.Printf("%v", parts)
|
||||
chapterYaml.PoeticLines = append(chapterYaml.PoeticLines, poeticLine)
|
||||
|
||||
}
|
||||
|
||||
yamlData, err := yaml.Marshal(chapterYaml)
|
||||
|
||||
Reference in New Issue
Block a user