From d43865fb6a093625a77e8605d6fb00158546e1e4 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 12 Aug 2008 23:37:42 -0400 Subject: html increased use of css; dal, middle layer, url representation, interim commit --- lib/sisu/v0/html_segments.rb | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'lib/sisu/v0/html_segments.rb') diff --git a/lib/sisu/v0/html_segments.rb b/lib/sisu/v0/html_segments.rb index a15c302e..e632c835 100644 --- a/lib/sisu/v0/html_segments.rb +++ b/lib/sisu/v0/html_segments.rb @@ -69,7 +69,7 @@ module SiSU_HTML_seg @@loop_count=@@seg_total=@@tracker=0 @@is4=@@is3=@@is2=@@is1=0 @@header1=@@header2=@@header3=@@header4=0 - @@seg[:tocband],@@seg[:title],@@seg[:headers],@@seg[:main],@@seg[:tail],@@seg[:credits],@@seg_subtoc_array,@@seg_endnotes_array,@@seg[:endnote_all]=Array.new(9){[]} + @@seg[:tocband_banner],@@seg[:tocband_bannerless],@@seg[:title],@@seg[:headers],@@seg[:main],@@seg[:tail],@@seg[:credits],@@seg_subtoc_array,@@seg_endnotes_array,@@seg[:endnote_all]=Array.new(10){[]} @@seg[:header_endnotes]='' @@tablehead,@@number_of_cols=0,0 @@flag_alt=false @@ -85,6 +85,7 @@ module SiSU_HTML_seg end def songsheet begin + @@minitoc=SiSU_HTML::Source::Toc.new(@data,@md).minitoc data=get_subtoc_endnotes(@data) data=articles(data) Seg.new.cleanup # (((( added )))) @@ -192,6 +193,8 @@ module SiSU_HTML_seg end end end + @@seg[:main] << '' + data end def header_art(para) format_head_seg=SiSU_HTML_Format_type::Head_seg.new(@md) @@ -215,7 +218,8 @@ module SiSU_HTML_seg @p_num ||= '' if @@is1 == 1 @dc_creator=%{#{@md.dc_creator}\n} if @md.dc_creator.to_s =~/\S/ - @@seg[:tocband] << format_head_seg.navigation_band(@@segtocband,@@seg[:dot_nav]) + @@seg[:tocband_banner] << format_head_seg.navigation_band(@@segtocband,@@seg[:dot_nav]) + @@seg[:tocband_bannerless] << format_head_seg.navigation_band_bottom(@@segtocband,@@seg[:dot_nav]) @@seg[:headers] << format_head_seg.seg_head_escript if SiSU_HTML_Format_type::Head_seg.method_defined? :seg_head_escript #debug PHP move up in text #bug @@seg[:headers] << format_head_seg.title_banner(@md.title,@md.subtitle,@dc_creator).gsub(clean,'') paranum=if @@header1[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/]; $1 @@ -320,14 +324,16 @@ module SiSU_HTML_seg elsif para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/ \ and para =~/^#{Mx[:gr_o]}TZ#{Mx[:gr_c]}/ format_txt_obj.gsub_body - @sto.seg_lev_para_ocn.table_end + @sto.seg_lev_para_ocn.table_css_end else para end else para end elsif para =~/#{Mx[:tc_p]}|#{Mx[:gr_o]}T[hZ]?/u + @sto=nil table=SiSU_HTML_shared::Table.new(para) para=table.table + else @sto=nil end if @md.flag_separate_endnotes para.gsub!(/"\s+href="#_(\d+)">/,%{" href=\"endnotes#{@md.sfx}#_\\1">}) #endnote- twice #removed file type @@ -345,8 +351,9 @@ module SiSU_HTML_seg para=format_seg.no_paranum end end - if @sto.format=~/4:\S+/ + if @sto and @sto.format=~/4:\S+/ para.gsub!(/^\s*4:\S+\s*|<:[-_\w\d]?(-.+?-)?>|4~!.+/m,'') #sort seg headers + @@seg[:main] << '
' @@seg[:main] << para @@seg[:main] << @@seg_subtoc[@@get_hash_fn] #% insertion of sub-toc else @@ -361,20 +368,19 @@ module SiSU_HTML_seg @@seg[:tail] << format_head_seg.endnote_mark @@seg[:tail] << @@seg_endnotes[@@get_hash_fn] #endnotes deposited at end of individual segments ||@|EXTRACTION OF ENDNOTES| end - @@seg[:tail] << '
 
' ads=SiSU_HTML_promo::Ad.new(@md) @@seg[:credits] << format_head_seg.credit << ads.div.close << ads.display << format_head_seg.html_close end def output(type='') if @@seg[:title] =~/\S/ #kludge (for exception file better.ways, how ironic) get a real ruby test, e.g. test that not array or... filename_seg=[] - filename_seg << @@seg[:title] << @@seg[:tocband] + filename_seg << @@seg[:title] << @@seg[:tocband_banner] if type !~/endnote/ - filename_seg << @@seg[:headers] << @@seg[:main] + filename_seg << @@minitoc << @@seg[:main] else - filename_seg << @@seg[:header_endnotes] << @@seg[:endnote_all] + filename_seg << @@seg[:header_endnotes] << @@minitoc << '
' << @@seg[:endnote_all] end - filename_seg << @@seg[:tail] << @@seg[:tocband] << @@seg[:credits] + filename_seg << @@seg[:tail] << @@seg[:tocband_bannerless] << @@seg[:credits] filename_seg.flatten!.compact! filename_seg.each do |para| unless para =~/\A\s*\Z/ @@ -386,7 +392,7 @@ module SiSU_HTML_seg end end def reinitialise - @@seg[:title],@@seg[:dot_nav],@@seg[:tocband],@@seg[:headers],@@seg[:main],@@seg[:tail],@@seg[:credits]=Array.new(7){[]} + @@seg[:title],@@seg[:dot_nav],@@seg[:tocband_banner],@@seg[:tocband_bannerless],@@seg[:headers],@@seg[:main],@@seg[:tail],@@seg[:credits]=Array.new(8){[]} @@segtocband=nil end def cleanup -- cgit v1.2.3 From e25335596d5c77fd9edb8f806373a41cfdf90622 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 14 Aug 2008 01:30:04 -0400 Subject: html, css and related markup --- lib/sisu/v0/html_segments.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/sisu/v0/html_segments.rb') diff --git a/lib/sisu/v0/html_segments.rb b/lib/sisu/v0/html_segments.rb index e632c835..5b7ede63 100644 --- a/lib/sisu/v0/html_segments.rb +++ b/lib/sisu/v0/html_segments.rb @@ -193,7 +193,7 @@ module SiSU_HTML_seg end end end - @@seg[:main] << '
' + @@seg[:main] << "\n
\n" data end def header_art(para) @@ -353,7 +353,7 @@ module SiSU_HTML_seg end if @sto and @sto.format=~/4:\S+/ para.gsub!(/^\s*4:\S+\s*|<:[-_\w\d]?(-.+?-)?>|4~!.+/m,'') #sort seg headers - @@seg[:main] << '
' + @@seg[:main] << %{\n
\n} @@seg[:main] << para @@seg[:main] << @@seg_subtoc[@@get_hash_fn] #% insertion of sub-toc else @@ -368,6 +368,7 @@ module SiSU_HTML_seg @@seg[:tail] << format_head_seg.endnote_mark @@seg[:tail] << @@seg_endnotes[@@get_hash_fn] #endnotes deposited at end of individual segments ||@|EXTRACTION OF ENDNOTES| end + #@@seg[:tail] << '
 
