BodyBuilder (Version 0.1.9)

Ruby XHTML 1.1 Generator

Author: Exiquio Cooper-Anderson (exiquio [at] gmail [dot] com) Copyright: © 2010 Exiquio Cooper-Anderson License: GPLv3 (www.gnu.org/licenses/gpl.html)

Requirements: Ruby 1.9.*

Installation: gem install BodyBuilder

Usage:

#!/usr/bin/env ruby

require ‘rubygems’ require ‘body_builder’

c = BodyBuilder::HeMan.new c.div ‘id=“main_content”’ c.p ”, ‘Hello, world!’ c.hr c.p ”, ‘Generated with BodyBuilder’ c.div_

puts BodyBuilder::Skeletor.new( { title: ‘Hello, world’, body: c, icon: {href: ‘/public/images/icon.png’, type: ‘media/png’ } ).render

}}}

Results:

<?xml version=“1.0” encoding=“UTF-8”?> <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN” “www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”> <html xmlns=“www.w3.org/1999/xhtml”> <head> <title>Hello, world</title> <link rel=“icon” type=“media/png” href=“/public/images/icon.png”></link> </head> <body> <div id=“main_content”> <p>Hello, world!</p> <hr></hr> <p>Generated with BodyBuilder</p> </div> </body> </html>

}}

Latest change: 2010-12-11 - Refactored, XHTML 1.1 implementation complete, brought in ExLib, version changed to 0.1.9, decided against HTML5 implementation

Todo 0.3.0: Improve performance Improve testing of dynamically created methods

NOTE: ‘document type does not allow element ’script’ here’ Validation causes the above error because scripts are loading at the end of the XHTML document for performance.

Any questions, conscerns or commments: exiquio [at] gmail [dot] com