NAME xx SYNOPSIS xhtml and xml generation => twice as dirty! USAGE require "xx" include XX::XHTML doc = xhtml_{ html_{ head_{ title_{ " go xx! " } } body_{ " one more and it would be illegal " } } } puts doc INSTALL harp:~ > gem install "double x" URIS http://rubyforge.org/projects/codeforpeople/ hhtp://codeforpeople.com/xx/ DESCRIPTION xx is a library designed to extend ruby objects with html, xhtml, and xml generation methods. the syntax provided by xx aims to make the generation of xml or xhtml as clean looking and natural as ruby itself, while still being entirely robust and safe. the approach taken, that of extending objects, allows natural document generation while preserving access to instance data. in essence it provides ruby objects (including the top level 'main' object) mixin ability to generate various markup views of their data in a way that is correct and elegant. xx is brought to you by the good folks at http://eparklabs.com. SAMPLES <========< samples/a.rb >========> ~ > cat samples/a.rb require "xx" include XX::XHTML # # xx modules extend any object with natural document markup methods. the # special 'tag_name_(attributes){ block }' is a bit odd first but, as you will # see, has many important properties # puts xhtml_{ html_{ head_{ title_{ " go xx! " } } body_{ " one more 'x' and it would be illegal " } } } ~ > ruby samples/a.rb
a | b | c |
1 | 2 | 3 |