From df67ee1079d074dc2af54aa87187c6538e73d5d7 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 10 Jan 2012 22:50:12 -0500 Subject: v3dv: class names, use more CamelCase --- lib/sisu/v3dv/html_segments.rb | 84 +++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 42 deletions(-) (limited to 'lib/sisu/v3dv/html_segments.rb') diff --git a/lib/sisu/v3dv/html_segments.rb b/lib/sisu/v3dv/html_segments.rb index 39b3984f..69388229 100644 --- a/lib/sisu/v3dv/html_segments.rb +++ b/lib/sisu/v3dv/html_segments.rb @@ -61,10 +61,10 @@ module SiSU_HTML_Seg require_relative 'html' # html.rb require_relative 'html_promo' # html_promo.rb require_relative 'shared_metadata' # shared_metadata.rb - class Seg_output + class SegOutput def initialize(md,outputfile,seg,minitoc,type='') @md,@output_seg_file,@seg,@minitoc,@type=md,outputfile,seg,minitoc,type - @title_banner_=SiSU_Env::Create_site.new(@md.opt.cmd).html_seg_title_banner? + @title_banner_=SiSU_Env::CreateSite.new(@md.opt.cmd).html_seg_title_banner? @file=SiSU_Env::FileOp.new(@md) end def output @@ -73,33 +73,33 @@ module SiSU_HTML_Seg filename_seg << @seg[:title] << @seg[:tocband_banner] if @type=='endnotes' @seg[:headings]=[] - format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) + format_head_seg=SiSU_HTML_Format::HeadSeg.new(@md) if @title_banner_ @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) end txt_obj={ txt: 'Endnotes', ocn_display: '' } - format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) + format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) @seg[:headings] << format_seg.title_heading1 filename_seg << @seg[:heading_endnotes] << @minitoc << @seg[:headings] << %{\n
\n} << @seg[:endnote_all] << '
' # << '' elsif @type=='idx' @seg[:headings]=[] - format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) + format_head_seg=SiSU_HTML_Format::HeadSeg.new(@md) if @title_banner_ @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) end txt_obj={ txt: 'Index', ocn_display: '' } - format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) + format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) @seg[:headings] << format_seg.title_heading1 filename_seg << @seg[:heading_idx] << @minitoc << @seg[:headings] << %{\n
\n} << @seg[:idx] << '
' # << '' elsif @type=='metadata' metadata=Metadata::Summary.new(@md).xhtml_display.metadata @seg[:headings]=[] - format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) + format_head_seg=SiSU_HTML_Format::HeadSeg.new(@md) if @title_banner_ @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) end txt_obj={ txt: 'Metadata', ocn_display: '' } - format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) + format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) @seg[:headings] << format_seg.title_heading1 filename_seg << @seg[:heading_idx] << @minitoc << @seg[:headings] << %{\n
\n} << metadata << '
' # << '' else @@ -134,12 +134,12 @@ module SiSU_HTML_Seg attr_reader :seg_name_html,:seg_name_html_tracker def initialize(md=nil,data='') @md,@data=md,data - @vz=SiSU_Env::Get_init.instance.skin + @vz=SiSU_Env::GetInit.instance.skin @seg_name_html=@@seg_name_html || nil @seg_name_html_tracker=@@tracker || nil - @env=SiSU_Env::Info_env.new(@md.fns) if @md + @env=SiSU_Env::InfoEnv.new(@md.fns) if @md if @md - @title_banner_=SiSU_Env::Create_site.new(@md.opt.cmd).html_seg_title_banner? + @title_banner_=SiSU_Env::CreateSite.new(@md.opt.cmd).html_seg_title_banner? end end def songsheet @@ -149,7 +149,7 @@ module SiSU_HTML_Seg 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 @@ -161,8 +161,8 @@ module SiSU_HTML_Seg printed_endnote_seg='n' idx_html=nil if @md.book_idx - #my_make_source_file=SiSU_Env::Create_file.new(@md.fns) - idx_html=SiSU_Particulars::Combined_singleton.instance.get_idx_html(@md.opt).html_idx + #my_make_source_file=SiSU_Env::CreateFile.new(@md.fns) + idx_html=SiSU_Particulars::CombinedSingleton.instance.get_idx_html(@md.opt).html_idx idx_html.each {|x| @@seg[:idx] << x } @@seg[:heading_idx]='' end @@ -177,7 +177,7 @@ module SiSU_HTML_Seg @@seg_total=@@seg_name.length testforartnum=@@seg_name_html SiSU_Screen::Ansi.new(@md.opt.cmd,@@seg_name.length).segmented 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+?"/ @@ -228,7 +228,7 @@ module SiSU_HTML_Seg if (dob.is=='heading' or dob.is=='heading_insert') \ and dob.ln==4 if tracking != 0 - dirout=SiSU_Env::Info_env.new(@md.fns) + dirout=SiSU_Env::InfoEnv.new(@md.fns) dir_sisu=dirout.path.output @file=SiSU_Env::FileOp.new(@md) unless FileTest.directory?(@file.output_path.html_seg.dir) @@ -242,15 +242,15 @@ module SiSU_HTML_Seg : '' if dob.is=='heading' \ or @@seg_name_html[tracking-1] !~/endnotes|book_index|metadata/ - Seg_output.new(@md,output_seg_file,@@seg,minitoc).output + SegOutput.new(@md,output_seg_file,@@seg,minitoc).output elsif dob.is=='heading_insert' if @@seg_name_html[tracking-1]=='endnotes' - Seg_output.new(@md,output_seg_file,@@seg,minitoc,'endnotes').output + SegOutput.new(@md,output_seg_file,@@seg,minitoc,'endnotes').output elsif @@seg_name_html[tracking-1]=='book_index' - Seg_output.new(@md,output_seg_file,@@seg,minitoc,'idx').output + SegOutput.new(@md,output_seg_file,@@seg,minitoc,'idx').output @@seg[:idx]=[] elsif @@seg_name_html[tracking-1]=='metadata' - Seg_output.new(@md,output_seg_file,@@seg,minitoc,'metadata').output + SegOutput.new(@md,output_seg_file,@@seg,minitoc,'metadata').output else puts "#{__FILE__}::#{__LINE__}" end else puts "#{__FILE__}::#{__LINE__}" @@ -262,7 +262,7 @@ module SiSU_HTML_Seg #if @@seg_name_html[tracking] =~/metadata/ # this is for metadata # segfilename="#{@md.dir_out}/#{@md.fnl[:pre]}#{@@seg_name_html[tracking]}#{@md.fnl[:mid]}#{Sfx[:html]}#{@md.fnl[:post]}" # output_seg_file=File.new(segfilename,'w') - # Seg_output.new(@md,output_seg_file,@@seg,minitoc,'metadata').output + # SegOutput.new(@md,output_seg_file,@@seg,minitoc,'metadata').output # Seg.new.reinitialise #end end @@ -292,7 +292,7 @@ module SiSU_HTML_Seg data end def heading_art(dob) - format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) + format_head_seg=SiSU_HTML_Format::HeadSeg.new(@md) if (dob.is=='heading' or dob.is=='heading_insert') \ and dob.ln.to_s =~/^[1-6]/ if @@tracker < @@seg_total-1; @@seg[:dot_nav]=format_head_seg.dot_control_pre_next @@ -304,7 +304,7 @@ module SiSU_HTML_Seg end def head(dob) clean=/|<:.*?>/ - format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) + format_head_seg=SiSU_HTML_Format::HeadSeg.new(@md) if @@tracker < @@seg_total-1 if @@tracker==0; @@segtocband=format_head_seg.toc_next2 #if format_head_seg.toc_next2 else @@segtocband=format_head_seg.toc_pre_next2 #if format_head_seg.toc_pre_next2 @@ -320,16 +320,16 @@ module SiSU_HTML_Seg else '' end @@seg[:tocband_bannerless] << '
' << conditional_div_close << format_head_seg.navigation_band_bottom(@@segtocband,@@seg[:dot_nav]) - @@seg[:headings] << format_head_seg.seg_head_escript if SiSU_HTML_Format::Head_seg.method_defined? :seg_head_escript #debug PHP move up in text #bug + @@seg[:headings] << format_head_seg.seg_head_escript if SiSU_HTML_Format::HeadSeg.method_defined? :seg_head_escript #debug PHP move up in text #bug if @title_banner_ @@seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author).gsub(clean,'') end 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_HTML_Format::Paragraph_number.new(@md,ocn) + @p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn) txt_obj={ txt: @@heading1, ocn_display: @p_num.ocn_display } - format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) + format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) @@seg[:headings] << format_seg.title_heading1.gsub(clean,'') @@heading1.gsub!(/  [\d*+]+<\/sup> <\/a>/,'') end @@ -338,9 +338,9 @@ module SiSU_HTML_Seg 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_HTML_Format::Paragraph_number.new(@md,ocn) + @p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn) txt_obj={ txt: heading2, ocn_display: @p_num.ocn_display } - format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) + format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) @@seg[:headings] << format_seg.title_heading2.gsub(clean,'') @@heading2.gsub!(/  [\d*+]+<\/sup> <\/a>/,'') end @@ -349,9 +349,9 @@ module SiSU_HTML_Seg 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_HTML_Format::Paragraph_number.new(@md,ocn) + @p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn) txt_obj={ txt: heading3, ocn_display: @p_num.ocn_display } - format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) + format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) @@seg[:headings] << format_seg.title_heading3.gsub(clean,'') @@heading3.gsub!(/  [\d*+]+<\/sup> <\/a>/,'') end @@ -360,21 +360,21 @@ module SiSU_HTML_Seg 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_HTML_Format::Paragraph_number.new(@md,ocn) + @p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn) txt_obj={ txt: heading4, ocn_display: @p_num.ocn_display } - format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) + format_seg=SiSU_HTML_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_HTML_Format::Head_seg.new(@md) + format_head_seg=SiSU_HTML_Format::HeadSeg.new(@md) if dob.is !~/meta/ if dob.is =~/(?:heading|para)/ #extend as necessary FIX - @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,dob.ocn) + @p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,dob.ocn) end - sto=SiSU_HTML_Format::Format_text_object.new(@md,dob) + sto=SiSU_HTML_Format::FormatTextObject.new(@md,dob) dob_html=if dob.is =~/heading|para/ dob_html=if (dob.is=='heading' \ or dob.is=='heading_insert') @@ -425,11 +425,11 @@ module SiSU_HTML_Seg end if dob.obj !~/#{@vz.margin_txt_w1}|#{@vz.margin_txt_w2}/ if dob.is =~/heading|para/ and (not dob.ocn or dob.ocn.to_s.empty?) - format_seg=SiSU_HTML_Format::Format_seg.new(@md,dob) + format_seg=SiSU_HTML_Format::FormatSeg.new(@md,dob) end dob.obj.gsub!(/\s*(-\{{2}~\d+|<:e[:_]\d+>).*/,'') #potentially dagerous - removes all paragraphs with #?? workpoint if dob.obj =~/ / #endnote- note- - format_seg=SiSU_HTML_Format::Format_seg.new(@md,dob) + format_seg=SiSU_HTML_Format::FormatSeg.new(@md,dob) dob=format_seg.no_paranum end end @@ -445,7 +445,7 @@ module SiSU_HTML_Seg end end def tail - format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) + format_head_seg=SiSU_HTML_Format::HeadSeg.new(@md) if @md.flag_auto_endnotes and @@seg_endnotes[@@get_hash_fn] @@seg[:tail] << %{\n
\n
\n} if @@seg_endnotes[@@get_hash_fn].flatten.length > 0 @@ -501,11 +501,11 @@ module SiSU_HTML_Seg case dob.ln when 5 txt_obj={ txt: dob.obj.strip, ocn: dob.ocn } - format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) + format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) subtoc=format_seg.subtoc_lev5 #keep and make available, this is the subtoc when 6 txt_obj={ txt: dob.obj.strip, ocn: dob.ocn } - format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) + format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) subtoc=format_seg.subtoc_lev6 #keep and make available, this is the subtoc end @@seg_subtoc_array << subtoc @@ -531,7 +531,7 @@ module SiSU_HTML_Seg try=e_n.split(/
/) try.each do |e| txt_obj={ txt: e } - format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) + format_seg=SiSU_HTML_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 @@ -544,7 +544,7 @@ module SiSU_HTML_Seg 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_HTML_Format::Format_seg.new(@md,txt_obj) + format_seg=SiSU_HTML_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 -- cgit v1.2.3