Module: Parchment::ODT

Defined in:
lib/parchment/formats/odt/odt.rb,
lib/parchment/formats/odt/style.rb,
lib/parchment/formats/odt/document.rb,
lib/parchment/formats/odt/text_run.rb,
lib/parchment/formats/odt/paragraph.rb

Overview

Parchment OpenOffice (.odt) format parser

Defined Under Namespace

Classes: Document, Paragraph, Style, TextRun

Class Method Summary collapse

Class Method Details

.read(path) ⇒ Object



10
11
12
13
14
15
# File 'lib/parchment/formats/odt/odt.rb', line 10

def self.read(path)
  zip = Zip::File.open(path)
  document_file = zip.read('content.xml')
  styles_file = zip.read('styles.xml')
  Parchment::ODT::Document.new(document_file, styles_file)
end