public string ToMarkdown() { var sb = new StringBuilder(); sb.Append(this.GenerateHeader()); sb.AppendLine(); sb.AppendLine("## Grain"); sb.AppendLine(); if (Grains.Any()) { sb.AppendLine("| Name | Amount %|"); sb.AppendLine("| ---- | ------: |"); foreach (var grain in Grains) { sb.AppendLine(grain.ToMarkdown()); } sb.AppendLine(); } if (Hops.Any()) { sb.AppendLine("## Hops"); sb.AppendLine(); sb.AppendLine("| Name | Amount | Time |"); sb.AppendLine("| ---- | -----: | ---: |"); foreach (var hop in Hops) { sb.AppendLine(hop.ToMarkdown()); } sb.AppendLine(); } sb.AppendLine("## Yeast"); sb.AppendLine(Yeast); sb.AppendLine(); sb.AppendLine("## Notes"); sb.AppendLine(Notes); return(sb.ToString()); }