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 --- CHANGELOG | 13 +- conf/sisu/version.yml | 6 +- lib/sisu/v0/concordance.rb | 6 +- lib/sisu/v0/html.rb | 74 +++--- lib/sisu/v0/html_format.rb | 555 +++++++++++++++++++++++++++++++++++----- lib/sisu/v0/html_format_css.rb | 469 --------------------------------- lib/sisu/v0/html_scroll.rb | 16 +- lib/sisu/v0/html_segments.rb | 44 ++-- lib/sisu/v0/shared_structure.rb | 6 +- 9 files changed, 576 insertions(+), 613 deletions(-) delete mode 100644 lib/sisu/v0/html_format_css.rb diff --git a/CHANGELOG b/CHANGELOG index 84867947..0b081f64 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,15 +9,18 @@ Reverse Chronological: %% STABLE MANIFEST -%% sisu_0.68.1.orig.tar.gz (2008-08-12:32/2) -http://www.jus.uio.no/sisu/pkg/src/sisu_0.68.1.orig.tar.gz - sisu_0.68.1.orig.tar.gz - sisu_0.68.1-1.dsc - sisu_0.68.1-1.diff.gz +%% sisu_0.69.0.orig.tar.gz (2008-08-14:32/4) +http://www.jus.uio.no/sisu/pkg/src/sisu_0.69.0.orig.tar.gz + sisu_0.69.0.orig.tar.gz + sisu_0.69.0-1.dsc + sisu_0.69.0-1.diff.gz * middle layer, url representation * html increased use of css, includes segmented html minitoc + necessary to re-initialise sisu output directory with new css files + [version number bump] + sisu -CC %% sisu_0.68.0.orig.tar.gz (2008-07-22:29/2) http://www.jus.uio.no/sisu/pkg/src/sisu_0.68.0.orig.tar.gz diff --git a/conf/sisu/version.yml b/conf/sisu/version.yml index 26045409..7e7b8d10 100644 --- a/conf/sisu/version.yml +++ b/conf/sisu/version.yml @@ -1,5 +1,5 @@ --- -:version: 0.68.1-beta -:date_stamp: 2008w32/2 -:date: "2008-08-12" +:version: 0.69.0-beta +:date_stamp: 2008w32/4 +:date: "2008-08-14" :project: SiSU diff --git a/lib/sisu/v0/concordance.rb b/lib/sisu/v0/concordance.rb index f62b20ac..3e073900 100644 --- a/lib/sisu/v0/concordance.rb +++ b/lib/sisu/v0/concordance.rb @@ -66,7 +66,7 @@ module SiSU_Concordance include SiSU_Env require "#{SiSU_lib}/defaults" include SiSU_Viz - require "#{SiSU_lib}/html_format_css" + require "#{SiSU_lib}/html_format" include SiSU_HTML_Format class Source def initialize(opt) @@ -120,7 +120,7 @@ module SiSU_Concordance WOK end def create - head_banner=SiSU_HTML_Format_type::Head_toc.new(@md) + head_banner=SiSU_HTML_Format::Head_toc.new(@md) < @@ -171,7 +171,7 @@ WOK class Words require "#{SiSU_lib}/defaults" include SiSU_Viz - require "#{SiSU_lib}/html_format_css" + require "#{SiSU_lib}/html_format" include SiSU_HTML_Format require "#{SiSU_lib}/sysenv" include SiSU_Screen diff --git a/lib/sisu/v0/html.rb b/lib/sisu/v0/html.rb index 5f0d0de9..e882627c 100644 --- a/lib/sisu/v0/html.rb +++ b/lib/sisu/v0/html.rb @@ -65,8 +65,8 @@ module SiSU_HTML require "#{SiSU_lib}/defaults" include SiSU_Viz require "#{SiSU_lib}/html_table" - require "#{SiSU_lib}/html_format_css" - include SiSU_HTML_Format_type + require "#{SiSU_lib}/html_format" + include SiSU_HTML_Format require "#{SiSU_lib}/html_segments" require "#{SiSU_lib}/html_scroll" include SiSU_HTML_seg @@ -190,7 +190,7 @@ module SiSU_HTML end def toc @links_guide_toc=[] - format_head_toc=SiSU_HTML_Format_type::Head_toc.new(@md) + format_head_toc=SiSU_HTML_Format::Head_toc.new(@md) guide_type='horzontal' #values: horizontal or vertical @links_guide_toc << format_head_toc.links_guide_open(guide_type) if defined? @md.lnk \ @@ -201,24 +201,24 @@ module SiSU_HTML else '_top' end s_lnk_url,s_lnk_lnk=l[:url],l[:say] - lev_para_ocn=SiSU_HTML_Format_type::Format_toc.new(@md,s_lnk_url,s_lnk_lnk,target) + lev_para_ocn=SiSU_HTML_Format::Format_toc.new(@md,s_lnk_url,s_lnk_lnk,target) @links_guide_toc << lev_para_ocn.links_guide if s_lnk_lnk end end end - format_head_toc=SiSU_HTML_Format_type::Head_toc.new(@md) + format_head_toc=SiSU_HTML_Format::Head_toc.new(@md) @links_guide_toc << format_head_toc.links_guide_close #(guide_type) @links_guide_toc end end class Endnotes - include SiSU_HTML_Format_type + include SiSU_HTML_Format def initialize(data,md) @data,@md=data,md end def scroll @scr_endnotes=[] - format_head_scroll=SiSU_HTML_Format_type::Head_scroll.new(@md) + format_head_scroll=SiSU_HTML_Format::Head_scroll.new(@md) @scr_endnotes << format_head_scroll.title_endnote @data.each do |para| pg=para.dup @@ -236,7 +236,7 @@ module SiSU_HTML endnote_array << pg.scan(/#{Mx[:en_b_o]}[\d+]+(.+?)#{Mx[:en_b_c]}/m) end endnote_array.flatten.each do |note| - format_scroll=SiSU_HTML_Format_type::Format_scroll.new(@md,note) + format_scroll=SiSU_HTML_Format::Format_scroll.new(@md,note) @scr_endnotes << format_scroll.endnote_body end end @@ -314,24 +314,24 @@ WOK end def level_doc_owner_details if @md.stmp =~/\w\w/ - format_head_scroll=SiSU_HTML_Format_type::Head_scroll.new(@md) + format_head_scroll=SiSU_HTML_Format::Head_scroll.new(@md) @@toc[:scr] << format_head_scroll.toc_owner_details end end def level_endnotes if @md.flag_endnotes - format_head_scroll=SiSU_HTML_Format_type::Head_scroll.new(@md) + format_head_scroll=SiSU_HTML_Format::Head_scroll.new(@md) @@toc[:scr] << format_head_scroll.toc_endnote end end def level_metadata - format_head_toc=SiSU_HTML_Format_type::Head_toc.new(@md) + format_head_toc=SiSU_HTML_Format::Head_toc.new(@md) @@toc[:scr] << format_head_toc.metadata @@toc[:seg] << format_head_toc.seg_metadata @@toc[:seg_mini] << format_head_toc.mini_seg_metadata end def level_word_index - format_head_toc=SiSU_HTML_Format_type::Head_toc.new(@d0c) + format_head_toc=SiSU_HTML_Format::Head_toc.new(@d0c) @@toc[:scr] << format_head_toc.concordance @@toc[:seg] << format_head_toc.concordance @@toc[:seg_mini] << format_head_toc.mini_concordance @@ -345,7 +345,7 @@ WOK linkname,link=$1.strip,$2 if $& if link \ and link !~/#/ #% keep eye on link - p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,link) + p_num=SiSU_HTML_Format::Paragraph_number.new(@md,link) end title=unless para =~/Document Information/; linkname else @@ -353,7 +353,7 @@ WOK %{#{linkname}} end toc={} - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title) + format_toc=SiSU_HTML_Format::Format_toc.new(@md,title) toc[:seg]=if para =~/^#{Mx[:lv_o]}\d:meta^#{Mx[:lv_c]}\s*Document Information/ format_toc.lev0 else format_toc.lev1 @@ -376,7 +376,7 @@ WOK end %{#{linkname}} end - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title) + format_toc=SiSU_HTML_Format::Format_toc.new(@md,title) toc[:scr]=if para =~/^#{Mx[:lv_o]}\d:meta^#{Mx[:lv_c]}\s*Document Information/ format_toc.lev0 else format_toc.lev1 @@ -392,9 +392,9 @@ WOK linkname,link=$1.strip,$2 if $& if link \ and link !~/#/ - p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,link) + p_num=SiSU_HTML_Format::Paragraph_number.new(@md,link) end - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,linkname) + format_toc=SiSU_HTML_Format::Format_toc.new(@md,linkname) toc={} toc[:seg]=format_toc.lev2 toc[:seg_mini]=format_toc.mini_lev2 @@ -404,7 +404,7 @@ WOK title=linkname else title=%{#{p_num.goto}#{linkname}} end - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title) + format_toc=SiSU_HTML_Format::Format_toc.new(@md,title) toc[:scr]=format_toc.lev2 toc end @@ -416,9 +416,9 @@ WOK linkname,link=$1.strip,$2 if $& if link \ and link !~/#/ - p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,link) + p_num=SiSU_HTML_Format::Paragraph_number.new(@md,link) end - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,linkname) + format_toc=SiSU_HTML_Format::Format_toc.new(@md,linkname) toc={} toc[:seg]=format_toc.lev3 toc[:seg_mini]=format_toc.mini_lev3 @@ -428,7 +428,7 @@ WOK title=linkname else title=%{#{p_num.goto}#{linkname}} end - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title) + format_toc=SiSU_HTML_Format::Format_toc.new(@md,title) toc[:scr]=format_toc.lev3 toc end @@ -439,7 +439,7 @@ WOK para.gsub!(@pat_strip_heading_name,'\1') para[@pat_heading] linkname,link=$1.strip,$2 if $& - p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,link) if link + p_num=SiSU_HTML_Format::Paragraph_number.new(@md,link) if link end para.gsub!(/#{Mx[:id_o]}~0;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/,'') if para =~/^#{Mx[:lv_o]}4:/ @@ -457,8 +457,8 @@ WOK %{\\1 \\2 \\3 }) end - p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,link) if link - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,seg_link) + p_num=SiSU_HTML_Format::Paragraph_number.new(@md,link) if link + format_toc=SiSU_HTML_Format::Format_toc.new(@md,seg_link) toc={} toc[:seg]=format_toc.lev4 toc[:seg_mini]=format_toc.mini_lev4 @@ -468,7 +468,7 @@ WOK title=linkname else title=%{#{p_num.goto}#{linkname}} if p_num end - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title) + format_toc=SiSU_HTML_Format::Format_toc.new(@md,title) toc[:scr]=format_toc.lev4 toc end @@ -482,7 +482,7 @@ WOK linkname,link=$1.strip,$2 if $& if link \ and link !~/#/ - p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,link) + p_num=SiSU_HTML_Format::Paragraph_number.new(@md,link) end toc={} if para =~/#{Mx[:id_o]}~0;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/ @@ -493,12 +493,12 @@ WOK lnk_n_txt=%{ #{linkname} } - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,lnk_n_txt) + format_toc=SiSU_HTML_Format::Format_toc.new(@md,lnk_n_txt) toc[:seg]=format_toc.lev5 toc[:seg_mini]=format_toc.mini_lev5 title=%{#{p_num.goto}#{linkname}} end - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title) + format_toc=SiSU_HTML_Format::Format_toc.new(@md,title) toc[:scr]=format_toc.lev5 toc end @@ -511,7 +511,7 @@ WOK linkname,link=$1.strip,$2 if $& if link \ and link !~/#/ - p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,link) + p_num=SiSU_HTML_Format::Paragraph_number.new(@md,link) end toc={} if para =~/#{Mx[:id_o]}~0;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/ @@ -522,12 +522,12 @@ WOK lnk_n_txt=%{ #{linkname} } - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,lnk_n_txt) + format_toc=SiSU_HTML_Format::Format_toc.new(@md,lnk_n_txt) toc[:seg]=format_toc.lev6 toc[:seg_mini]=format_toc.mini_lev6 title=%{#{p_num.goto}#{linkname}} end - format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title) + format_toc=SiSU_HTML_Format::Format_toc.new(@md,title) toc[:scr]=format_toc.lev6 toc end @@ -564,14 +564,14 @@ WOK toc_shared=[] @segtoc=[] SiSU_Screen::Ansi.new(@md.cmd,'Scroll & Segtoc').txt_grey unless @md.cmd =~/q/ - format_head_toc=SiSU_HTML_Format_type::Head_toc.new(@md) + format_head_toc=SiSU_HTML_Format::Head_toc.new(@md) dochead=format_head_toc.head dochead.gsub!(/toc\.(html)/,'doc.\1') #kludge ads=SiSU_HTML_promo::Ad.new(@md) toc_shared << dochead << ads.div.major @segtoc << format_head_toc.head << ads.div.major - toc_shared << format_head_toc.toc_head_escript if SiSU_HTML_Format_type::Head_toc.method_defined? :toc_head_escript - @segtoc << format_head_toc.toc_head_escript if SiSU_HTML_Format_type::Head_toc.method_defined? :toc_head_escript + toc_shared << format_head_toc.toc_head_escript if SiSU_HTML_Format::Head_toc.method_defined? :toc_head_escript + @segtoc << format_head_toc.toc_head_escript if SiSU_HTML_Format::Head_toc.method_defined? :toc_head_escript toc_shared << format_head_toc.scroll_head_navigation_band if @md.dc_rights rights=format_head_toc.rights @@ -588,20 +588,20 @@ WOK tmp_head=nil doc_title_endnote=@md.title.gsub(/(\*+)/,'\1') tmp_head=doc_title_endnote + "\n" - format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,tmp_head) + format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,tmp_head) toc_shared << format_txt_obj.center_bold @segtoc << format_txt_obj.center_bold if not @md.subtitle.nil? \ and not @md.subtitle.empty? tmp_head=@md.subtitle + "\n" - format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,tmp_head) + format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,tmp_head) toc_shared << format_txt_obj.center_bold @segtoc << format_txt_obj.center_bold end if @md.dc_creator creator_endnote=@md.dc_creator.gsub(/(\*+)/,%{ \\1}) tmp_head=creator_endnote + "\n" - format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,tmp_head) + format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,tmp_head) toc_shared << format_txt_obj.center_bold @segtoc << format_txt_obj.center_bold end diff --git a/lib/sisu/v0/html_format.rb b/lib/sisu/v0/html_format.rb index 8b6fc28a..87988ec1 100644 --- a/lib/sisu/v0/html_format.rb +++ b/lib/sisu/v0/html_format.rb @@ -55,7 +55,7 @@ - ** Description: base formatting template for html generation + ** Description: html formating, css template =end module SiSU_HTML_Format @@ -98,7 +98,8 @@ module SiSU_HTML_Format class Paragraph_id_ocn #used by table version #work area 2003w48 attr_accessor :paranum,:font,:p_num def initialize(md,paranum) - @paranum,@vz,@p_num=paranum,SiSU_Env::Get_init.instance.skin,SiSU_HTML_Format::Paragraph_number.new(md,paranum) #font + @paranum,@vz,@p_num=paranum,SiSU_Env::Get_init.instance.skin,Paragraph_number.new(md,paranum) #font + #@paranum,@vz,@p_num=paranum,SiSU_Env::Get_init.instance.skin,SiSU_HTML_Format::Paragraph_number.new(md,paranum) #font end def txt %{

#{@p_num.name} @@ -140,7 +141,6 @@ module SiSU_HTML_Format end class Head_information include SiSU_Viz - include SiSU_HTML_Format attr_reader :md,:sfx,:pdf,:rdf,:vz def initialize(md='') @md=md @@ -184,6 +184,10 @@ module SiSU_HTML_Format #{@vz.txt_home} } end + def html_close #moved + %{ +} + end end class Widget < Head_information def initialize(md) @@ -268,6 +272,8 @@ module SiSU_HTML_Format end end end + class XML + end class Head_toc < Head_information def initialize(md) super(md) @@ -397,16 +403,30 @@ WOK #{@md.html_title} - - #{@rdf.rdftoc} - #{@rdf.metatag_html} - #{@vz.font_css_table_file} + +#{@rdf.rdftoc} +#{@rdf.metatag_html} +#{@css.html} #{@vz.color_body} - - - - #{@vz.js_top}} + + + +#{@vz.js_top}} + end + def concordance + if @md.concord_make + %{#{@vz.margin_css} +

+ + Concordance + +

+#{@vz.table_close}} + else + %{#{@vz.margin_css} +#{@vz.table_close}} + end end def links_guide_vertical_open #??? url=(defined? @vz.url_hp) && @vz.url_hp =~/^http:\/\/\S+$/ ? @vz.url_hp : @vz.url_home @@ -539,15 +559,12 @@ WOK #{@vz.table_close}} end def metadata - %{#{@vz.margin_txt_3} -#{@vz.paragraph_font_small} - - MetaData - -     - - - + %{#{@vz.margin_css} +

+ + MetaData + +

#{@vz.table_close}} end def seg_metadata @@ -602,48 +619,8 @@ WOK } end end - def html_close - %{ -} - end - class Head_scroll < Head_toc - def initialize(md) - super(md) - end - def toc_owner_details - %{#{@vz.margin_txt_3} -#{@vz.paragraph_font_small} - - Owner Details - -     - - - -#{@vz.table_close}} - end - def table - %{ - -
- -#{@vz.paragraph_txt}} - end - def table1 - %{ -
-#{@vz.paragraph_txt}} - end - def table2 - %{ -
-#{@vz.paragraph_txt}} - end - def title_endnote - end - end class Head_seg < Head_information - def initialize(md) + def initialize(md) #(md='') super(md) end def head @@ -817,6 +794,21 @@ WOK #{@vz.table_close}} end def title_endnote(title,subtitle,creator,table_top_control) +# %{#{@vz.banner_instrument_cover_band_seg} +#

+# #{title} +#

+#

+# #{subtitle} +#

+#

+# #{creator} +#

+# +##{@vz.table_close} +#

Endnotes

} end def navigation_table %{ @@ -918,6 +910,135 @@ WOK %{

} #revisit end + def head + %{#{doc_type} + + + #{@seg_name_html[@seg_name_html_tracker]} - + #{@md.html_title} + + +#{@rdf.rdfseg} +#{@rdf.metatag_html} +#{@css.html} + +#{@vz.color_body} + + + +#{@vz.js_top}} + end + def toc_metadata + @metalink=%{./#{@md.fn[:meatadata]}} + toc_metadata + end + def title_banner(title,subtitle,creator) + %{

+ #{title} +

+

+ #{subtitle} +

+

+ #{creator} +

+

+ copy @ + + #{@vz.txt_home} + +

} + end + end + class Head_scroll < Head_toc + def initialize(md) #(md='') + super(md) + end + def toc_owner_details + %{#{@vz.margin_txt_3} +#{@vz.paragraph_font_small} + + Owner Details + +     + + + +#{@vz.table_close}} + end + def table + %{
+ +
+ +#{@vz.paragraph_txt}} + end + def table1 + %{ +
+#{@vz.paragraph_txt}} + end + def table2 + %{ +
+#{@vz.paragraph_txt}} + end +## def toc_endnote +## %{#{@vz.margin_txt_3} +## #{@vz.paragraph_font_small} +## +## Endnotes +## +## #{@vz.table_close}} +## end +# def toc_endnote +# %{#{@vz.margin_css} +#

