aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/xml_odf_odt_format.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-02-05 00:56:10 -0500
committerRalph Amissah <ralph@amissah.com>2014-02-05 00:56:10 -0500
commita151893efedaebc26d26a8f8611fb688a6de6d4f (patch)
treee5fbb47d3ce53c363af21f2242aa647d18b12f79 /lib/sisu/v5/xml_odf_odt_format.rb
parentv5 v6: options, ocn switch on/off instructions (& defaults for plaintext & odt) (diff)
v5 v6: ocn: strict html; turn on/off rules for txt & odf
Diffstat (limited to 'lib/sisu/v5/xml_odf_odt_format.rb')
-rw-r--r--lib/sisu/v5/xml_odf_odt_format.rb19
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/sisu/v5/xml_odf_odt_format.rb b/lib/sisu/v5/xml_odf_odt_format.rb
index 2a092011..b56e4284 100644
--- a/lib/sisu/v5/xml_odf_odt_format.rb
+++ b/lib/sisu/v5/xml_odf_odt_format.rb
@@ -65,17 +65,26 @@ module SiSU_XML_ODF_ODT_Format
include SiSU_Param
include SiSU_Viz
class ParagraphNumber
- def initialize(paranum)
+ def initialize(make,paranum)
+ @make=make
@paranum=/(\d+)/m.match(paranum.to_s)[1]
end
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+)/,%{ <text:span text:style-name="Span_subscript">#{Dx[:ocn_o]}\\1#{Dx[:ocn_c]}</text:span>})
+ 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
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+)/,%{ <text:span text:style-name="Span_subscript">#{Dx[:ocn_o]}\\1#{Dx[:ocn_c]}</text:span>})
+ 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
def name