first post
hello world
A little DSL that let you wirte html code in ruby not just insert them into a template .
https://github.com/v2e4lisp/rhtml
Last synced: 9 days ago
JSON representation
A little DSL that let you wirte html code in ruby not just insert them into a template .
# Rhtml
A DSL to write html in pure ruby.
**write test tomorrow**
## Installation
Add this line to your application's Gemfile:
gem 'rhtml'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rhtml
## Usage
```ruby
Rhtml.html! {
body {
div(class: "post", id: 1) {
title "first post"
br
p "hello world"
div(class: "comment") {
(1..5).each do |id|
p(class: "grey") {
"comment #{id}"
}
end
}
}
}
}
```
** converted to html **
```html
first post
hello world
```
## 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
comment 1
comment 2
comment 3
comment 4
comment 5