Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
t = File.read("x")[/------$\n(.*)--$/m, 1] i = {} t.split(/\n\n+/).each { |entry| a, *ms = entry.split(/\s{2,}|\t/) ms.each { |m| (i[m] ||= []) << a } } i.keys.sort.each { |m| puts m i[m].each { |a| puts "\t#{a}" } }
This paste will be private.
From the Design Piracy series on my blog: