Class: Doc2Text::Odt::XmlNodes::Text::H

Inherits:
Node show all
Includes:
Doc2Text::Odt::XmlNodes::Text
Defined in:
lib/doc2text/odt/odt_xml_namespaces.rb

Overview

Instance Attribute Summary

Attributes inherited from XmlBasedDocument::XmlNodes::Node

#attrs, #children, #name, #parent, #prefix, #text

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Doc2Text::Odt::XmlNodes::Text

#fetch_style, #fetch_style?, #find_style

Methods inherited from Node

create_node, #office_text?

Methods inherited from XmlBasedDocument::XmlNodes::Node

#delete, #eql?, #expand, #generic?, #has_text?, inherited, #root?, #to_s, #xml_name

Constructor Details

#initialize(parent = nil, attrs = [], prefix = nil, name = nil, markdown_odt_parser = nil) ⇒ H

Returns a new instance of H.



128
129
130
131
132
133
134
135
136
137
# File 'lib/doc2text/odt/odt_xml_namespaces.rb', line 128

def initialize(parent = nil, attrs = [], prefix = nil, name = nil, markdown_odt_parser = nil)
  super parent, attrs, prefix, name, markdown_odt_parser
  outline_level_index = attrs.index { |attr| attr.prefix == 'text' && attr.localname == 'outline-level' }
  if outline_level_index and fetch_style?
    @elem_outline_level = attrs[outline_level_index].value.to_i
  else
    @elem_outline_level = 0
  end

end

Class Method Details

.style_familyObject



139
140
141
# File 'lib/doc2text/odt/odt_xml_namespaces.rb', line 139

def self.style_family
  'paragraph'
end

Instance Method Details

#closeObject



147
148
149
# File 'lib/doc2text/odt/odt_xml_namespaces.rb', line 147

def close
  "\n\n"
end

#openObject



143
144
145
# File 'lib/doc2text/odt/odt_xml_namespaces.rb', line 143

def open
  "\n#{'#' * @elem_outline_level} "
end