Fast and extensible HTML5 builder in pure Ruby
Htmless::Formatted.new.go_in do
html5
html do
head { title 'my_page' }
body do
div.content! do
p.centered "my page's content"
end
end
end
end.to_html
returns
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>my_page</title>
</head>
<body>
<div id="content">
<p class="centered">my page's content</p>
</div>
</body>
</html>