' ads=SiSU_HTML_promo::Ad.new(@md) @@seg[:credits] << format_head_seg.credit << ads.div.close << ads.display << format_head_seg.html_close end @@ -378,7 +379,7 @@ module SiSU_HTML_seg if type !~/endnote/ filename_seg << @@minitoc << @@seg[:main] else - filename_seg << @@seg[:header_endnotes] << @@minitoc << '
' << @@seg[:endnote_all] + filename_seg << @@seg[:header_endnotes] << @@minitoc << %{\n
\n} << @@seg[:endnote_all] end filename_seg << @@seg[:tail] << @@seg[:tocband_bannerless] << @@seg[:credits] filename_seg.flatten!.compact! -- cgit v1.2.3 From 6759751b4a94ee4866c6f150b0245a3da7e98370 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 14 Aug 2008 19:55:27 -0400 Subject: html format, consolidate html_format file, prune later; version number bumped version number bump: is necessary to re-initialize using new css for html presentation sisu -CC --- lib/sisu/v0/html_segments.rb | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'lib/sisu/v0/html_segments.rb') diff --git a/lib/sisu/v0/html_segments.rb b/lib/sisu/v0/html_segments.rb index 5b7ede63..c3617b24 100644 --- a/lib/sisu/v0/html_segments.rb +++ b/lib/sisu/v0/html_segments.rb @@ -197,7 +197,7 @@ module SiSU_HTML_seg data end def header_art(para) - format_head_seg=SiSU_HTML_Format_type::Head_seg.new(@md) + format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) if para =~/^#{Mx[:lv_o]}[1-6]:/ #2004w27/5 if @@tracker < @@seg_total-1; @@seg[:dot_nav]=format_head_seg.dot_control_pre_next else @@seg[:dot_nav]=format_head_seg.dot_control_pre @@ -208,7 +208,7 @@ module SiSU_HTML_seg end def head(para) clean=/|#{Mx[:gr_o]}:.*?#{Mx[:gr_c]}|<:.*?>|#{Mx[:id_o]}~\d+;(?:[ohum]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/ - format_head_seg=SiSU_HTML_Format_type::Head_seg.new(@md) + format_head_seg=SiSU_HTML_Format::Head_seg.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 @@ -220,13 +220,13 @@ module SiSU_HTML_seg @dc_creator=%{#{@md.dc_creator}\n} if @md.dc_creator.to_s =~/\S/ @@seg[:tocband_banner] << format_head_seg.navigation_band(@@segtocband,@@seg[:dot_nav]) @@seg[:tocband_bannerless] << format_head_seg.navigation_band_bottom(@@segtocband,@@seg[:dot_nav]) - @@seg[:headers] << format_head_seg.seg_head_escript if SiSU_HTML_Format_type::Head_seg.method_defined? :seg_head_escript #debug PHP move up in text #bug + @@seg[:headers] << 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[:headers] << format_head_seg.title_banner(@md.title,@md.subtitle,@dc_creator).gsub(clean,'') paranum=if @@header1[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/]; $1 else '' end - @p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,paranum) - format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,@@header1,@p_num.ocn_display) + @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,paranum) + format_seg=SiSU_HTML_Format::Format_seg.new(@md,@@header1,@p_num.ocn_display) @@seg[:headers] << format_seg.title_header1.gsub(clean,'') @@header1.gsub!(/  [\d*+]+<\/sup> <\/a>/,'') end @@ -235,8 +235,8 @@ module SiSU_HTML_seg paranum=if header2[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/]; $1 else '' end - @p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,paranum) - format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,header2,@p_num.ocn_display) + @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,paranum) + format_seg=SiSU_HTML_Format::Format_seg.new(@md,header2,@p_num.ocn_display) @@seg[:headers] << format_seg.title_header2.gsub(clean,'') @@header2.gsub!(/  [\d*+]+<\/sup> <\/a>/,'') end @@ -245,8 +245,8 @@ module SiSU_HTML_seg paranum=if header3[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/]; $1 else '' end - @p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,paranum) - format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,header3,@p_num.ocn_display) + @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,paranum) + format_seg=SiSU_HTML_Format::Format_seg.new(@md,header3,@p_num.ocn_display) @@seg[:headers] << format_seg.title_header3.gsub(clean,'') @@header3.gsub!(/  [\d*+]+<\/sup> <\/a>/,'') end @@ -255,8 +255,8 @@ module SiSU_HTML_seg paranum=if header4[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/]; $1 else '' end - @p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,paranum) - format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,header4,@p_num.ocn_display) + @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,paranum) + format_seg=SiSU_HTML_Format::Format_seg.new(@md,header4,@p_num.ocn_display) @@seg[:headers] << format_seg.title_header4.gsub(clean,'') end @@seg[:header_endnotes]=format_head_seg.title_endnote(@md.title,@md.subtitle,@dc_creator,@@seg[:dot_nav]) @@ -264,12 +264,12 @@ module SiSU_HTML_seg end def markup(para) @debug=[] - format_head_seg=SiSU_HTML_Format_type::Head_seg.new(@md) + format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) if para !~/^#{Rx[:meta]}/ m=para[/.+?#{Mx[:id_o]}~(\d+);(?:[ohm]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/] if m paranum=m[1].to_s - @p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,paranum) + @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,paranum) end if para =~/#{Mx[:gr_o]}(?:code|alt|verse|group)#{Mx[:gr_c]}/m \ or @@flag_alt==true @@ -293,13 +293,13 @@ module SiSU_HTML_seg if para !~/^#{Mx[:lv_o]}[1-9]:|#{Rx[:meta]}/ if para =~/(.*)#{Mx[:id_o]}~0;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}(.*)/ one,two=$1,$2 - format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,one,two) + format_seg=SiSU_HTML_Format::Format_seg.new(@md,one,two) para=format_seg.no_paranum end end if para[/#{Mx[:id_o]}~(\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp)#{Mx[:id_c]}$/] @sto=SiSU_HTML::Source::Split_text_object.new(@md,para).html_seg - format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,@sto.text) if @sto.format =~/i[1-9]|null/ #watch + format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,@sto.text) if @sto.format =~/i[1-9]|null/ #watch para=case @sto.format # work area 2003w29 ||@|def lev_segname_para_ocn| when /^4:/; @sto.seg_lev_para_ocn.header4 # work on see Split_text_object when /^5:/; @sto.seg_lev_para_ocn.header5 @@ -341,13 +341,13 @@ module SiSU_HTML_seg if para !~/#{@vz.margin_txt_w1}|#{@vz.margin_txt_w2}/ if para[/(.*)#{Mx[:id_o]}~0;(?:u|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}(.*)/] #% watch u & m? one,two=$1,$2 - format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,one,two) + format_seg=SiSU_HTML_Format::Format_seg.new(@md,one,two) #FIX --> not that undefined, rather is not needed, should not be visited, and remove #para=format_seg.seg_no_paranum #% undefined end para.gsub!(/\s*(-\{{2}~\d+|<:e[:_]\d+>).*/,'') #potentially dagerous - removes all paragraphs with #?? workpoint if para =~/ / #endnote- note- - format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,para) + format_seg=SiSU_HTML_Format::Format_seg.new(@md,para) para=format_seg.no_paranum end end @@ -363,7 +363,7 @@ module SiSU_HTML_seg end end def tail - format_head_seg=SiSU_HTML_Format_type::Head_seg.new(@md) + format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) if @md.flag_auto_endnotes @@seg[:tail] << format_head_seg.endnote_mark @@seg[:tail] << @@seg_endnotes[@@get_hash_fn] #endnotes deposited at end of individual segments ||@|EXTRACTION OF ENDNOTES| @@ -437,11 +437,11 @@ module SiSU_HTML_seg case para # series changed 2002w42 when /^#{Mx[:lv_o]}5:\S*?#{Mx[:lv_c]}\s*(.+)?#{Mx[:id_o]}~(\d+);(?:h|[56]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/ #remove [u]? req by pg texts, revist one,two=$1,$2 - format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,one,two) + format_seg=SiSU_HTML_Format::Format_seg.new(@md,one,two) para=format_seg.subtoc_lev5 when /^#{Mx[:lv_o]}6:\S*?#{Mx[:lv_c]}\s*(.+)?#{Mx[:id_o]}~(\d+);(?:h|[56]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/ one,two=$1,$2 - format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,one,two) + format_seg=SiSU_HTML_Format::Format_seg.new(@md,one,two) para=format_seg.subtoc_lev6 end @@seg_subtoc_array << para @@ -466,7 +466,7 @@ module SiSU_HTML_seg e_n=note_match_seg[/(?:#{Mx[:en_a_o]}[\d*+]+|#{Mx[:en_b_o]}[*+]\d+)\s+(.+?)(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/m,1] try=e_n.split(/
/) try.each do |e| - format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,e) + format_seg=SiSU_HTML_Format::Format_seg.new(@md,e) note_match=if e =~/#{Mx[:pa_o]}i[1-9]#{Mx[:pa_c]}/ format_seg.endnote_body_seg_tail_indent else format_seg.endnote_body_seg_tail @@ -478,7 +478,7 @@ module SiSU_HTML_seg m=/(?:#{Mx[:en_a_o]}[\d*+]+|#{Mx[:en_b_o]}[*+]\d+)\s+(.+?href=")(#-[\d*+]+".+)(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/mi one=note_match_seg[m,1] #note~ [a name] two=note_match_seg[m,2] #note- - format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,one,two) + format_seg=SiSU_HTML_Format::Format_seg.new(@md,one,two) 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 From afb83150d0b9876006bc100517b60be9e2fd0f56 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 16 Aug 2008 00:21:01 -0400 Subject: html css and div related --- lib/sisu/v0/html_segments.rb | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'lib/sisu/v0/html_segments.rb') diff --git a/lib/sisu/v0/html_segments.rb b/lib/sisu/v0/html_segments.rb index c3617b24..c4d136b7 100644 --- a/lib/sisu/v0/html_segments.rb +++ b/lib/sisu/v0/html_segments.rb @@ -141,7 +141,9 @@ module SiSU_HTML_seg end end if @@is4 == 1 \ - or para =~/^#{Mx[:br_endnotes]}|^#{Mx[:br_eof]}/ + or para =~/^#{Mx[:br_endnotes]}|^#{Mx[:br_eof]}/ \ + or para =~/^#{Mx[:mk_o]}4:metadata#{Mx[:mk_c]}/ + m=para[/^#{Mx[:lv_o]}4:(metadata)#{Mx[:lv_c]}/]; @@get_hash_fn=$1 if m if newfile == 1 \ or para =~/^#{Mx[:br_endnotes]}|^#{Mx[:br_eof]}/ newfile=0 @@ -219,7 +221,11 @@ module SiSU_HTML_seg if @@is1 == 1 @dc_creator=%{#{@md.dc_creator}\n} if @md.dc_creator.to_s =~/\S/ @@seg[:tocband_banner] << format_head_seg.navigation_band(@@segtocband,@@seg[:dot_nav]) - @@seg[:tocband_bannerless] << format_head_seg.navigation_band_bottom(@@segtocband,@@seg[:dot_nav]) + endnote_section_close=unless @@get_hash_fn =~/metadata/ + format_head_seg.endnote_section_close + else '' + end + @@seg[:tocband_bannerless] << endnote_section_close << format_head_seg.navigation_band_bottom(@@segtocband,@@seg[:dot_nav]) @@seg[:headers] << 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[:headers] << format_head_seg.title_banner(@md.title,@md.subtitle,@dc_creator).gsub(clean,'') paranum=if @@header1[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/]; $1 @@ -364,9 +370,12 @@ module SiSU_HTML_seg end def tail format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) - if @md.flag_auto_endnotes - @@seg[:tail] << format_head_seg.endnote_mark - @@seg[:tail] << @@seg_endnotes[@@get_hash_fn] #endnotes deposited at end of individual segments ||@|EXTRACTION OF ENDNOTES| + if @md.flag_auto_endnotes and @@seg_endnotes[@@get_hash_fn] + @@seg[:tail] << format_head_seg.endnote_section_open + if @@seg_endnotes[@@get_hash_fn].flatten.length > 0 + @@seg[:tail] << format_head_seg.endnote_mark + @@seg[:tail] << @@seg_endnotes[@@get_hash_fn].flatten #endnotes deposited at end of individual segments ||@|EXTRACTION OF ENDNOTES| + end end #@@seg[:tail] << '
 
