Markupolation.Extensions (nuget): Markupolation = Markup + String Interpolation Extensions for HTML templating in C# with a fluent API: ⌨️ var links = new[] { new { Url = "#", Title = "Foo", Active = true }, new { Url = "#", Title = "Bar", Active = false } }; ⌨️ links.Each((x, index) => a(href(x.Url), id($"link{index}"), x.IfMatch(x => x.Active, x => class_("active")), x.Title)); 🖨️ <a href="#" id="link0" class="active">Foo</a><a href="#" id="link1">Bar</a>
Keywords: HTML|HTML5|Markup|csharp|dotnet|html|markup|string-interpolation