+# +# Endnotes +# +#

+##{@vz.table_close}} +# end + def title_endnote +# %{#{@vz.margin_txt_0} +# #{@vz.paragraph_txt} +# +##{@vz.margin_num} +#   +##{@vz.table_close}} + end +# def tail +# %{
+##{@vz.margin_txt_0} +# +# +# +#
+##{@vz.banner_band} +# +#
#@tocband_scroll
+#
+#
+##{@vz.paragraph_txt} +#
+# #{@vz.credits_splash} +# #{@vz.credits_sisu} +#
+##{@vz.margin_num} +##{@vz.table_close} +# +# +# +# +# +# +# +# #{@md.title*10} +# +# +#} +# end end class Format_text_object @vz=SiSU_Env::Get_init.instance.skin @@ -941,7 +1062,8 @@ WOK #end if txt[2]=~/\d+/ @paranum=txt[2][/(\d+)/m,1] # unless paranum =~/#/ - @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,@paranum) + @p_num=Paragraph_number.new(@md,@paranum) + #@p_num=SiSU_HTML_Format::Paragraph_number.new(@md,@paranum) @para_id=Paragraph_id_ocn.new(@md,@paranum) #used by table version end @headname='' @@ -1048,7 +1170,314 @@ WOK %{

#@one

\n} end end - class XML + class Format_scroll < Format_text_object + def initialize(md='',*txt) + super(md,*txt) + @vz=SiSU_Env::Get_init.instance.skin + end + def endnote_body + %{ +
+ +

+ #@one +

+
+} + end + def header_normal + %{ +
+ #{@p_num.ocn_display} + <#@tag class="#@class" #{@p_num.id}>#{@p_num.name} + #@headname + #@parablock + +
+} + end + def heading_body + @tag,@class='p','norm' + header_normal + end + def heading_body1 + @tag,@class='h1','norm' + header_normal + end + def heading_body2 + @tag,@class='h2','norm' + header_normal + end + def heading_body3 + @tag,@class='h3','norm' + header_normal + end + def heading_body4 + @tag,@class='h4','norm' + header_normal + end + def heading_body5 + @tag,@class='h5','norm' + header_normal + end + def heading_body6 + @tag,@class='h6','norm' + header_normal + end + end + class Format_seg < Format_text_object + def initialize(md='',*txt) + super(md,*txt) + end + def navigation_toc_lev1_advert + %{#{@banner.home_button}\n +
+#@one +#@two +

} + end + def navigation_toc_lev1 + %{#{@banner.nav_toc}} + end + def navigation_toc_lev2 #change bold use css + %{

+ + +
+ + + #@one + +

+#{@vz.table_close}} + end + def navigation_toc_lev3 #change bold use css + %{

+ + +
+ + + #@one + +

+#{@vz.table_close}} + end + def navigation_toc_lev4 + %{ + +
+ +

+ #@one +

+#{@vz.table_close}} + end + def navigation_toc_lev5 + end + def navigation_toc_lev6 + end + def endnote_body_seg_tail #FIX + %{ +
+

+ #@one +

+
+} + end + def endnote_body_seg_tail_indent + %{ +
+

+ #@one +

+
+} + end + def endnote_seg_body(fn='') #FIX #url construction keep within single line... BUG WATCH 200408 + fn='doc' if fn.empty? #you may wish to reconsider, sends to 'doc' where no segment info + %{ +
+

