Biruda
Biruda is a simple DSL to build HTML documents.
Installation
Add this line to your application's Gemfile:
gem 'biruda'And then execute:
$ bundle
Or install it yourself as:
$ gem install biruda
Usage
page = Biruda.create_html do
head do
title 'This is a Biruda HTML DSL test'
script src: 'mypage.com/mysuper.js'
end
body do
h1 'HEADING', class: 'title'
p [
'This is part of my ',
-> { b 'paragraph' },
', amazing.'
]
end
end
puts pageThis will print:
<!DOCTYPE html>
<html>
<head>
<title>This is a Biruda HTML DSL test</title>
<script src="mypage.com/mysuper.js" />
</head>
<body>
<h1 class="title">HEADING</h1>
<p>
This is part of my <b>paragraph</b>, amazing.
</p>
</body>
</html>'
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Run rubocop lint (
rubocop -R lib spec --format simple) - Run rspec tests (
bundle exec rspec) - Push your branch (
git push origin my-new-feature) - Create a new Pull Request