2 # Uses Text::Format to take the text and format it, indented two spaces for
3 # each line, and wrapped at 72 columns.
5 formatted
= text
.split(/\n\r\n/).collect
{ |paragraph
|
7 :columns => 72, :first_indent => 2, :body_indent => 2, :text => paragraph
11 # Make list points stand on their own line
12 formatted
.gsub
!(/[ ]*([*]+) ([^*]*)/) { |s
| " #{$1} #{$2.strip}\n" }
13 formatted
.gsub
!(/[ ]*([#]+) ([^#]*)/) { |s
| " #{$1} #{$2.strip}\n" }