Skip to content
a small DSL for writing html
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test
LICENSE.md
README.md
Rakefile
html_writer.gemspec

README.md

html_writer

a small DSL for writing HTML

usage

HtmlWriter.new.write do |html|
  html.doctype 5
  html.head do |head|
    head.title 'foobar'
  end
  html.body do |body|
    body.p 'hello, world'
  end
end
<!DOCTYPE html>
<html>
<head>
  <title>foobar</title>
</head>
<body>
  <p>hello, world</p>
</body>
</html>

todo

  • support other doctypes besides html5
Something went wrong with that request. Please try again.