Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
This paste will be private.
def slideshow puts SLIDESHOW_START yield puts SLIDESHOW_END end def slide title puts " <div class='slide'>" puts " <h1>#{ title }</h1>" puts " <ul>" yield puts " </ul>" puts " </div>" end def item text puts " <li>#{ text.htmlspecialchars }</li>" end SLIDESHOW_START = <<END <html> <head>...</head> <body> <div class='presentation'> END SLIDESHOW_END = <<END </div> </body> </html> END class String def htmlspecialchars gsub('&', '&').gsub('<', '<').gsub('>', '>') end end slideshow { slide ("first slide") { item "a point" item "another point" } slide ("second slide") { item "an interesting point" item "an uninteresting point" } }
From the Design Piracy series on my blog: