🕷 software projects

by ryan davis



sitemap

box_layout

HTML tables using ASCII art

Allows you to lay out HTML using ASCII art. Stolen from psykotic’s code posted to reddit: http://programming.reddit.com/info/k9dx/comments

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require 'box_layout'

page_template = <<-END
----------
|        |
----------
| |    | |
| |    | |
| |    | |
| |    | |
----------
|        |
----------
END

layout = BoxLayout.html page_template
puts "<title>cute</title>"
puts "<style>* { border: 1px solid black }</style>"
puts layout % %w[header left body right footer].map {|s| "**#{s}**" }

Get The Code

If you just want to use box_layout, you can install it via RubyGems:
gem install box_layout
Fork me on GitHub If you want to hack on box_layout, clone it from GitHub:
git clone git://github.com/seattlerb/box_layout

Latest Activity