Class: Doc2Text::Docx::Document
Class Method Summary
collapse
Instance Method Summary
collapse
#clean, #extract_path, #initialize, #open, #unpack
Class Method Details
.parse_and_save(input, output_filename) ⇒ Object
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/doc2text/docx/docx.rb', line 5
def self.parse_and_save(input, output_filename)
docx = new input
begin
docx.unpack
styles_xml_root = docx.parse_styles
output = File.open output_filename, 'w'
markdown = Markdown::DocxParser.new output, styles_xml_root
begin
docx.parse markdown
ensure
markdown.close
end
ensure
docx.clean
end
end
|
Instance Method Details
22
23
24
|
# File 'lib/doc2text/docx/docx.rb', line 22
def
File.exist? File.join(, '[Content_Types].xml')
end
|
26
27
28
|
# File 'lib/doc2text/docx/docx.rb', line 26
def
'unpacked_docx'
end
|