Module: Docxer
- Defined in:
- lib/docxer.rb,
lib/docxer/version.rb,
lib/docxer/document.rb,
lib/docxer/properties.rb,
lib/docxer/word/fonts.rb,
lib/docxer/word/medias.rb,
lib/docxer/word/styles.rb,
lib/docxer/word/themes.rb,
lib/docxer/word/effects.rb,
lib/docxer/word/footers.rb,
lib/docxer/word/headers.rb,
lib/docxer/word/helpers.rb,
lib/docxer/content_types.rb,
lib/docxer/relationships.rb,
lib/docxer/word/document.rb,
lib/docxer/word/endnotes.rb,
lib/docxer/word/settings.rb,
lib/docxer/properties/app.rb,
lib/docxer/word/footnotes.rb,
lib/docxer/word/numbering.rb,
lib/docxer/properties/core.rb,
lib/docxer/word/fonts/font.rb,
lib/docxer/word/medias/media.rb,
lib/docxer/word/themes/theme.rb,
lib/docxer/word/web_settings.rb,
lib/docxer/word/contents/text.rb,
lib/docxer/word/relationships.rb,
lib/docxer/word/contents/break.rb,
lib/docxer/word/contents/image.rb,
lib/docxer/word/contents/table.rb,
lib/docxer/word/footers/footer.rb,
lib/docxer/word/headers/header.rb,
lib/docxer/content_types/default.rb,
lib/docxer/content_types/override.rb,
lib/docxer/word/contents/paragraph.rb,
lib/docxer/relationships/relationship.rb,
lib/docxer/word/contents/table_of_content.rb,
lib/docxer/word/relationships/relationship.rb
Defined Under Namespace
Modules: Word
Classes: ContentTypes, Document, Properties, Relationships
Constant Summary
collapse
- VERSION =
"0.7.1"
Class Method Summary
collapse
Class Method Details
.test ⇒ Object
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/docxer.rb', line 16
def self.test
word = Docxer::Document.new
word.document.break
word.document.break
word.document.break
file = word.render
File.open('test.docx', 'wb') do |f|
f.write(file.string)
end
end
|
.to_xml(document) ⇒ Object
12
13
14
|
# File 'lib/docxer.rb', line 12
def self.to_xml(document)
document.to_xml(:save_with => Nokogiri::XML::Node::SaveOptions::AS_XML).gsub("\n", "\r\n").strip
end
|