This document discusses Lorem Whitman, a tool that generates placeholder text by remixing lines from Walt Whitman poems. It provides lorem-whitman gems and a lorem-whitman-website that serves text via a web page and JSON API. The website is built with a Sinatra API served through a Middleman app for pages, and is hosted on Heroku. It uses various gems and CSS techniques like responsive images and viewport units.
2. Lorem Whitman
Generates placeholder text by remixing
lines from Walt Whitman poems
lorem-whitman gem
generates the text
lorem-whitman-website
serves text via web page
serves text via JSON API
Wednesday, June 26, 13
3. Mysteries
APIs served through a middleman
JSON for all men ever born
Images fill wide expanses
Elements rest upon my whiskers
Wednesday, June 26, 13
4. Sinatra through
Middleman
Sinatra app embedded
in a middleman app
Sinatra serves a JSON API
Middleman serves pages
Hosted on Heroku
Wednesday, June 26, 13
5. Cross-origin JSON
Used rack-cors gem
# Enable cross-origin access to the api
use Rack::Cors do
allow do
origins '*'
resource '/api/*', :headers => :any, :methods => :get
end
end
Wednesday, June 26, 13
6. automagic image size
Image fits the width of the window
background-size: 100% auto;
Wednesday, June 26, 13
7. align: mustache
Vertical position of the page is relative
to the width of the window
vw, vh, vm
CSS units relative to width
and height of the viewport
not to be confused with rem
Relative to font-size
of the the html element
Wednesday, June 26, 13