aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2013-11-02 22:55:29 -0400
committerRalph Amissah <ralph@amissah.com>2013-11-02 22:55:29 -0400
commita89fd60f2b523d3ba26b1a2e198eacf6304e2729 (patch)
tree77145f4c6712f5ceef548973d7488e6122f0b160 /lib/sisu/v5
parentv4 v5: version & changelog (diff)
v4 v5: constants, ocn output delimiter (where used) changed to 「...」
Diffstat (limited to 'lib/sisu/v5')
-rw-r--r--lib/sisu/v5/constants.rb1
-rw-r--r--lib/sisu/v5/manifest.rb7
-rw-r--r--lib/sisu/v5/odf.rb9
-rw-r--r--lib/sisu/v5/odf_format.rb4
-rw-r--r--lib/sisu/v5/plaintext_format.rb14
-rw-r--r--lib/sisu/v5/sysenv.rb8
6 files changed, 14 insertions, 29 deletions
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: '&lt;', url_c_xml: '&gt;',
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+)/,' <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">[\1]</text:span>')
+ disp=@paranum.gsub(/(\d+)/,%{ <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">[\1]</text:span>')
+ disp=@paranum.gsub(/(\d+)/,%{ <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
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
"<endnote>#{@txt}</endnote> "
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