Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
HTMr is a way of writing html (and a bit of javascript) in ruby
Ruby
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
script
.gitignore
Gemfile
README.md
Rakefile
htmr.gemspec

README.md

HTMr

HTMr is a way of writing html (and a bit of javascript) in ruby

Example

app = HTMr::Application.new "My Website!" do
  header do
    h1 "Welcome to my website!"
    h2 "The best site in the world!"
  end
  section do
    p "Look I'm Blue!", :style => "color: blue;"
    button "Click Me!"
  end
end
puts app.render

Outputs:

<html>
  <head>
    <title>
      My Website!
    </title>
  </head>
  <body>
    <header>
      <h1>
        Welcome to my website!
      </h1>
      <h2>
        The best site in the world!
      </h2>
    </header>
    <section>
      <p style="color: blue;">
        Look I'm Blue!
      </p>
      <button>
        Click Me!
      </button>
    </section>
  </body>
</html>
Something went wrong with that request. Please try again.