A way to write html in code without using a template language
Create a simple page
public class SimpleView : IView
{
public void Render(TextWriter writer)
{
writer.Write("<!DOCTYPE html>");
var html =
Sgml.Tag("html").Add(
Sgml.Tag("head").Add(
Sgml.Tag("title").AddText("Test Page")
),
Sgml.Tag("body").Add(
Sgml.Tag("div").AddText("Hello World!!")
)
);
html.Write(writer);
}
}
Create a tag with attributes
var tag = Sgml.Tag("tag","attr1","value1","attr2","value2");
Create a fragment
var pil = Sgml.Pile().Add(...);
Create some html encoded text
var txt = Sgml.Text("Some Text");
Create some raw html text
var htm = Sgml.Html("<span>Some Html</span>");