+ #@one#{@md.fnl[:pre]}#{fn}#{@md.fnl[:mid]}#{@md.sfx}#{@md.fnl[:post]}#@two#@three +

+
+} + end + def title_header + %{ +
+ #@two +<#@tag class="#@class"> + #@one + +
+} + end + def title_header1 + @tag,@class='h1','banner' + title_header + end + def title_header2 + @tag,@class='h2','banner' + title_header + end + def title_header3 + @tag,@class='h3','banner' + title_header + end + def title_header4 + %{ +
+ + +
+} + end + def subtoc_lev + one=if @one \ + and @one =~/<\/?i>|/mi + @one.gsub(/<\/?i>|/mi,'') #removes name markers from subtoc, go directly to substantive text + else @one + end + note='' + if one =~/((?:#{Mx[:en_a_o]}|#{Mx[:en_b_o]}).+?(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})\s*)/m #this is a clumsy fix, revisit and address upstream + note=$1 + note.gsub!(/[\n\s]+/m,' ') + one.gsub!(/(?:#{Mx[:en_a_o]}|#{Mx[:en_b_o]}).+?(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})\s*/m,' ') + one.gsub!(/ \d+<\/sup> /m,'') + end + %{<#@tag class="#@class"> + + #{one} + #{note} + } + end + def subtoc_lev5 + @tag,@class='h5','subtoc' + subtoc_lev if @one + end + def subtoc_lev6 + @tag,@class='h6','subtoc' + subtoc_lev if @one + end + #% para sisu + def header4 + %{ +
+#{@p_num.ocn_display} +

