root/trunk/lib/picolena/templates/lib/plain_text_extractors/opendocument.presentation.rb

Revision 178, 498 bytes (checked in by eric.dumin..@gmail.com, 6 months ago)

Filters have been renamed to PlainTextExtractors?.

Filter is a Rails protected name.

  • Property svn:executable set to *
Line 
1 # Open Document Presentation to text conversion
2
3 require 'zip/zip'
4 PlainTextExtractor.new {
5   every :odp
6   as 'application/vnd.oasis.opendocument.presentation'
7   aka "Open Document Format for presentation"
8   with {|source|
9     Zip::ZipFile.open(source){|zipfile|
10       zipfile.read("content.xml").split(/</).grep(/^text:(p|span)/).collect{|l|
11         l.sub(/^[^>]+>/,'')
12       }.join("\n")
13     }
14   }
15   which_should_for_example_extract 'Picolena can it find me maybe!', :from => 'ubuntu_theme.odp'
16 }
Note: See TracBrowser for help on using the browser.