Project

biruda

0.0
No commit activity in last 3 years
No release in over 3 years
Simple DSL to build HTML documents
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.16
~> 9.1
~> 12.3
~> 3.7
~> 0.51
~> 0.15
 Project Readme

Biruda

Gem Version Dependency Status Build Status Maintainability Test Coverage

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 page

This 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

  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. Run rubocop lint (rubocop -R lib spec --format simple)
  5. Run rspec tests (bundle exec rspec)
  6. Push your branch (git push origin my-new-feature)
  7. Create a new Pull Request