""");
for (var index = 0; index < snippets.Count; index++)
{
string classList = "";
if (index == 0)
{
classList = " show active";
}
var snippet = snippets[index];
string html = RenderHtml(snippet);
builder.AppendLine($"""
""");
builder.AppendLine(html);
builder.AppendLine("
");
}
builder.AppendLine("
");
return builder.ToString();
}
private string RenderHtml(ICodeSnippet snippet)
{
return Markdig.Markdown.ToHtml($"```{snippet.Language}\n{snippet.Content}\n```", _markdownPipeline.Value);
}
private static string DefaultRender(TemplateInline template)
{
return template.ArgumentList.Count == 0
? $"{{{{{template.Name}}}}}"
: $"{{{{{template.Name}|{string.Join('|', template.ArgumentList)}}}}}";
}
}