Module: Parchment::DOCX

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

Overview

Parchment OfficeOpen (.docx) 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/docx/docx.rb', line 10

def self.read(path)
  zip = Zip::File.open(path)
  document_file = zip.read('word/document.xml')
  styles_file = zip.read('word/styles.xml')
  Parchment::DOCX::Document.new(document_file, styles_file)
end