class Parchment::DOCX::Document

Private Instance Methods

set_default_paragraph_style() click to toggle source
# File lib/parchment/formats/docx/document.rb, line 24
def set_default_paragraph_style
  doc_style_node = @styles_xml.xpath('.//w:docDefaults').first
  @default_paragraph_style = Parchment::DOCX::Style.new_default_style(doc_style_node)
end
set_paragraphs() click to toggle source

These methods parse and add the Document’s children and defaults.

# File lib/parchment/formats/docx/document.rb, line 13
def set_paragraphs
  set_default_paragraph_style
  paragraph_nodes = @content_xml.xpath('.//w:document//w:body//w:p')
  @paragraphs = paragraph_nodes.map { |node| Parchment::DOCX::Paragraph.new(node, self) }
end
set_styles() click to toggle source
# File lib/parchment/formats/docx/document.rb, line 19
def set_styles
  style_nodes = @styles_xml.xpath('.//w:style')
  @styles = style_nodes.map { |node| Parchment::DOCX::Style.new_from_node(node) }
end