Project

rhb

0.0
No commit activity in last 3 years
No release in over 3 years
Builds html from ruby code
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
= 3.0.0.beta2
 Project Readme

Rhb (Ruby HTML builder) Gem Version Build Status Code Climate

Lightweight html from ruby code builder. Inspired by Mab.

Installation

Add to Gemfile:

gem 'rhb'

Usage

Example:

builder = Rhb::Builder.new

builder.doctype
builder.html do
  head do
    title 'Awesome page'
    link rel: 'stylesheet', href: 'style.css'
  end
  body id: :body do
    h1 'My Awesome Page', class: 'awesome', data: { awesomeness: { level: 'high' } }
    end
  end
end

builder.to_html

Result:

<!DOCTYPE html><html><head><title>Awesome page</title><link rel="stylesheet" href="style.css"></head><body id="body"><h1 class="awesome" data-awesomeness-level="high">My Awesome Page</h1></body></html>

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request