diff options
Diffstat (limited to 'lib/sisu/v3/epub_segments.rb')
-rw-r--r-- | lib/sisu/v3/epub_segments.rb | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/sisu/v3/epub_segments.rb b/lib/sisu/v3/epub_segments.rb index 7eb43eec..c06f11f2 100644 --- a/lib/sisu/v3/epub_segments.rb +++ b/lib/sisu/v3/epub_segments.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -57,9 +57,9 @@ =end module SiSU_EPUB_seg - require "#{SiSU_lib}/shared_xhtml" # shared_xhtml.rb - require "#{SiSU_lib}/epub" # epub.rb - require "#{SiSU_lib}/shared_metadata" # shared_metadata.rb + require_relative 'shared_xhtml' # shared_xhtml.rb + require_relative 'epub' # epub.rb + require_relative 'shared_metadata' # shared_metadata.rb class Seg_output def initialize(md,outputfile,seg,minitoc,type='') @md,@output_epub_cont_seg,@seg,@minitoc,@type=md,outputfile,seg,minitoc,type @@ -72,7 +72,7 @@ module SiSU_EPUB_seg @seg[:headings]=[] format_head_seg=SiSU_EPUB_Format::Head_seg.new(@md) @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) - txt_obj={:txt =>'Endnotes',:ocn_display =>''} + txt_obj={ txt: 'Endnotes', ocn_display: ''} format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) @seg[:headings] << format_seg.title_heading1 filename_seg << @seg[:heading_endnotes] << @seg[:headings] << %{\n<div class="content">\n} << @seg[:endnote_all] << '</div>' @@ -80,7 +80,7 @@ module SiSU_EPUB_seg @seg[:headings]=[] format_head_seg=SiSU_EPUB_Format::Head_seg.new(@md) @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) - txt_obj={:txt =>'Index',:ocn_display =>''} + txt_obj={ txt: 'Index', ocn_display: ''} format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) @seg[:headings] << format_seg.title_heading1 filename_seg << @seg[:heading_idx] << @seg[:headings] << %{\n<div class="content">\n} << @seg[:idx] << '</div>' @@ -89,7 +89,7 @@ module SiSU_EPUB_seg @seg[:headings]=[] format_head_seg=SiSU_EPUB_Format::Head_seg.new(@md) @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) - txt_obj={:txt =>'Metadata',:ocn_display =>''} + txt_obj={ txt: 'Metadata', ocn_display: ''} format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) @seg[:headings] << format_seg.title_heading1 filename_seg << @seg[:heading_idx] << @seg[:headings] << %{\n<div class="content">\n} << metadata << '</div>' @@ -106,7 +106,7 @@ WOK @seg[:headings]=[] format_head_seg=SiSU_EPUB_Format::Head_seg.new(@md) @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) - txt_obj={:txt =>'Manifest',:ocn_display =>''} + txt_obj={ txt: 'Manifest', ocn_display: ''} format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) @seg[:headings] << format_seg.title_heading1 filename_seg << @seg[:heading_idx] << @seg[:headings] << %{\n<div class="content">\n} << manifest << '</div>' @@ -223,7 +223,7 @@ WOK end end if @@is4==1 - dir_epub_cont="#{@md.env.path.epub}/OPS" + dir_epub_cont="#{@md.env.processing_path.epub}/OPS" if newfile==1 \ or dob.obj =~/^#{Mx[:br_endnotes]}|^#{Mx[:br_eof]}/ newfile=0 @@ -314,7 +314,7 @@ WOK else '' end @p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,ocn) - txt_obj={:txt =>@@heading1,:ocn_display =>@p_num.ocn_display} + txt_obj={ txt: @@heading1, ocn_display: @p_num.ocn_display } format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) @@seg[:headings] << format_seg.title_heading1.gsub(clean,'') @@heading1.gsub!(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'') @@ -325,7 +325,7 @@ WOK else '' end @p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,ocn) - txt_obj={:txt =>heading2,:ocn_display =>@p_num.ocn_display} + txt_obj={ txt: heading2, ocn_display: @p_num.ocn_display } format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) @@seg[:headings] << format_seg.title_heading2.gsub(clean,'') @@heading2.gsub!(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'') @@ -336,7 +336,7 @@ WOK else '' end @p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,ocn) - txt_obj={:txt =>heading3,:ocn_display =>@p_num.ocn_display} + txt_obj={ txt: heading3, ocn_display: @p_num.ocn_display } format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) @@seg[:headings] << format_seg.title_heading3.gsub(clean,'') @@heading3.gsub!(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'') @@ -347,7 +347,7 @@ WOK else '' end @p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,ocn) - txt_obj={:txt =>heading4,:ocn_display =>@p_num.ocn_display} + txt_obj={ txt: heading4, ocn_display: @p_num.ocn_display } format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) @@seg[:headings] << format_seg.title_heading4.gsub(clean,'') end @@ -497,7 +497,7 @@ WOK e_n=note_match_seg[/(?:#{Mx[:en_a_o]}(?:\d|#{ast}|#{pls})+|#{Mx[:en_b_o]}(?:#{ast}|#{pls})\d+)\s+(.+?)(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/m,1] try=e_n.split(/<br \/>/) try.each do |e| - txt_obj={:txt =>e} + txt_obj={ txt: e } format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) note_match=if e =~/#{Mx[:pa_o]}i[1-9]#{Mx[:pa_c]}/ format_seg.endnote_body_indent @@ -510,7 +510,7 @@ WOK m=/(?:#{Mx[:en_a_o]}(?:\d|#{ast}|#{pls})+|#{Mx[:en_b_o]}(?:#{ast}|#{pls})\d+)\s+(.+?href=")(#note_ref(?:\d|_a|_b)+".+)(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/mi endnote_part_a=note_match_seg[m,1] endnote_part_b=note_match_seg[m,2] - txt_obj={:endnote_part_a =>endnote_part_a,:endnote_part_b =>endnote_part_b} + txt_obj={ endnote_part_a: endnote_part_a, endnote_part_b: endnote_part_b } format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) note_match_all_seg=format_seg.endnote_seg_body(@@fn) #BUG WATCH 200408 @@seg[:endnote_all] << note_match_all_seg |