Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

a small DSL for writing html

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 LICENSE.md
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 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.