🕷 zenspider.com

by ryan davis



sitemap
Looking for the Ruby Quickref?

CSS for layout? bah! Use ASCII art!

Published 2006-09-29 @ 17:39

Tagged toys, rails, ruby

I stole the code posted on reddit earlier today and ported it to ruby. Now I can do the following:

  layout = BoxLayout.html <<-END
  ----------
  |        |
  ----------
  | |    | |
  | |    | |
  | |    | |
  | |    | |
  ----------
  |        |
  ----------
  END
  
  puts layout % [header, left_sidebar,
                 body,
                 right_sidebar, footer]

and get layout code that looks much much cleaner than the equivalent HTML/rhtml/whatever. I can instantly look at this code and know what it is gonna look like in a browser. I’ll release this soon, but I have some enhancements for codeforpeople’s rubyforge and seattle.rb’s hoe first.