Class: SiSU_XML_ODF_ODT_Format::ParagraphNumber

Inherits:
Object
  • Object
show all
Defined in:
lib/sisu/xml_odf_odt_format.rb

Instance Method Summary collapse

Constructor Details

#initialize(make, paranum) ⇒ ParagraphNumber

Returns a new instance of ParagraphNumber.



61
62
63
64
# File 'lib/sisu/xml_odf_odt_format.rb', line 61

def initialize(make,paranum)
  @make=make
  @paranum=/(\d+)/m.match(paranum.to_s)[1]
end

Instance Method Details

#gotoObject



86
87
88
# File 'lib/sisu/xml_odf_odt_format.rb', line 86

def goto
  @paranum.gsub(/(\d+)/,'<a href="#\1">')
end

#nameObject



83
84
85
# File 'lib/sisu/xml_odf_odt_format.rb', line 83

def name
  @paranum.gsub(/(\d+)/,'<a name="\1"></a>')
end

#set_bookmark_and_displayObject



74
75
76
77
78
79
80
81
82
# File 'lib/sisu/xml_odf_odt_format.rb', line 74

def set_bookmark_and_display
  set_ref=@paranum.gsub(/(\d+)/,
    ' <text:span text:style-name="Span_subscript"><text:bookmark-start text:name="\1"/><text:bookmark-end text:name="\1"/></text:span>')
  disp=@paranum.gsub(/(\d+)/,
    (@make.build.odt_ocn?) \
    ? %{ <text:span text:style-name="Span_subscript">#{Dx[:ocn_o]}\\1#{Dx[:ocn_c]}</text:span>}
    : '')
  { display: disp, set_ref: set_ref }
end

#set_ref_and_displayObject



65
66
67
68
69
70
71
72
73
# File 'lib/sisu/xml_odf_odt_format.rb', line 65

def set_ref_and_display
  set_ref=@paranum.gsub(/(\d+)/,
    ' <text:span text:style-name="Span_subscript"><text:reference-mark-start text:name="\1"/><text:reference-mark-end text:name="\1"/></text:span>')
  disp=@paranum.gsub(/(\d+)/,
    (@make.build.odt_ocn?) \
    ? %{ <text:span text:style-name="Span_subscript">#{Dx[:ocn_o]}\\1#{Dx[:ocn_c]}</text:span>}
    : '')
  { display: disp, set_ref: set_ref }
end