' ads=SiSU_HTML_promo::Ad.new(@md) -- cgit v1.2.3 From 0ec2677657a7199d5210d9e013fe62334c83f71a Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 17 Aug 2008 01:18:19 -0400 Subject: html segments structure and info provided (a bit verbose), and css --- lib/sisu/v0/html_segments.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'lib/sisu/v0/html_segments.rb') diff --git a/lib/sisu/v0/html_segments.rb b/lib/sisu/v0/html_segments.rb index c4d136b7..db387105 100644 --- a/lib/sisu/v0/html_segments.rb +++ b/lib/sisu/v0/html_segments.rb @@ -221,11 +221,11 @@ module SiSU_HTML_seg if @@is1 == 1 @dc_creator=%{#{@md.dc_creator}\n} if @md.dc_creator.to_s =~/\S/ @@seg[:tocband_banner] << format_head_seg.navigation_band(@@segtocband,@@seg[:dot_nav]) - endnote_section_close=unless @@get_hash_fn =~/metadata/ - format_head_seg.endnote_section_close + conditional_div_close=unless @@get_hash_fn =~/metadata/ #watch + '
' else '' end - @@seg[:tocband_bannerless] << endnote_section_close << format_head_seg.navigation_band_bottom(@@segtocband,@@seg[:dot_nav]) + @@seg[:tocband_bannerless] << format_head_seg.navigation_band_bottom(@@segtocband,@@seg[:dot_nav]) @@seg[:headers] << 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[:headers] << format_head_seg.title_banner(@md.title,@md.subtitle,@dc_creator).gsub(clean,'') paranum=if @@header1[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/]; $1 @@ -270,6 +270,7 @@ module SiSU_HTML_seg end def markup(para) @debug=[] + para.gsub!(/(?:\s*#{Mx[:br_page]}\s*|\s*#{Mx[:br_page_new]}\s*)+/m,'') format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) if para !~/^#{Rx[:meta]}/ m=para[/.+?#{Mx[:id_o]}~(\d+);(?:[ohm]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/] @@ -386,9 +387,9 @@ module SiSU_HTML_seg filename_seg=[] filename_seg << @@seg[:title] << @@seg[:tocband_banner] if type !~/endnote/ - filename_seg << @@minitoc << @@seg[:main] + filename_seg << @@minitoc << @@seg[:headers] << @@seg[:main] else - filename_seg << @@seg[:header_endnotes] << @@minitoc << %{\n
\n} << @@seg[:endnote_all] + filename_seg << @@seg[:header_endnotes] << @@minitoc << @@seg[:headers] << %{\n
\n} << @@seg[:endnote_all] #<< '
' end filename_seg << @@seg[:tail] << @@seg[:tocband_bannerless] << @@seg[:credits] filename_seg.flatten!.compact! @@ -477,8 +478,8 @@ module SiSU_HTML_seg try.each do |e| format_seg=SiSU_HTML_Format::Format_seg.new(@md,e) note_match=if e =~/#{Mx[:pa_o]}i[1-9]#{Mx[:pa_c]}/ - format_seg.endnote_body_seg_tail_indent - else format_seg.endnote_body_seg_tail + format_seg.endnote_body_indent + else format_seg.endnote_body end @@seg_endnotes_array << note_match end -- cgit v1.2.3 From 5787bd8ec03e93e90dd90d5fbcb66bdb49a07a84 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 18 Aug 2008 23:41:37 -0400 Subject: a bit of a cleanup, and change reference to null to ordinary --- lib/sisu/v0/html_segments.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/sisu/v0/html_segments.rb') diff --git a/lib/sisu/v0/html_segments.rb b/lib/sisu/v0/html_segments.rb index db387105..7a4a4fb6 100644 --- a/lib/sisu/v0/html_segments.rb +++ b/lib/sisu/v0/html_segments.rb @@ -306,7 +306,7 @@ module SiSU_HTML_seg end if para[/#{Mx[:id_o]}~(\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp)#{Mx[:id_c]}$/] @sto=SiSU_HTML::Source::Split_text_object.new(@md,para).html_seg - format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,@sto.text) if @sto.format =~/i[1-9]|null/ #watch + format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,@sto.text) if @sto.format =~/i[1-9]|ordinary/ #watch para=case @sto.format # work area 2003w29 ||@|def lev_segname_para_ocn| when /^4:/; @sto.seg_lev_para_ocn.header4 # work on see Split_text_object when /^5:/; @sto.seg_lev_para_ocn.header5 @@ -323,7 +323,7 @@ module SiSU_HTML_seg @sto.seg_lev_para_ocn.para when /^code$/ @sto.seg_lev_para_ocn.code - when /null/ + when /ordinary/ if para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/ \ and para !~/^#{Mx[:gr_o]}TZ#{Mx[:gr_c]}/ format_txt_obj.gsub_body @@ -349,8 +349,6 @@ module SiSU_HTML_seg if para[/(.*)#{Mx[:id_o]}~0;(?:u|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}(.*)/] #% watch u & m? one,two=$1,$2 format_seg=SiSU_HTML_Format::Format_seg.new(@md,one,two) -#FIX --> not that undefined, rather is not needed, should not be visited, and remove - #para=format_seg.seg_no_paranum #% undefined end para.gsub!(/\s*(-\{{2}~\d+|<:e[:_]\d+>).*/,'') #potentially dagerous - removes all paragraphs with #?? workpoint if para =~/
 / #endnote- note- -- cgit v1.2.3 From 08c69d074001507d64cd5960c8679ec91a5a8353 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 23 Aug 2008 12:01:59 -0400 Subject: pass Hash to Format classes; some match tuning in dal --- lib/sisu/v0/html_segments.rb | 67 ++++++++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 27 deletions(-) (limited to 'lib/sisu/v0/html_segments.rb') diff --git a/lib/sisu/v0/html_segments.rb b/lib/sisu/v0/html_segments.rb index 7a4a4fb6..b457fe5c 100644 --- a/lib/sisu/v0/html_segments.rb +++ b/lib/sisu/v0/html_segments.rb @@ -228,41 +228,45 @@ module SiSU_HTML_seg @@seg[:tocband_bannerless] << format_head_seg.navigation_band_bottom(@@segtocband,@@seg[:dot_nav]) @@seg[:headers] << 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[:headers] << format_head_seg.title_banner(@md.title,@md.subtitle,@dc_creator).gsub(clean,'') - paranum=if @@header1[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/]; $1 + ocn=if @@header1[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/]; $1 else '' end - @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,paranum) - format_seg=SiSU_HTML_Format::Format_seg.new(@md,@@header1,@p_num.ocn_display) + @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,ocn) + txt_obj={:txt =>@@header1,:ocn_display =>@p_num.ocn_display} + format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) @@seg[:headers] << format_seg.title_header1.gsub(clean,'') @@header1.gsub!(/  [\d*+]+<\/sup> <\/a>/,'') end if @@is2 == 1 header2=@@header2 - paranum=if header2[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/]; $1 + ocn=if header2[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/]; $1 else '' end - @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,paranum) - format_seg=SiSU_HTML_Format::Format_seg.new(@md,header2,@p_num.ocn_display) + @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,ocn) + txt_obj={:txt =>header2,:ocn_display =>@p_num.ocn_display} + format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) @@seg[:headers] << format_seg.title_header2.gsub(clean,'') @@header2.gsub!(/  [\d*+]+<\/sup> <\/a>/,'') end if @@is3 == 1 header3=@@header3 - paranum=if header3[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/]; $1 + ocn=if header3[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/]; $1 else '' end - @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,paranum) - format_seg=SiSU_HTML_Format::Format_seg.new(@md,header3,@p_num.ocn_display) + @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,ocn) + txt_obj={:txt =>header3,:ocn_display =>@p_num.ocn_display} + format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) @@seg[:headers] << format_seg.title_header3.gsub(clean,'') @@header3.gsub!(/  [\d*+]+<\/sup> <\/a>/,'') end if @@is4 == 1 header4=@@header4 - paranum=if header4[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/]; $1 + ocn=if header4[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/]; $1 else '' end - @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,paranum) - format_seg=SiSU_HTML_Format::Format_seg.new(@md,header4,@p_num.ocn_display) + @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,ocn) + txt_obj={:txt =>header4,:ocn_display =>@p_num.ocn_display} + format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) @@seg[:headers] << format_seg.title_header4.gsub(clean,'') end @@seg[:header_endnotes]=format_head_seg.title_endnote(@md.title,@md.subtitle,@dc_creator,@@seg[:dot_nav]) @@ -275,8 +279,8 @@ module SiSU_HTML_seg if para !~/^#{Rx[:meta]}/ m=para[/.+?#{Mx[:id_o]}~(\d+);(?:[ohm]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/] if m - paranum=m[1].to_s - @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,paranum) + ocn=m[1].to_s + @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,ocn) end if para =~/#{Mx[:gr_o]}(?:code|alt|verse|group)#{Mx[:gr_c]}/m \ or @@flag_alt==true @@ -299,14 +303,18 @@ module SiSU_HTML_seg end if para !~/^#{Mx[:lv_o]}[1-9]:|#{Rx[:meta]}/ if para =~/(.*)#{Mx[:id_o]}~0;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}(.*)/ - one,two=$1,$2 - format_seg=SiSU_HTML_Format::Format_seg.new(@md,one,two) + cont="#{$1} #{$2}" #check where $2 is other than space + txt_obj={:txt =>cont} + format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) para=format_seg.no_paranum end end if para[/#{Mx[:id_o]}~(\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp)#{Mx[:id_c]}$/] @sto=SiSU_HTML::Source::Split_text_object.new(@md,para).html_seg - format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,@sto.text) if @sto.format =~/i[1-9]|ordinary/ #watch + if @sto.format =~/i[1-9]|ordinary/ #watch + txt_obj={:txt =>@sto.text} + format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,txt_obj) + end para=case @sto.format # work area 2003w29 ||@|def lev_segname_para_ocn| when /^4:/; @sto.seg_lev_para_ocn.header4 # work on see Split_text_object when /^5:/; @sto.seg_lev_para_ocn.header5 @@ -348,11 +356,13 @@ module SiSU_HTML_seg if para !~/#{@vz.margin_txt_w1}|#{@vz.margin_txt_w2}/ if para[/(.*)#{Mx[:id_o]}~0;(?:u|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}(.*)/] #% watch u & m? one,two=$1,$2 - format_seg=SiSU_HTML_Format::Format_seg.new(@md,one,two) + txt_obj={:txt =>$1.strip,:trailing =>$2.strip} + format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) end para.gsub!(/\s*(-\{{2}~\d+|<:e[:_]\d+>).*/,'') #potentially dagerous - removes all paragraphs with #?? workpoint if para =~/ / #endnote- note- - format_seg=SiSU_HTML_Format::Format_seg.new(@md,para) + txt_obj={:txt =>para} + format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) para=format_seg.no_paranum end end @@ -444,12 +454,12 @@ module SiSU_HTML_seg para.gsub!(/ <\/a>/,' ') case para # series changed 2002w42 when /^#{Mx[:lv_o]}5:\S*?#{Mx[:lv_c]}\s*(.+)?#{Mx[:id_o]}~(\d+);(?:h|[56]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/ #remove [u]? req by pg texts, revist - one,two=$1,$2 - format_seg=SiSU_HTML_Format::Format_seg.new(@md,one,two) + txt_obj={:txt =>$1.strip,:ocn =>$2} + format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) para=format_seg.subtoc_lev5 when /^#{Mx[:lv_o]}6:\S*?#{Mx[:lv_c]}\s*(.+)?#{Mx[:id_o]}~(\d+);(?:h|[56]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/ - one,two=$1,$2 - format_seg=SiSU_HTML_Format::Format_seg.new(@md,one,two) + txt_obj={:txt =>$1.strip,:ocn =>$2} + format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) para=format_seg.subtoc_lev6 end @@seg_subtoc_array << para @@ -474,7 +484,8 @@ module SiSU_HTML_seg e_n=note_match_seg[/(?:#{Mx[:en_a_o]}[\d*+]+|#{Mx[:en_b_o]}[*+]\d+)\s+(.+?)(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/m,1] try=e_n.split(/
/) try.each do |e| - format_seg=SiSU_HTML_Format::Format_seg.new(@md,e) + txt_obj={:txt =>e} + format_seg=SiSU_HTML_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 else format_seg.endnote_body @@ -484,9 +495,11 @@ module SiSU_HTML_seg try.join('
') #% creation of separate end segment/page of all endnotes referenced back to reference segment m=/(?:#{Mx[:en_a_o]}[\d*+]+|#{Mx[:en_b_o]}[*+]\d+)\s+(.+?href=")(#-[\d*+]+".+)(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/mi - one=note_match_seg[m,1] #note~ [a name] - two=note_match_seg[m,2] #note- - format_seg=SiSU_HTML_Format::Format_seg.new(@md,one,two) + 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) 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 From f1fe4547034011194e913ffd70820e1c4f39d6ba Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 24 Aug 2008 12:48:32 -0400 Subject: minitoc added, used by manifest and concordance; html css div sorting a earlier commit relies on minitoc prior to its addition, this fixes that issue html css divs, need to be watched across different html output --- lib/sisu/v0/html_segments.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/sisu/v0/html_segments.rb') diff --git a/lib/sisu/v0/html_segments.rb b/lib/sisu/v0/html_segments.rb index b457fe5c..11c95755 100644 --- a/lib/sisu/v0/html_segments.rb +++ b/lib/sisu/v0/html_segments.rb @@ -221,11 +221,11 @@ module SiSU_HTML_seg if @@is1 == 1 @dc_creator=%{#{@md.dc_creator}\n} if @md.dc_creator.to_s =~/\S/ @@seg[:tocband_banner] << format_head_seg.navigation_band(@@segtocband,@@seg[:dot_nav]) - conditional_div_close=unless @@get_hash_fn =~/metadata/ #watch + conditional_div_close=if @@get_hash_fn =~/metadata/ #watch '
' else '' end - @@seg[:tocband_bannerless] << format_head_seg.navigation_band_bottom(@@segtocband,@@seg[:dot_nav]) + @@seg[:tocband_bannerless] << conditional_div_close << format_head_seg.navigation_band_bottom(@@segtocband,@@seg[:dot_nav]) @@seg[:headers] << 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[:headers] << format_head_seg.title_banner(@md.title,@md.subtitle,@dc_creator).gsub(clean,'') ocn=if @@header1[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/]; $1 @@ -380,11 +380,13 @@ module SiSU_HTML_seg def tail format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) if @md.flag_auto_endnotes and @@seg_endnotes[@@get_hash_fn] - @@seg[:tail] << format_head_seg.endnote_section_open + @@seg[:tail] << '
' if @@seg_endnotes[@@get_hash_fn].flatten.length > 0 @@seg[:tail] << format_head_seg.endnote_mark @@seg[:tail] << @@seg_endnotes[@@get_hash_fn].flatten #endnotes deposited at end of individual segments ||@|EXTRACTION OF ENDNOTES| end + @@seg[:tail] << '
' + @@seg[:tail] << '
' #this div closes div class content end #@@seg[:tail] << '
 
' ads=SiSU_HTML_promo::Ad.new(@md) @@ -397,7 +399,7 @@ module SiSU_HTML_seg if type !~/endnote/ filename_seg << @@minitoc << @@seg[:headers] << @@seg[:main] else - filename_seg << @@seg[:header_endnotes] << @@minitoc << @@seg[:headers] << %{\n
\n} << @@seg[:endnote_all] #<< '
' + filename_seg << @@seg[:header_endnotes] << @@minitoc << @@seg[:headers] << %{\n
\n} << @@seg[:endnote_all] #<< '
' << '' end filename_seg << @@seg[:tail] << @@seg[:tocband_bannerless] << @@seg[:credits] filename_seg.flatten!.compact! -- cgit v1.2.3 From b2ef41078f8704e16c589063cde225874a3069f9 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 2 Sep 2008 23:23:12 -0400 Subject: html segments; sql db field lengths increased --- lib/sisu/v0/html_segments.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/sisu/v0/html_segments.rb') diff --git a/lib/sisu/v0/html_segments.rb b/lib/sisu/v0/html_segments.rb index 11c95755..8d89de28 100644 --- a/lib/sisu/v0/html_segments.rb +++ b/lib/sisu/v0/html_segments.rb @@ -195,7 +195,6 @@ module SiSU_HTML_seg end end end - @@seg[:main] << "\n\n" data end def header_art(para) @@ -380,7 +379,7 @@ module SiSU_HTML_seg def tail format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) if @md.flag_auto_endnotes and @@seg_endnotes[@@get_hash_fn] - @@seg[:tail] << '
' + @@seg[:tail] << %{\n
\n
\n} if @@seg_endnotes[@@get_hash_fn].flatten.length > 0 @@seg[:tail] << format_head_seg.endnote_mark @@seg[:tail] << @@seg_endnotes[@@get_hash_fn].flatten #endnotes deposited at end of individual segments ||@|EXTRACTION OF ENDNOTES| @@ -397,9 +396,9 @@ module SiSU_HTML_seg filename_seg=[] filename_seg << @@seg[:title] << @@seg[:tocband_banner] if type !~/endnote/ - filename_seg << @@minitoc << @@seg[:headers] << @@seg[:main] + filename_seg << @@minitoc << @@seg[:headers] << @@seg[:main] << "\n
\n" else - filename_seg << @@seg[:header_endnotes] << @@minitoc << @@seg[:headers] << %{\n
\n} << @@seg[:endnote_all] #<< '
' << '
' + filename_seg << @@seg[:header_endnotes] << @@minitoc << @@seg[:headers] << %{\n
\n} << @@seg[:endnote_all] << '
' end filename_seg << @@seg[:tail] << @@seg[:tocband_bannerless] << @@seg[:credits] filename_seg.flatten!.compact! -- cgit v1.2.3 From 291080c0495f59f031bf5c0de2482f1bc7df59f2 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 10 Sep 2008 21:24:31 -0400 Subject: primarily on book index where (markup) provided * book index, html, tex/pdf, xml * texpdf no ocn if ocn is 0 * odf, plaintext, if book index? remove ... do other outputs for which not relevant * concordance, better matches * constants, dal special character for hardspace changed as (ruby) regx bug in replacing it in xml, odd but move on Note: to fix html seg headers for endnotes and for index --- lib/sisu/v0/html_segments.rb | 86 ++++++++++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 34 deletions(-) (limited to 'lib/sisu/v0/html_segments.rb') diff --git a/lib/sisu/v0/html_segments.rb b/lib/sisu/v0/html_segments.rb index 8d89de28..796c3939 100644 --- a/lib/sisu/v0/html_segments.rb +++ b/lib/sisu/v0/html_segments.rb @@ -62,14 +62,43 @@ module SiSU_HTML_seg require "#{SiSU_lib}/shared_html" require "#{SiSU_lib}/html" require "#{SiSU_lib}/html_promo" + class Seg_output + def initialize(outputfile,seg,minitoc,type='') + @output_seg_file,@seg,@minitoc,@type=outputfile,seg,minitoc,type + end + def output #CONSIDER + if @seg[:title] =~/\S/ #kludge (for exception file better.ways, how ironic) get a real ruby test, e.g. test that not array or... + filename_seg=[] + filename_seg << @seg[:title] << @seg[:tocband_banner] + if @type =~/endnote/ +#p @seg[:headers] #FIX endnote header + filename_seg << @seg[:header_endnotes] << @minitoc << @seg[:headers] << %{\n
\n} << @seg[:endnote_all] << '
' # << '
' + elsif @type =~/idx/ +#p @seg[:headers] #FIX inserted index header + filename_seg << @seg[:header_idx] << @minitoc << @seg[:headers] << %{\n
\n} << @seg[:idx] << '
' # << '' + else + filename_seg << @minitoc << @seg[:headers] << @seg[:main] << "\n\n" + end + filename_seg << @seg[:tail] << @seg[:tocband_bannerless] << @seg[:credits] + filename_seg.flatten!.compact! + filename_seg.each do |para| + unless para =~/\A\s*\Z/ + para.strip! + @output_seg_file << para + end + end + @output_seg_file.close + end + end + end class Seg @@seg,@@seg_subtoc,@@seg_endnotes,@@seg_ad={},{},{},{} - @@seg_name,@@seg_name_html,@@seg_name_php=[],[],[] - @@filename_seg=@@filename_segphp=@@seg_url=@@fn=@@to_lev4=@@get_hash_to=@@get_hash_fn='' + @@seg_name,@@seg_name_html=[],[] + @@seg_url=@@fn=@@to_lev4=@@get_hash_to=@@get_hash_fn='' @@loop_count=@@seg_total=@@tracker=0 @@is4=@@is3=@@is2=@@is1=0 @@header1=@@header2=@@header3=@@header4=0 - @@seg[:tocband_banner],@@seg[:tocband_bannerless],@@seg[:title],@@seg[:headers],@@seg[:main],@@seg[:tail],@@seg[:credits],@@seg_subtoc_array,@@seg_endnotes_array,@@seg[:endnote_all]=Array.new(10){[]} + @@seg[:tocband_banner],@@seg[:tocband_bannerless],@@seg[:title],@@seg[:headers],@@seg[:main],@@seg[:idx],@@seg[:tail],@@seg[:credits],@@seg_subtoc_array,@@seg_endnotes_array,@@seg[:endnote_all]=Array.new(11){[]} @@seg[:header_endnotes]='' @@tablehead,@@number_of_cols=0,0 @@flag_alt=false @@ -85,7 +114,7 @@ module SiSU_HTML_seg end def songsheet begin - @@minitoc=SiSU_HTML::Source::Toc.new(@data,@md).minitoc + @minitoc=SiSU_HTML::Source::Toc.new(@data,@md).minitoc data=get_subtoc_endnotes(@data) data=articles(data) Seg.new.cleanup # (((( added )))) @@ -103,6 +132,13 @@ module SiSU_HTML_seg @h_sfx='.php' if @md.file_type =~/php/ @h_sfx=@md.sfx if @md.file_type =~/html/ @h_sfx='.html' if @md.file_type =~/html/ #used in creating file, not to be omitted. + idx_html=nil + if @md.book_index + my_make_source_file=SiSU_Env::Create_file.new(@md.cmd,@md.fns) + idx_html=SiSU_Particulars::Combined_singleton.instance.get_html_idx(@md.opt).html_idx + idx_html.each {|x| @@seg[:idx] << x } + @@seg[:header_idx]='' + end data.each do |para| if para =~/^#{Mx[:lv_o]}4:/ @@seg_name << para[/^#{Mx[:lv_o]}4:(\S+?)#{Mx[:lv_c]}/,1] @@ -153,20 +189,24 @@ module SiSU_HTML_seg mkdir_p(@md.dir_out) unless FileTest.directory?(@md.dir_out) #bug - added specifically for nav! not needed by regular seg, check !!! Seg.new('',@md).tail segfilename="#{@md.dir_out}/#{@md.fnl[:pre]}#{@@seg_name_html[tracking-1]}#{@md.fnl[:mid]}#@h_sfx#{@md.fnl[:post]}" - @@filename_seg=File.new(segfilename,'w') if @@seg_name_html[tracking-1] - unless (@@seg_name_html[tracking-1] =~/endnotes/) - Seg.new.output - else Seg.new.output('endnotes') + @output_seg_file=File.new(segfilename,'w') if @@seg_name_html[tracking-1] + if @@seg_name_html[tracking-1] !~/endnotes|idx/ + Seg_output.new(@output_seg_file,@@seg,@minitoc).output + elsif @@seg_name_html[tracking-1] =~/endnotes/ + Seg_output.new(@output_seg_file,@@seg,@minitoc,'endnotes').output + elsif @@seg_name_html[tracking-1] =~/idx/ + Seg_output.new(@output_seg_file,@@seg,@minitoc,'idx').output + else p 'check' end Seg.new.reinitialise header_art(para) head(para) if @@seg_name_html[tracking] =~/metadata/ # this is for metadata segfilename="#{@md.dir_out}/#{@md.fnl[:pre]}#{@@seg_name_html[tracking]}#{@md.fnl[:mid]}#@h_sfx#{@md.fnl[:post]}" - @@filename_seg=File.new(segfilename,'w') - Seg.new.reinitialise + @output_seg_file=File.new(segfilename,'w') + Seg.new.reinitialise #BUG with items following endnote, and occurring before metadata, this becomes a bug ... work area for book index, FIX flagend="x" - @@filename_seg.close #%(((( EOF )))) --> + @output_seg_file.close #%(((( EOF )))) --> end end if tracking == 0 @@ -391,26 +431,6 @@ module SiSU_HTML_seg ads=SiSU_HTML_promo::Ad.new(@md) @@seg[:credits] << format_head_seg.credit << ads.div.close << ads.display << format_head_seg.html_close end - def output(type='') - if @@seg[:title] =~/\S/ #kludge (for exception file better.ways, how ironic) get a real ruby test, e.g. test that not array or... - filename_seg=[] - filename_seg << @@seg[:title] << @@seg[:tocband_banner] - if type !~/endnote/ - filename_seg << @@minitoc << @@seg[:headers] << @@seg[:main] << "\n\n" - else - filename_seg << @@seg[:header_endnotes] << @@minitoc << @@seg[:headers] << %{\n
\n} << @@seg[:endnote_all] << '
' - end - filename_seg << @@seg[:tail] << @@seg[:tocband_bannerless] << @@seg[:credits] - filename_seg.flatten!.compact! - filename_seg.each do |para| - unless para =~/\A\s*\Z/ - para.strip! - @@filename_seg << para - end - end - @@filename_seg.close - end - end def reinitialise @@seg[:title],@@seg[:dot_nav],@@seg[:tocband_banner],@@seg[:tocband_bannerless],@@seg[:headers],@@seg[:main],@@seg[:tail],@@seg[:credits]=Array.new(8){[]} @@segtocband=nil @@ -433,11 +453,9 @@ module SiSU_HTML_seg @@seg_endnotes_array=[] if para=~/^#{Mx[:lv_o]}4:/ @@fns_previous=@md.fns if para=~/^#{Mx[:lv_o]}1:meta#{Mx[:lv_c]}/ end - if para =~/^#{Mx[:lv_o]}4:/ #% EXTRACTION OF SUB-TOCs + if para =~/^#{Mx[:lv_o]}4:/ #% EXTRACTION OF SUB-TOCs & SEGMENT NAME, after EXTRACTION OF ENDNOTES & SUB-TOCs @@seg_subtoc[@@fn]=@@seg_subtoc_array @@seg_subtoc_array=[] - end - if para =~/^#{Mx[:lv_o]}4:/ #% SEGMENT NAME, after EXTRACTION OF ENDNOTES & SUB-TOCs if para !~/^#{Mx[:lv_o]}4:metadata#{Mx[:lv_c]}/ m=para[/^#{Mx[:lv_o]}4:(\S+?)#{Mx[:lv_c]}.+?#{Mx[:id_o]}~(\d+);(?:[oh]|4:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/] end -- cgit v1.2.3 From 87a7cfcd56eed6746b1500c88df3fc3e76a81668 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 15 Sep 2008 21:52:19 -0400 Subject: various small fixes * html segments, name more accurately * rough description of how book index markup works * clean out book index from these outputs * book markup sample, free as in freedom, start doing book index, only letter "A" done so far * texpdf, url matching, special characters * # Please enter the commit message for your changes. --- lib/sisu/v0/html_segments.rb | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'lib/sisu/v0/html_segments.rb') diff --git a/lib/sisu/v0/html_segments.rb b/lib/sisu/v0/html_segments.rb index 796c3939..a280a8c8 100644 --- a/lib/sisu/v0/html_segments.rb +++ b/lib/sisu/v0/html_segments.rb @@ -63,18 +63,28 @@ module SiSU_HTML_seg require "#{SiSU_lib}/html" require "#{SiSU_lib}/html_promo" class Seg_output - def initialize(outputfile,seg,minitoc,type='') - @output_seg_file,@seg,@minitoc,@type=outputfile,seg,minitoc,type + def initialize(md,outputfile,seg,minitoc,type='') + @md,@output_seg_file,@seg,@minitoc,@type=md,outputfile,seg,minitoc,type end def output #CONSIDER - if @seg[:title] =~/\S/ #kludge (for exception file better.ways, how ironic) get a real ruby test, e.g. test that not array or... + if @seg[:title] =~/\S/ filename_seg=[] filename_seg << @seg[:title] << @seg[:tocband_banner] if @type =~/endnote/ -#p @seg[:headers] #FIX endnote header + @seg[:headers]=[] + format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) + @seg[:headers] << format_head_seg.title_banner(@md.title,@md.subtitle,@dc_creator) + txt_obj={:txt =>'Endnotes',:ocn_display =>''} + format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) + @seg[:headers] << format_seg.title_header1 filename_seg << @seg[:header_endnotes] << @minitoc << @seg[:headers] << %{\n
\n} << @seg[:endnote_all] << '
' # << '' elsif @type =~/idx/ -#p @seg[:headers] #FIX inserted index header + @seg[:headers]=[] + format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) + @seg[:headers] << format_head_seg.title_banner(@md.title,@md.subtitle,@dc_creator) + txt_obj={:txt =>'Index',:ocn_display =>''} + format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) + @seg[:headers] << format_seg.title_header1 filename_seg << @seg[:header_idx] << @minitoc << @seg[:headers] << %{\n
\n} << @seg[:idx] << '
' # << '' else filename_seg << @minitoc << @seg[:headers] << @seg[:main] << "\n\n" @@ -191,11 +201,11 @@ module SiSU_HTML_seg segfilename="#{@md.dir_out}/#{@md.fnl[:pre]}#{@@seg_name_html[tracking-1]}#{@md.fnl[:mid]}#@h_sfx#{@md.fnl[:post]}" @output_seg_file=File.new(segfilename,'w') if @@seg_name_html[tracking-1] if @@seg_name_html[tracking-1] !~/endnotes|idx/ - Seg_output.new(@output_seg_file,@@seg,@minitoc).output + Seg_output.new(@md,@output_seg_file,@@seg,@minitoc).output elsif @@seg_name_html[tracking-1] =~/endnotes/ - Seg_output.new(@output_seg_file,@@seg,@minitoc,'endnotes').output + Seg_output.new(@md,@output_seg_file,@@seg,@minitoc,'endnotes').output elsif @@seg_name_html[tracking-1] =~/idx/ - Seg_output.new(@output_seg_file,@@seg,@minitoc,'idx').output + Seg_output.new(@md,@output_seg_file,@@seg,@minitoc,'idx').output else p 'check' end Seg.new.reinitialise -- cgit v1.2.3