Class: SiSU_XML_ODF_ODT_Format::ParagraphNumber
- Inherits:
-
Object
- Object
- SiSU_XML_ODF_ODT_Format::ParagraphNumber
- Defined in:
- lib/sisu/xml_odf_odt_format.rb
Instance Method Summary collapse
- #goto ⇒ Object
-
#initialize(make, paranum) ⇒ ParagraphNumber
constructor
A new instance of ParagraphNumber.
- #name ⇒ Object
- #set_bookmark_and_display ⇒ Object
- #set_ref_and_display ⇒ Object
Constructor Details
#initialize(make, paranum) ⇒ ParagraphNumber
Returns a new instance of ParagraphNumber.
59 60 61 62 |
# File 'lib/sisu/xml_odf_odt_format.rb', line 59 def initialize(make,paranum) @make=make @paranum=/(\d+)/m.match(paranum.to_s)[1] end |
Instance Method Details
#goto ⇒ Object
84 85 86 |
# File 'lib/sisu/xml_odf_odt_format.rb', line 84 def goto @paranum.gsub(/(\d+)/,'<a href="#\1">') end |
#name ⇒ Object
81 82 83 |
# File 'lib/sisu/xml_odf_odt_format.rb', line 81 def name @paranum.gsub(/(\d+)/,'<a name="\1"></a>') end |
#set_bookmark_and_display ⇒ Object
72 73 74 75 76 77 78 79 80 |
# File 'lib/sisu/xml_odf_odt_format.rb', line 72 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_display ⇒ Object
63 64 65 66 67 68 69 70 71 |
# File 'lib/sisu/xml_odf_odt_format.rb', line 63 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 |