diff options
Diffstat (limited to 'lib/sisu/v3dv/epub_segments.rb')
-rw-r--r-- | lib/sisu/v3dv/epub_segments.rb | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/lib/sisu/v3dv/epub_segments.rb b/lib/sisu/v3dv/epub_segments.rb index 50a1091c..0280f951 100644 --- a/lib/sisu/v3dv/epub_segments.rb +++ b/lib/sisu/v3dv/epub_segments.rb @@ -60,7 +60,7 @@ module SiSU_EPUB_Seg require_relative 'shared_xhtml' # shared_xhtml.rb require_relative 'epub' # epub.rb require_relative 'shared_metadata' # shared_metadata.rb - class Seg_output + class SegOutput def initialize(md,outputfile,seg,minitoc,type='') @md,@output_epub_cont_seg,@seg,@minitoc,@type=md,outputfile,seg,minitoc,type end @@ -70,31 +70,31 @@ module SiSU_EPUB_Seg filename_seg << @seg[:title] << @seg[:nav] if @type=='endnotes' @seg[:headings]=[] - format_head_seg=SiSU_EPUB_Format::Head_seg.new(@md) + format_head_seg=SiSU_EPUB_Format::HeadSeg.new(@md) @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) txt_obj={ txt: 'Endnotes', ocn_display: ''} - format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) + format_seg=SiSU_EPUB_Format::FormatSeg.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>' elsif @type=='idx' @seg[:headings]=[] - format_head_seg=SiSU_EPUB_Format::Head_seg.new(@md) + format_head_seg=SiSU_EPUB_Format::HeadSeg.new(@md) @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) txt_obj={ txt: 'Index', ocn_display: ''} - format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) + format_seg=SiSU_EPUB_Format::FormatSeg.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>' elsif @type=='metadata' metadata=Metadata::Summary.new(@md).xhtml_display.metadata @seg[:headings]=[] - format_head_seg=SiSU_EPUB_Format::Head_seg.new(@md) + format_head_seg=SiSU_EPUB_Format::HeadSeg.new(@md) @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) txt_obj={ txt: 'Metadata', ocn_display: ''} - format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) + format_seg=SiSU_EPUB_Format::FormatSeg.new(@md,txt_obj) @seg[:headings] << format_seg.title_heading1 filename_seg << @seg[:heading_idx] << @seg[:headings] << %{\n<div class="content">\n} << metadata << '</div>' elsif @type=='sisu_manifest' - env=SiSU_Env::Info_env.new(@md.fns) + env=SiSU_Env::InfoEnv.new(@md.fns) path_and_name,url_and_name="#{env.path.output}/#{@md.fnb}/sisu_manifest.html","#{env.url.root}/#{@md.fnb}/sisu_manifest.html" manifest=if FileTest.file?("#{path_and_name}")==true <<WOK @@ -104,10 +104,10 @@ WOK else '' end @seg[:headings]=[] - format_head_seg=SiSU_EPUB_Format::Head_seg.new(@md) + format_head_seg=SiSU_EPUB_Format::HeadSeg.new(@md) @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) txt_obj={ txt: 'Manifest', ocn_display: ''} - format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) + format_seg=SiSU_EPUB_Format::FormatSeg.new(@md,txt_obj) @seg[:headings] << format_seg.title_heading1 filename_seg << @seg[:heading_idx] << @seg[:headings] << %{\n<div class="content">\n} << manifest << '</div>' else @@ -140,7 +140,7 @@ WOK attr_reader :seg_name_xhtml,:seg_name_xhtml_tracker def initialize(md='',data='') @md,@data=md,data - @vz=SiSU_Env::Get_init.instance.skin + @vz=SiSU_Env::GetInit.instance.skin @seg_name_xhtml=@@seg_name_xhtml || nil @seg_name_xhtml_tracker=@@tracker || nil end @@ -151,7 +151,7 @@ WOK data=articles(data) Seg.new.cleanup # (((( added )))) #### (((( END )))) #### - rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error + rescue; SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error ensure @@seg_name=[] end @@ -163,7 +163,7 @@ WOK printed_endnote_seg='n' idx_xhtml=nil if @md.book_idx - idx_xhtml=SiSU_Particulars::Combined_singleton.instance.get_idx_xhtml(@md).xhtml_idx + idx_xhtml=SiSU_Particulars::CombinedSingleton.instance.get_idx_xhtml(@md).xhtml_idx idx_xhtml.each {|x| @@seg[:idx] << x } @@seg[:heading_idx]='' end @@ -179,7 +179,7 @@ WOK @@seg_total=@@seg_name.length testforartnum=@@seg_name_xhtml SiSU_Screen::Ansi.new(@md.opt.cmd,@@seg_name.length) if @md.opt.cmd =~/[MVv]/ - map_nametags=SiSU_Particulars::Combined_singleton.instance.get_map_nametags(@md).nametags_map #p map_nametags + map_nametags=SiSU_Particulars::CombinedSingleton.instance.get_map_nametags(@md).nametags_map #p map_nametags data.each do |dob| #if defined? dob.obj \ #and dob.obj =~/href="#{Xx[:segment]}#+\S+?"/ @@ -242,15 +242,15 @@ WOK output_epub_cont_seg=File.new(segfilename,'w') if @@seg_name_xhtml[tracking-1] if dob.is=='heading' \ or @@seg_name_xhtml[tracking-1] !~/endnotes|book_index|metadata/ - Seg_output.new(@md,output_epub_cont_seg,@@seg,@minitoc).output + SegOutput.new(@md,output_epub_cont_seg,@@seg,@minitoc).output elsif dob.is=='heading_insert' if @@seg_name_xhtml[tracking-1]=='endnotes' - Seg_output.new(@md,output_epub_cont_seg,@@seg,@minitoc,'endnotes').output + SegOutput.new(@md,output_epub_cont_seg,@@seg,@minitoc,'endnotes').output elsif @@seg_name_xhtml[tracking-1]=='book_index' - Seg_output.new(@md,output_epub_cont_seg,@@seg,@minitoc,'idx').output + SegOutput.new(@md,output_epub_cont_seg,@@seg,@minitoc,'idx').output @@seg[:idx]=[] elsif @@seg_name_xhtml[tracking-1]=='metadata' # navigation bug FIX - Seg_output.new(@md,output_epub_cont_seg,@@seg,@minitoc,'metadata').output + SegOutput.new(@md,output_epub_cont_seg,@@seg,@minitoc,'metadata').output else puts "#{__FILE__}::#{__LINE__}" end else puts "#{__FILE__}::#{__LINE__}" @@ -261,7 +261,7 @@ WOK if @@seg_name_xhtml[tracking]=='sisu_manifest' # this is for manifest, includes navigation bug segfilename="#{dir_epub_cont}/#{@@seg_name_xhtml[tracking]}#{Sfx[:epub_xhtml]}" output_epub_cont_seg=File.new(segfilename,'w') - Seg_output.new(@md,output_epub_cont_seg,@@seg,@minitoc,'sisu_manifest').output + SegOutput.new(@md,output_epub_cont_seg,@@seg,@minitoc,'sisu_manifest').output Seg.new.reinitialise #BUG navigation bug with items following metadata, and occurring before manifest, this becomes a bug ... work area for book index, FIX end #@output_epub_cont_seg.close #%(((( EOF )))) --> @@ -297,7 +297,7 @@ WOK data end def heading_art(dob) - format_head_seg=SiSU_EPUB_Format::Head_seg.new(@md) + format_head_seg=SiSU_EPUB_Format::HeadSeg.new(@md) if dob.is=='heading' \ and dob.ln =~/^[1-6]/ @@seg[:dot_nav]= (@@tracker < @@seg_total-1) \ @@ -308,7 +308,7 @@ WOK end def head(dob) clean=/<!.*?!>|<:.*?>$/ - format_head_seg=SiSU_EPUB_Format::Head_seg.new(@md) + format_head_seg=SiSU_EPUB_Format::HeadSeg.new(@md) if @@tracker < @@seg_total-1 @@segtocband=(@@tracker==0) \ ? format_head_seg.toc_next2 @@ -325,9 +325,9 @@ WOK ocn=if @@heading1[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#{@dp}:#{@dp}#{Mx[:id_c]}$/]; $1 #fix else '' end - @p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,ocn) + @p_num=SiSU_EPUB_Format::ParagraphNumber.new(@md,ocn) txt_obj={ txt: @@heading1, ocn_display: @p_num.ocn_display } - format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) + format_seg=SiSU_EPUB_Format::FormatSeg.new(@md,txt_obj) @@seg[:headings] << format_seg.title_heading1.gsub(clean,'') @@heading1.gsub!(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'') end @@ -336,9 +336,9 @@ WOK ocn=if heading2[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#{@dp}:#{@dp}#{Mx[:id_c]}$/]; $1 #fix else '' end - @p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,ocn) + @p_num=SiSU_EPUB_Format::ParagraphNumber.new(@md,ocn) txt_obj={ txt: heading2, ocn_display: @p_num.ocn_display } - format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) + format_seg=SiSU_EPUB_Format::FormatSeg.new(@md,txt_obj) @@seg[:headings] << format_seg.title_heading2.gsub(clean,'') @@heading2.gsub!(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'') end @@ -347,9 +347,9 @@ WOK ocn=if heading3[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#{@dp}:#{@dp}#{Mx[:id_c]}$/]; $1 #fix else '' end - @p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,ocn) + @p_num=SiSU_EPUB_Format::ParagraphNumber.new(@md,ocn) txt_obj={ txt: heading3, ocn_display: @p_num.ocn_display } - format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) + format_seg=SiSU_EPUB_Format::FormatSeg.new(@md,txt_obj) @@seg[:headings] << format_seg.title_heading3.gsub(clean,'') @@heading3.gsub!(/ <a name="-[\d*+]+" href="#_[\d*+]+"> <sup>[\d*+]+<\/sup> <\/a>/,'') end @@ -358,27 +358,27 @@ WOK ocn=if heading4[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#{@dp}:#{@dp}#{Mx[:id_c]}$/]; $1 #fix else '' end - @p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,ocn) + @p_num=SiSU_EPUB_Format::ParagraphNumber.new(@md,ocn) txt_obj={ txt: heading4, ocn_display: @p_num.ocn_display } - format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) + format_seg=SiSU_EPUB_Format::FormatSeg.new(@md,txt_obj) @@seg[:headings] << format_seg.title_heading4.gsub(clean,'') end @@tracker=@@tracker+1 end def markup(dob) @debug=[] - format_head_seg=SiSU_EPUB_Format::Head_seg.new(@md) + format_head_seg=SiSU_EPUB_Format::HeadSeg.new(@md) if dob.is =~/(?:heading|para)/ #extend as necessary FIX - @p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,dob.ocn) + @p_num=SiSU_EPUB_Format::ParagraphNumber.new(@md,dob.ocn) end - sto=SiSU_EPUB_Format::Format_text_object.new(@md,dob) + sto=SiSU_EPUB_Format::FormatTextObject.new(@md,dob) dob_xhtml=if dob.is=='heading' \ or dob.is=='heading_insert' \ or dob.is=='para' dob_xhtml=if dob.is=='heading' \ or dob.is=='heading_insert' if dob.ln==4 - sto.seg_heading4 # work on see Split_text_object + sto.seg_heading4 # work on see SplitTextObject elsif dob.ln==5 sto.seg_heading5 elsif dob.ln==6; sto.seg_heading6 @@ -417,13 +417,13 @@ WOK end if dob.is =~/heading|para/ \ and (not dob.ocn or dob.ocn.to_s.empty?) - format_seg=SiSU_EPUB_Format::Format_seg.new(@md,dob) + format_seg=SiSU_EPUB_Format::FormatSeg.new(@md,dob) end if (dob.is=='heading' \ || dob.is=='heading_insert' \ || dob.is=='para') \ and dob.note_ #dob.obj =~/<a href="#note_ref\d+"> <sup id=/ #endnote- note- - format_seg=SiSU_EPUB_Format::Format_seg.new(@md,dob) + format_seg=SiSU_EPUB_Format::FormatSeg.new(@md,dob) dob.obj=format_seg.no_paranum end if (dob.is=='heading' \ @@ -437,7 +437,7 @@ WOK end end def tail - format_head_seg=SiSU_EPUB_Format::Head_seg.new(@md) + format_head_seg=SiSU_EPUB_Format::HeadSeg.new(@md) if @md.flag_auto_endnotes \ and @@seg_endnotes[@@get_hash_fn] @@seg[:tail] << %{\n<div class="content">\n<div class="endnote">\n} @@ -494,10 +494,10 @@ WOK and dob.ln.to_s =~/^[56]/ case dob.ln when 5 - format_seg=SiSU_EPUB_Format::Format_seg.new(@md,dob) + format_seg=SiSU_EPUB_Format::FormatSeg.new(@md,dob) subtoc=format_seg.subtoc_lev5 #keep and make available, this is the subtoc when 6 - format_seg=SiSU_EPUB_Format::Format_seg.new(@md,dob) + format_seg=SiSU_EPUB_Format::FormatSeg.new(@md,dob) subtoc=format_seg.subtoc_lev6 #keep and make available, this is the subtoc end @@seg_subtoc_array << subtoc @@ -524,7 +524,7 @@ WOK try=e_n.split(/<br \/>/) try.each do |e| txt_obj={ txt: e } - format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) + format_seg=SiSU_EPUB_Format::FormatSeg.new(@md,txt_obj) note_match=if e =~/#{Mx[:pa_o]}i[1-9]#{Mx[:pa_c]}/ format_seg.endnote_body_indent else format_seg.endnote_body @@ -537,7 +537,7 @@ WOK 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 } - format_seg=SiSU_EPUB_Format::Format_seg.new(@md,txt_obj) + format_seg=SiSU_EPUB_Format::FormatSeg.new(@md,txt_obj) note_match_all_seg=format_seg.endnote_seg_body(@@fn) #BUG WATCH 200408 @@seg[:endnote_all] << note_match_all_seg end |