Skip to content

Commit

Permalink
Header format
Browse files Browse the repository at this point in the history
  • Loading branch information
xiety committed Apr 13, 2024
1 parent ec8446e commit 453dd02
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion AnkiPoetry.Engine/Chunker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ private static IEnumerable<TItem[]> ChunksWithOverlap<TItem>(IEnumerable<TItem>
}

private static string CreateHeader(MySection section, MySong song, int screenNumber)
=> $"{section.SectionName}, {song.SongName} ({screenNumber})";
{
string[] elements = [section.SectionName, song.SongName];
var title = String.Join(", ", elements.Where(a => !String.IsNullOrEmpty(a)));
return $"{title} ({screenNumber})";
}
}

public record Chunk(int MaxSongNumber, string Header, int SectionNumber, int SongNumber, MyLine[] Lines);

0 comments on commit 453dd02

Please sign in to comment.