From a89fd60f2b523d3ba26b1a2e198eacf6304e2729 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 2 Nov 2013 22:55:29 -0400 Subject: =?UTF-8?q?v4=20v5:=20constants,=20ocn=20output=20delimiter=20(whe?= =?UTF-8?q?re=20used)=20changed=20to=20=E3=80=8C...=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/sisu/v4/constants.rb | 1 + lib/sisu/v4/odf_format.rb | 4 ++-- lib/sisu/v5/constants.rb | 1 + lib/sisu/v5/manifest.rb | 7 +------ lib/sisu/v5/odf.rb | 9 +++++---- lib/sisu/v5/odf_format.rb | 4 ++-- lib/sisu/v5/plaintext_format.rb | 14 +------------- lib/sisu/v5/sysenv.rb | 8 ++++---- 8 files changed, 17 insertions(+), 31 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v4/constants.rb b/lib/sisu/v4/constants.rb index 478b7277..f95b1dbd 100644 --- a/lib/sisu/v4/constants.rb +++ b/lib/sisu/v4/constants.rb @@ -176,6 +176,7 @@ Rx={ meta: /#{Mx[:meta_o]}(\S+?)#{Mx[:meta_c]}/, } Dx={ + ocn_o: '「', ocn_c: '」', url_o: '‹', url_c: '›', url_o_xml: '<', url_c_xml: '>', rel_o: '‹', rel_c: '›', diff --git a/lib/sisu/v4/odf_format.rb b/lib/sisu/v4/odf_format.rb index 348ebb62..79f68478 100644 --- a/lib/sisu/v4/odf_format.rb +++ b/lib/sisu/v4/odf_format.rb @@ -69,12 +69,12 @@ module SiSU_ODF_Format end def set_ref_and_display set_ref=@paranum.gsub(/(\d+)/,' ') - disp=@paranum.gsub(/(\d+)/,' [\1]') + disp=@paranum.gsub(/(\d+)/,%{ #{Dx[:ocn_o]}\\1#{Dx[:ocn_c]}}) { display: disp, set_ref: set_ref } end def set_bookmark_and_display set_ref=@paranum.gsub(/(\d+)/,' ') - disp=@paranum.gsub(/(\d+)/,' [\1]') + disp=@paranum.gsub(/(\d+)/,%{ #{Dx[:ocn_o]}\\1#{Dx[:ocn_c]}}) { display: disp, set_ref: set_ref } end def name diff --git a/lib/sisu/v5/constants.rb b/lib/sisu/v5/constants.rb index d89a391a..26130506 100644 --- a/lib/sisu/v5/constants.rb +++ b/lib/sisu/v5/constants.rb @@ -176,6 +176,7 @@ Rx={ meta: /#{Mx[:meta_o]}(\S+?)#{Mx[:meta_c]}/, } Dx={ + ocn_o: '「', ocn_c: '」', url_o: '‹', url_c: '›', url_o_xml: '<', url_c_xml: '>', rel_o: '‹', rel_c: '›', diff --git a/lib/sisu/v5/manifest.rb b/lib/sisu/v5/manifest.rb index 071959c7..3d6a5835 100644 --- a/lib/sisu/v5/manifest.rb +++ b/lib/sisu/v5/manifest.rb @@ -418,12 +418,7 @@ module SiSU_Manifest summarize(id,file,pth,rel,url) end if FileTest.file?(@f.place_file.txt.dir)==true - id=if @md.opt.cmd =~/a/ then 'Plaintext (Unix (UTF-8) with footnotes)' - elsif @md.opt.cmd =~/e/ then 'Plaintext (Unix (UTF-8) with endnotes)' - elsif @md.opt.cmd =~/A/ then 'Plaintext (dos (UTF-8) with footnotes)' - elsif @md.opt.cmd =~/E/ then 'Plaintext (dos (UTF-8) with endnotes)' - else 'Plaintext (UTF-8)' - end + id='Plaintext (UTF-8)' pth=@f.output_path.txt.dir rel=@f.output_path.txt.rel_sm url=@f.output_path.txt.url diff --git a/lib/sisu/v5/odf.rb b/lib/sisu/v5/odf.rb index ae9a09ec..5e277992 100644 --- a/lib/sisu/v5/odf.rb +++ b/lib/sisu/v5/odf.rb @@ -548,10 +548,11 @@ module SiSU_ODF end p_num={ display: '', set_ref: '' } if dob.is !~/(^#{Rx[:meta]}|#{Mx[:br_eof]}|#{Mx[:br_endnotes]})/ - if defined? dob.ocn \ - and dob.ocn.is_a?(Fixnum) - p_num=SiSU_ODF_Format::ParagraphNumber.new(dob.ocn).set_bookmark_and_display - #p_num=SiSU_ODF_Format::ParagraphNumber.new(dob.ocn).set_ref_and_display + if @env.odt_ocn? + if defined? dob.ocn \ + and dob.ocn.is_a?(Fixnum) + p_num=SiSU_ODF_Format::ParagraphNumber.new(dob.ocn).set_bookmark_and_display + end end end if dob.is==:heading diff --git a/lib/sisu/v5/odf_format.rb b/lib/sisu/v5/odf_format.rb index d3630df9..28c69c44 100644 --- a/lib/sisu/v5/odf_format.rb +++ b/lib/sisu/v5/odf_format.rb @@ -69,12 +69,12 @@ module SiSU_ODF_Format end def set_ref_and_display set_ref=@paranum.gsub(/(\d+)/,' ') - disp=@paranum.gsub(/(\d+)/,' [\1]') + disp=@paranum.gsub(/(\d+)/,%{ #{Dx[:ocn_o]}\\1#{Dx[:ocn_c]}}) { display: disp, set_ref: set_ref } end def set_bookmark_and_display set_ref=@paranum.gsub(/(\d+)/,' ') - disp=@paranum.gsub(/(\d+)/,' [\1]') + disp=@paranum.gsub(/(\d+)/,%{ #{Dx[:ocn_o]}\\1#{Dx[:ocn_c]}}) { display: disp, set_ref: set_ref } end def name diff --git a/lib/sisu/v5/plaintext_format.rb b/lib/sisu/v5/plaintext_format.rb index 092e69f6..acad8828 100644 --- a/lib/sisu/v5/plaintext_format.rb +++ b/lib/sisu/v5/plaintext_format.rb @@ -68,7 +68,7 @@ module SiSU_Plaintext_Format @paranum=/(\d+)/m.match(paranum.to_s)[1] end def display - @paranum.gsub(/(\d+)/,"\n[\\1]") + @paranum.gsub(/(\d+)/,"\n#{Dx[:ocn_o]}\\1#{Dx[:ocn_c]}") end def name #unused @paranum.gsub(/(\d+)/,'\1') @@ -97,18 +97,6 @@ module SiSU_Plaintext_Format def scr_endnote_body "#{@txt} " end - def heading_body1 - end - def heading_body2 - end - def heading_body3 - end - def heading_body4 - end - def heading_body5 - end - def heading_body6 - end end class XML end diff --git a/lib/sisu/v5/sysenv.rb b/lib/sisu/v5/sysenv.rb index b23b7f80..f1076c68 100644 --- a/lib/sisu/v5/sysenv.rb +++ b/lib/sisu/v5/sysenv.rb @@ -1474,15 +1474,15 @@ module SiSU_Env end def odt_ocn? ((defined? @rc['odt']['ocn']) \ - && @rc['odt']['ocn']==true) \ + && @rc['odt']['ocn']==false) \ ? @rc['odt']['ocn'] - : false + : true end def plaintext_ocn? ((defined? @rc['plaintext']['ocn']) \ - && @rc['plaintext']['ocn']==true) \ + && @rc['plaintext']['ocn']==false) \ ? @rc['plaintext']['ocn'] - : false + : true end def widget #needs (md) #move @rc=SiSU_Env::GetInit.new.sisu_yaml.rc -- cgit v1.2.3