in src/TemplateRefGenerator/Generators/MarkdownGenerator.cs [378:401]
private static string GenerateOptionalSection(string heading, string?[] sections)
{
var sb = new StringBuilder();
if (!sections.Any(x => x is {}))
{
return "";
}
sb.Append($"""
## {heading}
""");
foreach (var section in sections)
{
if (section is {})
{
sb.Append(section);
}
}
return sb.ToString();
}