Skip to content
/ biruda Public

Simple DSL to build HTML and Markdown documents

Notifications You must be signed in to change notification settings

alebian/biruda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Simple DSL to build HTML and Markdown documents

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages