dapper-dan

Stable Version: 0.4.0 (Inferno Anger)

dapper-dan is a block-style domain specific language for generating HTML documents. The DSL is used very similarly to any Ruby DSL, where blocks of logic determine the output. In 'dapper-dan's case the idea is that 'dapper-dan' methods are given blocks, which represent children nodes. Using 'dapper-dan' means not having to learn a 3rd abstraction layer, and still getting features like validation.

Examples

Dapper Dan is really easy to use, I've made sure of it. The easiest way to use Dapper Dan is to write a Ruby file! Here, I'll show you:

# A really small web page in Dapper Dan
require 'dapper-dan'
include DapperDan

html do
  para do
    "I love programming!"
  end

  para do
    strong "I really love using Ruby!"
  end

  para do
    "But I #{strong 'really'} like making web applications."
  end
end

Installing

Requirements

  1. Ruby 1.8.7, Ruby 1.9.2, Rubinius 2.0.0, JRuby
  2. RubyGems 1.6.7 or better
  3. [Optional] Rails 3.0 or better

Installing this fun gem is as simple as installing any other gem:

gem install dapper-dan

or adding it to your Gemfile:

gem "dapper-dan", "0.4.0"

Testing

To make sure you did everything right, just do the following:

$ gem list | grep dapper
> dapper-dan (0.4.0)

Issues & Documentation

To read more about Dapper Dan feel free to visit the Wiki, and contribute if you can! Having a problem with Dapper Dan? Think something should be added? Make an Issue and tell us.

Changelog

v0.4.0 (Inferno Anger)

v0.3.0 (Inferno Greed)

v0.2.0 (Inferno Gluttony)

Contributing

Credits

License

Copyright (c) 2011 Kurtis Rainbolt-Greene

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.