#{@p_num.name} + #@format + #@parablock +

+
+} + end + def header_sub + @parablock.gsub!(/(?:#{Mx[:en_a_o]}|#{Mx[:en_b_o]}).+?(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})\s*/m,' ') + %{ +
+ #{@p_num.ocn_display} + <#@tag class="#@class" #{@p_num.id}>#{@p_num.name} #{@headname} + #{@parablock} + +
+} + end + def header5 + @tag,@class='p','bold' + header_sub + end + def header6 + @tag,@class='p','bold' + header_sub + end + def navigation_header4 + %{ +
+

+ #@parablock +

+#{@vz.table_close}} + end + def navigation_header5 + %{

+ #@parablock +

} + end + def navigation_header6 + %{

+ #@parablock +

} + end + def navigation_center + "
#@parablock
" + end + end + class Format_toc < Format_text_object + def initialize(md='',*txt) + super(md,*txt) + end + def links_guide + #@three distinguishes between _top and external, can be used e.g. for different colour scheme + %{
  • + + #@linkname + +
  • +} + end + def lev(tag,attrib) + %{<#{tag} class="#{attrib}"> + #@one + +} + end + def lev1 + lev('h1','toc') + end + def lev2 + lev('h2','toc') + end + def lev3 + lev('h3','toc') + end + def lev4 + lev('h4','toc') + end + def lev5 + lev('h5','toc') + end + def lev6 + lev('h6','toc') + end + def lev0 #docinfo + lev('h0','toc') + end + def mini_lev1 + lev('h1','minitoc') + end + def mini_lev2 + lev('h2','minitoc') + end + def mini_lev3 + lev('h3','minitoc') + end + def mini_lev4 + lev('h4','minitoc') + end + def mini_lev5 + lev('h5','minitoc') + end + def mini_lev6 + lev('h6','minitoc') + end + def mini_lev0 #docinfo + lev('h0','minitoc') + end end end __END__ diff --git a/lib/sisu/v0/html_format_css.rb b/lib/sisu/v0/html_format_css.rb deleted file mode 100644 index 1573d107..00000000 --- a/lib/sisu/v0/html_format_css.rb +++ /dev/null @@ -1,469 +0,0 @@ -# coding: utf-8 -=begin - - * Name: SiSU - - * Description: a framework for document structuring, publishing and search - - * Author: Ralph Amissah - - * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008 Ralph Amissah All Rights Reserved. - - * License: GPL 3 or later: - - SiSU, a framework for document structuring, publishing and search - - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008 Ralph Amissah - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation, either version 3 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along with - this program. If not, see . - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - - - - - - - - * SiSU uses: - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - * Hompages: - - - - * Download: - - - * Ralph Amissah - - - - ** Description: html formating, css template - -=end -module SiSU_HTML_Format_type - require "#{SiSU_lib}/html_format" - include SiSU_Viz - include SiSU_HTML_Format - class Head_toc < SiSU_HTML_Format::Head_toc - def initialize(md='') - super(md) - end - def head - %{#{doc_type} - - - #{@md.html_title} - - -#{@rdf.rdftoc} -#{@rdf.metatag_html} -#{@css.html} - -#{@vz.color_body} - - - -#{@vz.js_top}} - end - def concordance - if @md.concord_make - %{#{@vz.margin_css} -

    - - Concordance - -

    -#{@vz.table_close}} - else - %{#{@vz.margin_css} -#{@vz.table_close}} - end - end - def metadata - %{#{@vz.margin_css} -

    - - MetaData - -

    -#{@vz.table_close}} - end - end - class Head_seg < SiSU_HTML_Format::Head_seg - def initialize(md='') - super(md) - end - def head - %{#{doc_type} - - - #{@seg_name_html[@seg_name_html_tracker]} - - #{@md.html_title} - - -#{@rdf.rdfseg} -#{@rdf.metatag_html} -#{@css.html} - -#{@vz.color_body} - - - -#{@vz.js_top}} - end - def toc_metadata - @metalink=%{./#{@md.fn[:meatadata]}} - toc_metadata - end - def title_banner(title,subtitle,creator) - %{

    - #{title} -

    -

    - #{subtitle} -

    -

    - #{creator} -

    -

    - copy @ - - #{@vz.txt_home} - -

    } - end - end - class Head_scroll < SiSU_HTML_Format::Head_scroll - def initialize(md='') - super(md) - end - end - class Format_scroll < SiSU_HTML_Format::Format_text_object - def initialize(md='',*txt) - super(md,*txt) - @vz=SiSU_Env::Get_init.instance.skin - end - def endnote_body - %{ -
    - -

    - #@one -

    -
    -} - end - def header_normal - %{ -
    - #{@p_num.ocn_display} - <#@tag class="#@class" #{@p_num.id}>#{@p_num.name} - #@headname - #@parablock - -
    -} - end - def heading_body - @tag,@class='p','norm' - header_normal - end - def heading_body1 - @tag,@class='h1','norm' - header_normal - end - def heading_body2 - @tag,@class='h2','norm' - header_normal - end - def heading_body3 - @tag,@class='h3','norm' - header_normal - end - def heading_body4 - @tag,@class='h4','norm' - header_normal - end - def heading_body5 - @tag,@class='h5','norm' - header_normal - end - def heading_body6 - @tag,@class='h6','norm' - header_normal - end - end - class Format_seg < SiSU_HTML_Format::Format_text_object - def initialize(md='',*txt) - super(md,*txt) - end - def navigation_toc_lev1_advert - %{#{@banner.home_button}\n -
    -#@one -#@two -

    } - end - def navigation_toc_lev1 - %{#{@banner.nav_toc}} - end - def navigation_toc_lev2 #change bold use css - %{

    - - -
    - - - #@one - -

    -#{@vz.table_close}} - end - def navigation_toc_lev3 #change bold use css - %{

    - - -
    - - - #@one - -

    -#{@vz.table_close}} - end - def navigation_toc_lev4 - %{ - -
    - -

    - #@one -

    -#{@vz.table_close}} - end - def navigation_toc_lev5 - end - def navigation_toc_lev6 - end - def endnote_body_seg_tail #FIX - %{ -
    -

    - #@one -

    -
    -} - end - def endnote_body_seg_tail_indent - %{ -
    -

    - #@one -

    -
    -} - end - def endnote_seg_body(fn='') #FIX #url construction keep within single line... BUG WATCH 200408 - fn='doc' if fn.empty? #you may wish to reconsider, sends to 'doc' where no segment info - %{ -
    -

    - #@one#{@md.fnl[:pre]}#{fn}#{@md.fnl[:mid]}#{@md.sfx}#{@md.fnl[:post]}#@two#@three -

    -
    -} - end - def title_header - %{ -
    - #@two -<#@tag class="#@class"> - #@one - -
    -} - end - def title_header1 - @tag,@class='h1','banner' - title_header - end - def title_header2 - @tag,@class='h2','banner' - title_header - end - def title_header3 - @tag,@class='h3','banner' - title_header - end - def title_header4 - %{ -
    - - -
    -} - end - def subtoc_lev - one=if @one \ - and @one =~/<\/?i>|/mi - @one.gsub(/<\/?i>|/mi,'') #removes name markers from subtoc, go directly to substantive text - else @one - end - note='' - if one =~/((?:#{Mx[:en_a_o]}|#{Mx[:en_b_o]}).+?(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})\s*)/m #this is a clumsy fix, revisit and address upstream - note=$1 - note.gsub!(/[\n\s]+/m,' ') - one.gsub!(/(?:#{Mx[:en_a_o]}|#{Mx[:en_b_o]}).+?(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})\s*/m,' ') - one.gsub!(/ \d+<\/sup> /m,'') - end - %{<#@tag class="#@class"> - - #{one} - #{note} - } - end - def subtoc_lev5 - @tag,@class='h5','subtoc' - subtoc_lev if @one - end - def subtoc_lev6 - @tag,@class='h6','subtoc' - subtoc_lev if @one - end - #% para sisu - def header4 - %{ -
    -#{@p_num.ocn_display} -

    #{@p_num.name} - #@format - #@parablock -

    -
    -} - end - def header_sub - @parablock.gsub!(/(?:#{Mx[:en_a_o]}|#{Mx[:en_b_o]}).+?(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})\s*/m,' ') - %{ -
    - #{@p_num.ocn_display} - <#@tag class="#@class" #{@p_num.id}>#{@p_num.name} #{@headname} - #{@parablock} - -
    -} - end - def header5 - @tag,@class='p','bold' - header_sub - end - def header6 - @tag,@class='p','bold' - header_sub - end - def navigation_header4 - %{ -
    -

    - #@parablock -

    -#{@vz.table_close}} - end - def navigation_header5 - %{

    - #@parablock -

    } - end - def navigation_header6 - %{

    - #@parablock -

    } - end - def navigation_center - "
    #@parablock
    " - end - end - class Format_toc < SiSU_HTML_Format::Format_text_object - def initialize(md='',*txt) - super(md,*txt) - end - def links_guide - #@three distinguishes between _top and external, can be used e.g. for different colour scheme - %{
  • - - #@linkname - -
  • -} - end - def lev(tag,attrib) - %{<#{tag} class="#{attrib}"> - #@one - -} - end - def lev1 - lev('h1','toc') - end - def lev2 - lev('h2','toc') - end - def lev3 - lev('h3','toc') - end - def lev4 - lev('h4','toc') - end - def lev5 - lev('h5','toc') - end - def lev6 - lev('h6','toc') - end - def lev0 #docinfo - lev('h0','toc') - end - def mini_lev1 - lev('h1','minitoc') - end - def mini_lev2 - lev('h2','minitoc') - end - def mini_lev3 - lev('h3','minitoc') - end - def mini_lev4 - lev('h4','minitoc') - end - def mini_lev5 - lev('h5','minitoc') - end - def mini_lev6 - lev('h6','minitoc') - end - def mini_lev0 #docinfo - lev('h0','minitoc') - end - end -end -__END__ diff --git a/lib/sisu/v0/html_scroll.rb b/lib/sisu/v0/html_scroll.rb index 0bbac4fa..8b1e041c 100644 --- a/lib/sisu/v0/html_scroll.rb +++ b/lib/sisu/v0/html_scroll.rb @@ -102,12 +102,12 @@ module SiSU_HTML_scroll end if para =~/.+?#{Mx[:id_o]}~\d+;(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/ paranum=para[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/,1] - @p_num=SiSU_HTML_Format_type::Paragraph_number.new(@md,paranum) + @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,paranum) end @sto=SiSU_HTML::Source::Split_text_object.new(@md,para).html_scroll m=/#{Mx[:id_o]}~\d+;(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/ if para =~m - 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 case @sto.format when /^1:\S*?/; para=@sto.scroll_lev_para_ocn.heading_body1 when /^2:\S*?/; para=@sto.scroll_lev_para_ocn.heading_body2 @@ -138,20 +138,20 @@ module SiSU_HTML_scroll end elsif para =~/^#{Mx[:lv_o]}[1-9]:/ \ and para !~/#{Mx[:id_o]}~\d+;(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_c]}#@dp:#@dp#{Mx[:id_c]}$/ - format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,para) + format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,para) para=format_txt_obj.bold_header elsif para =~/Endnotes?/ \ and para !~/#{Mx[:id_o]}~\d+;(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/ - format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,'
    Note') + format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,'
    Note') para=format_txt_obj.bold_para elsif para =~/Owner Details/ \ and para !~/#{Mx[:id_o]}~\d+;(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/ - format_txt_obj=SiSU_HTML_Format_type::Format_text_object.new(@md,'
    Owner Details') + format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,'
    Owner Details') @scr[:owner_details]=format_txt_obj.bold_para para='' elsif para =~/(.*)#{Mx[:id_o]}~0;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}(.*)/ #watch 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 if para =~// \ @@ -160,7 +160,7 @@ module SiSU_HTML_scroll end if para =~/<:center>/ #rules changed now a

    (.*)/.match(para).captures - format_scroll=SiSU_HTML_Format_type::Format_scroll.new(@md,one,two) + format_scroll=SiSU_HTML_Format::Format_scroll.new(@md,one,two) end para.gsub!(/^#{Rx[:mx_fa_clean]}/,' '); para.gsub!(/^<:\S?>/,'') para.gsub!(/#{Rx[:mx_fa_clean]}/,' '); para.gsub!(/<:\S?>/,' '); para.gsub!(//,' ') @@ -174,7 +174,7 @@ module SiSU_HTML_scroll end def tails scr_tail=[] - format_head_scroll=SiSU_HTML_Format_type::Head_toc.new(@md) + format_head_scroll=SiSU_HTML_Format::Head_toc.new(@md) ads=SiSU_HTML_promo::Ad.new(@md) scr_tail << format_head_scroll.scroll_tail << ads.div.close << ads.display << format_head_scroll.html_close scr_tail 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 diff --git a/lib/sisu/v0/shared_structure.rb b/lib/sisu/v0/shared_structure.rb index 506b5097..5a3993c6 100644 --- a/lib/sisu/v0/shared_structure.rb +++ b/lib/sisu/v0/shared_structure.rb @@ -62,7 +62,7 @@ module SiSU_Structure class Split_text_object include SiSU_Viz - #include SiSU_HTML_Format_type + #include SiSU_HTML_Format @@dp=nil attr_reader :format,:text,:ocn,:scroll_lev_para_ocn,:seg_lev_para_ocn,:lev_para_ocn def initialize(md,para) @@ -104,14 +104,14 @@ module SiSU_Structure def html_seg lev_segname_para_ocn @seg_lev_para_ocn=if @para[/.+#{Mx[:id_o]}~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/] - SiSU_HTML_Format_type::Format_seg.new(@md,@format,@text,@ocn) + SiSU_HTML_Format::Format_seg.new(@md,@format,@text,@ocn) end self end def html_scroll lev_segname_para_ocn @scroll_lev_para_ocn=if @para[/.+#{Mx[:id_o]}~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/] - SiSU_HTML_Format_type::Format_scroll.new(@md,@format,@text,@ocn) + SiSU_HTML_Format::Format_scroll.new(@md,@format,@text,@ocn) end self end -- cgit v1.2.3