From 92b4747c4f5b4f6753587d2db969fe3d2c4ca077 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 12 Oct 2014 10:32:54 -0400 Subject: v5: html, reduce difference with v6 (removal of some trailing slashes


) --- lib/sisu/v5/html_format.rb | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'lib/sisu/v5/html_format.rb') diff --git a/lib/sisu/v5/html_format.rb b/lib/sisu/v5/html_format.rb index c34759cf..e99f1b5f 100644 --- a/lib/sisu/v5/html_format.rb +++ b/lib/sisu/v5/html_format.rb @@ -301,7 +301,7 @@ WOK   #{@vz.table_close} -

} +

} else '' end end @@ -324,7 +324,7 @@ WOK #{doc_types} #{up_button} #{@vz.table_close} -

} +

} else '' end end @@ -354,7 +354,7 @@ WOK  #{firstseg}  #{@vz.table_close} -

} +

} else '' end end @@ -422,9 +422,7 @@ WOK #{@stylesheet.css_head} #{@vz.color_body} - - -} +} end def concordance if @md.concord_make @@ -513,7 +511,7 @@ WOK rights=SiSU_HTML_Tune::CleanHTML.new(@md.rights.all).clean_for_html rights=rights.gsub(/^\s*Copyright\s+\(C\)/,'Copyright © ') %{

Rights: #{rights}

-

} +

} end self end @@ -1021,7 +1019,7 @@ WOK end def heading_normal(tag,attrib) section_break=(tag=~/h[1-5]/) \ - ? '



' + ? '


' : '' %{#{section_break}
@@ -1179,13 +1177,13 @@ WOK
#{@txt} #{@two} -

} +

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

+ %{

@@ -1197,7 +1195,7 @@ WOK #{@vz.table_close}} end def navigation_toc_lev3 #change bold use css - %{

+ %{

-- cgit v1.2.3 From b99857de428aa6e9182c5e724444bd791afd9dbd Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 12 Oct 2014 10:37:42 -0400 Subject: v5 v6: html_format, label, re: object number object names --- lib/sisu/v5/html_format.rb | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'lib/sisu/v5/html_format.rb') diff --git a/lib/sisu/v5/html_format.rb b/lib/sisu/v5/html_format.rb index e99f1b5f..3cfa9268 100644 --- a/lib/sisu/v5/html_format.rb +++ b/lib/sisu/v5/html_format.rb @@ -71,10 +71,10 @@ module SiSU_HTML_Format if @ocn.to_i==0 \ or @ocn.empty? '' + elsif @make.build.html_strict? + %{} else - name=(@make.build.html_strict?) ? '' : %{ name="#{@ocn}"} - @ocn.gsub(/^(\d+|)$/, - %{}) + %{} end else '' @@ -819,7 +819,7 @@ WOK #{@seg_name_html[@seg_name_html_tracker]} - #{@md.html_title} - + #{rdf.metatag_html} #{@stylesheet.css_head_seg} @@ -918,15 +918,9 @@ WOK and dob.tags.length > 0 # insert tags "hypertargets" dob.tags.each do |t| t=t.gsub(/[^a-z0-9._-]/,'') #use for all html tags? consider limiting to strict? or implementing earlier - if @make.build.html_strict? - tags=(t =~/^[#{Mx[:ocn_id_char]}]?[0-9.]+$/) \ - ? tags #check what can be sorted in ao - : (tags << %{}) - else - tags=(t =~/^[#{Mx[:ocn_id_char]}][0-9.]+$/) \ - ? tags #check what can be sorted in ao - : (tags << %{}) - end + tags=(t =~/^[0-9.]+$/) \ + ? tags #check what can be sorted in ao + : (tags << %{}) end end tags -- cgit v1.2.3 From 710370599b0f3f8c8ce4bc7a1ebcbbc880c9b0f3 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 12 Oct 2014 10:40:09 -0400 Subject: v5 v6: html, epub, set document body language --- lib/sisu/v5/html_format.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/sisu/v5/html_format.rb') diff --git a/lib/sisu/v5/html_format.rb b/lib/sisu/v5/html_format.rb index 3cfa9268..75bacdc2 100644 --- a/lib/sisu/v5/html_format.rb +++ b/lib/sisu/v5/html_format.rb @@ -421,7 +421,7 @@ WOK #{rdf.metatag_html} #{@stylesheet.css_head} -#{@vz.color_body} + } end def concordance @@ -823,7 +823,7 @@ WOK #{rdf.metatag_html} #{@stylesheet.css_head_seg} -#{@vz.color_body} + } end def title_banner(title,subtitle,creator) -- cgit v1.2.3 From 32fd8f3908bc8632e2d8ab4d872f6e4362fe031b Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 12 Oct 2014 10:52:35 -0400 Subject: v5: merge v6: remove defaults.rb & some relics related to sisu skins --- lib/sisu/v5/html_format.rb | 238 +++++++++++++++++---------------------------- 1 file changed, 87 insertions(+), 151 deletions(-) (limited to 'lib/sisu/v5/html_format.rb') diff --git a/lib/sisu/v5/html_format.rb b/lib/sisu/v5/html_format.rb index 75bacdc2..b0611508 100644 --- a/lib/sisu/v5/html_format.rb +++ b/lib/sisu/v5/html_format.rb @@ -58,7 +58,7 @@ =end module SiSU_HTML_Format - include SiSU_Viz + require_relative 'html_parts' # html_parts.rb class ParagraphNumber def initialize(md,ocn) @md,@ocn=md,ocn.to_s @@ -97,13 +97,13 @@ module SiSU_HTML_Format end class HeadInformation require_relative 'css' # css.rb + include SiSU_Parts_HTML require_relative 'xml_shared' # xml_shared.rb - include SiSU_Viz - attr_reader :md,:rdf,:vz + attr_reader :md,:rdf def initialize(md) @md=md # DublinCore 1 - title - @vz=SiSU_Viz::Defaults.new + @bits=SiSU_Proj_HTML::Bits.new @seg_name_html=(SiSU_HTML::Source::Seg.new.seg_name_html || []) @seg_name_html_tracker=(SiSU_HTML::Source::Seg.new.seg_name_html_tracker || []) @tocband_scroll,@tocband_segtoc=nil,nil @@ -164,7 +164,7 @@ module SiSU_HTML_Format %{
-
+ #{wgt.manifest(page)} #{wgt.search}
} @@ -172,14 +172,6 @@ module SiSU_HTML_Format def rdf SiSU_XML_Tags::RDF.new(md) end - def doc_type - %{ -\n} - end - def table_close - %{ -#{@vz.table_close}} - end def button_home(page=:seg) button=%{ \n } end def scroll(text) if @md.fns =~ /\.(?:-|ssm\.)?sst$/ - %{} else - %{} end @@ -291,7 +283,7 @@ module SiSU_HTML_Format #{make_scroll_search_form_and_manifest_link} WOK - %{
\n} if @md.make.home_button_image.is_a?(Hash) @@ -206,6 +198,7 @@ module SiSU_HTML_Format end end class Widget < HeadInformation + include SiSU_Parts_HTML def initialize(md) super(md) @md=md @@ -216,15 +209,15 @@ module SiSU_HTML_Format @make=SiSU_Env::ProcessingSettings.new(md) end def home - %{ + %{ - #{@vz.nav_txt_homepage} + #{the_nav.txt_homepage} + %{ #{text} @@ -257,16 +250,15 @@ module SiSU_HTML_Format end if page==:manifest manifest_lnk="#{@md.file.output_path.manifest.url}/#{@file.base_filename.manifest}" - brace_url=SiSU_Viz::Defaults.new.url_decoration - %{ - - #{brace_url.xml_open}#{@md.file.output_path.manifest.url}/#{@file.base_filename.manifest}#{brace_url.xml_close} + %{ + + #{the_url_decoration.xml_open}#{@md.file.output_path.manifest.url}/#{@file.base_filename.manifest}#{the_url_decoration.xml_close} + %{ - #{@vz.nav_txt_manifest} + #{the_nav.txt_manifest}
+ %{
@@ -300,7 +292,7 @@ WOK
#{button_home(:scroll)}   -#{@vz.table_close} +#{the_table_close}

} else '' end @@ -316,14 +308,14 @@ WOK else '' end if @make.build.html_top_band? - %{ + %{
#{button_home} #{doc_types} #{up_button} -#{@vz.table_close} +#{the_table_close}

} else '' end @@ -344,7 +336,7 @@ WOK else '' end if @make.build.html_top_band? - %{ + %{
@@ -353,7 +345,7 @@ WOK } %{
#{button_home(page)}  #{firstseg}  -#{@vz.table_close} +#{the_table_close}

} else '' end @@ -376,8 +368,8 @@ WOK end def make_scroll_search_form_and_manifest_link wgt=SiSU_HTML_Format::Widget.new(@md) - %{

- #{@vz.nav_txt_doc_link} + %{ + #{the_nav.txt_doc_link}
@@ -389,13 +381,13 @@ WOK def make_scroll_seg_pdf seg='' wgt=SiSU_HTML_Format::Widget.new(@md) - seg=%{ } %{
- #{@vz.nav_txt_toc_link} + seg=%{ + #{the_nav.txt_toc_link}
-
+ #{wgt.manifest} #{wgt.search}
} @@ -404,14 +396,15 @@ WOK wgt=SiSU_HTML_Format::Widget.new(@md) %{ -
+ #{wgt.manifest} #{wgt.search}
} end def head rdf=SiSU_XML_Tags::RDF.new(@md) - %{#{doc_type} + %{ + @@ -426,27 +419,26 @@ WOK end def concordance if @md.concord_make - %{#{@vz.margin_css} + %{#{the_margin.css} <h4 class="toc"> <a href="./#{@md.file.base_filename.html_concordance}"> <i>Concordance</i> </a> </h4> -#{@vz.table_close}} +#{table_close}} else - %{#{@vz.margin_css} -#{@vz.table_close}} + %{#{the_margin.css} +#{table_close}} end end def links_guide_vertical_open # @file=SiSU_Env::FileOp.new(@md) if @md - url=((defined? @vz.url_hp) && @vz.url_hp =~/^https?:\/\/\S+$/ ? @vz.url_hp : @vz.url_home) %{ <div id="vertical_links"> <ul id="vertical"> <li class="refbold"> - <a href="#{url}"> - #{@vz.txt_hp} + <a href="#{the_url.home}"> + #{the_text.txt_hp} </a> </li> <li class="ref"> @@ -461,13 +453,12 @@ WOK end def links_guide_horizontal_open # @file=SiSU_Env::FileOp.new(@md) if @md - url=((defined? @vz.url_hp) && @vz.url_hp =~/^https?:\/\/\S+$/ ? @vz.url_hp : @vz.url_home) %{ <div id="horizontal_links"> <ul id="horizontal"> <li class="refbold"> - <a href="#{url}"> - #{@vz.txt_hp} + <a href="#{the_url.home}"> + #{the_text.txt_hp} </a> </li> <li class="ref"> @@ -521,69 +512,69 @@ WOK def scroll_head_title_banner_open icon=@md.icon ? %{<center>\n#{@md.icon}\n</center>} : '' %{#{icon} -#{@vz.banner_instrument_cover_band_scr}} +#{the_banner.instrument_cover_band_scr}} end def seg_head_title_banner_open icon=@md.icon ? %{<center>\n#{@md.icon}\n</center>} : '' %{#{icon} -#{@vz.banner_instrument_cover_band_seg}} +#{the_banner.instrument_cover_band_seg}} end def make_scroll - concord=concordance_link(@vz.nav_txt_concordance) + concord=concordance_link(the_nav.txt_concordance) %{<table summary="toc scroll" border="0" cellpadding="3" cellspacing="0"> <tr><td align="center" bgcolor="white" border="0"> - #{@vz.nav_txt_doc_link} + #{the_nav.txt_doc_link} </td> <td align="center" bgcolor="white"> #{concord} -#{@vz.table_close}} +#{the_table_close}} end def make_seg - concord=concordance_link(@vz.nav_txt_concordance) + concord=concordance_link(the_nav.txt_concordance) %{<table summary="toc segment" border="0" cellpadding="3" cellspacing="0"> <tr><td align="center" bgcolor="white"> - #{@vz.nav_txt_toc_link} + #{the_nav.txt_toc_link} </td> <td align="center" bgcolor="white"> <font size=2> #{concord} -#{@vz.table_close}} +#{the_table_close}} end def manifest #check structure if not @o_str.dump_or_redirect? - manifest=manifest_link(@vz.nav_txt_manifest) - %{#{@vz.margin_txt_3} - #{@vz.paragraph_font_small} + manifest=manifest_link(the_nav.txt_manifest) + %{#{the_margin.txt_3} + #{the_font.paragraph_font_small} #{manifest} </font> -#{@vz.table_close}} +#{the_table_close}} else '' end end def concordance #check structure - concord=concordance_link(@vz.nav_txt_concordance) - %{#{@vz.margin_txt_3} - #{@vz.paragraph_font_small} + concord=concordance_link(the_nav.txt_concordance) + %{#{the_margin.txt_3} + #{the_font.paragraph_font_small} #{concord} </font> -#{@vz.table_close}} +#{the_table_close}} end def metadata - %{#{@vz.margin_css} + %{#{the_margin.css} <h4 class="toc"> <a href="#{@metalink}"> <i>MetaData</i> </a> </h4> -#{@vz.table_close}} +#{the_table_close}} end def seg_tail %{ <div class="main_column"> <p> <p> -<table summary="toc segment tail" bgcolor=#{@vz.color_band1}> +<table summary="toc segment tail" bgcolor=#{the_color.band1}> <tr><td width="20%"> - #{@vz.banner_band} + #{the_banner.banner_band} </td> <td width="60%"> <center> @@ -592,8 +583,7 @@ WOK </td></tr> </table> <p> </p> -#{@vz.credits_splash} -#{@vz.credits_sisu} +#{@bits.credits_sisu} <a name="bottom" id="bottom"></a> <a name="end" id="end"></a> </div> @@ -606,8 +596,7 @@ WOK %{ <div class="main_column"> #{nav} -#{@vz.credits_splash} -#{@vz.credits_sisu} +#{@bits.credits_sisu} <a name="bottom" id="bottom"></a> <a name="end" id="end"></a> </div> @@ -617,8 +606,7 @@ WOK %{ <div class="main_column"> <p> </p> -#{@vz.credits_splash} -#{@vz.credits_sisu} +#{@bits.credits_sisu} <a name="bottom" id="bottom"></a> <a name="end" id="end"></a> </div> @@ -642,7 +630,7 @@ WOK nxt=nxt.gsub(/sisu_manifest\.html/,"../../manifest/#{@file.base_filename.manifest}") end end - %{<table summary="segment hidden control pre and next" width="100%" border="0" cellpadding="0" bgcolor=#{@vz.color_grey_pale} align="center"> + %{<table summary="segment hidden control pre and next" width="100%" border="0" cellpadding="0" bgcolor=#{the_color.grey_pale} align="center"> <tr><td align="left"> <a href="#{pre}" target="_top"> #{png_nav.dot_pre} @@ -657,13 +645,13 @@ WOK <a href="#{nxt}" target="_top"> #{png_nav.dot_nxt} </a> -#{@vz.table_close}} +#{the_table_close}} end def dot_control_pre pre="#{@seg_name_html[@seg_name_html_tracker-2]}#{@md.lang_code_insert}#{Sfx[:html]}" up=@toc nxt="#{@md.file.base_filename.html_segtoc}" - %{<table summary="segment hidden control pre" width="100%" border="0" cellpadding="0" bgcolor=#{@vz.color_grey_pale} align="center"> + %{<table summary="segment hidden control pre" width="100%" border="0" cellpadding="0" bgcolor=#{the_color.grey_pale} align="center"> <tr><td align="left"> <a href="#{pre}" target="_top"> #{png_nav.dot_pre} @@ -678,21 +666,21 @@ WOK <a href="#{nxt}" target="_top"> #{png_nav.dot_nxt} </a> -#{@vz.table_close}} +#{the_table_close}} end def toc_nav(f_pre=false,f_nxt=false,use=1) pre=nxt='' - toc=%{<td align="center" bgcolor=#{@vz.color_band1}> + toc=%{<td align="center" bgcolor=#{the_color.band1}> <a href="#{@toc}" target="_top"> #{png_nav.toc} </a> </td>} - pre=%{<td align="center" bgcolor=#{@vz.color_band1}> + pre=%{<td align="center" bgcolor=#{the_color.band1}> <a href="#{@seg_name_html[@seg_name_html_tracker-use]}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top"> #{png_nav.pre} </a> </td>} if f_pre==true - nxt=%{<td align="center" bgcolor=#{@vz.color_band1}> + nxt=%{<td align="center" bgcolor=#{the_color.band1}> <a href="#{@seg_name_html[@seg_name_html_tracker+1]}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top"> #{png_nav.nxt} </a> @@ -710,7 +698,7 @@ WOK #{toc} #{nxt} <td> -#{@vz.table_close}} +#{the_table_close}} end def toc_next2 toc_nav(false,true).dup @@ -739,34 +727,33 @@ WOK end end def navigation_table - %{<table summary="navigation segment table" width=#{@vz.table_width_1} border="0" bgcolor="white" cellpadding="0"> + %{<table summary="navigation segment table" width=#{the_width.table1} border="0" bgcolor="white" cellpadding="0"> <tr><th width="#{@@indent['leve_1']}" align="right"> </td> <td valign="top"> <font size=2>} end def navigation_table1 - %{<table summary="navigation segment table1" width=#{@vz.table_width_1} border="0" cellpadding=#{@vz.table_cellpad_box} bgcolor=#{@vz.color_table1} align="left"> + %{<table summary="navigation segment table1" width=#{the_width.table1} border="0" cellpadding=#{the_table_cellpad_box} bgcolor=#{the_color.table1} align="left"> <tr><td valign="top"> <font size="2">} end def navigation_table2 - %{<table summary="navigation segment table2" width=#{@vz.table_width_2} border="0" cellpadding=#{@vz.table_cellpad_box} bgcolor=#{@vz.color_table2} align="left"> + %{<table summary="navigation segment table2" width=#{the_width.table2} border="0" cellpadding=#{the_table_cellpad_box} bgcolor=#{the_color.table2} align="left"> <tr><td valign="top"> <font size="2">} end def credit %{ <div class="main_column"> -#{@vz.credits_splash} -#{@vz.credits_sisu} +#{@bits.credits_sisu} <a name="bottom" id="bottom"></a> <a name="end" id="end"></a> </div></div> } end def navigation_band(segtocband,seg_table_top_control) #change name to navigation_band_banner - %{<table summary="segment navigation band with banner" bgcolor=#{@vz.color_band1} width="100%"><tr> + %{<table summary="segment navigation band with banner" bgcolor=#{the_color.band1} width="100%"><tr> <td width="20%" align="left"> #{button_home} </td> @@ -782,7 +769,7 @@ WOK def navigation_band_bottom(segtocband,seg_table_top_control) #change name to navigation_band_bannerless %{ <div class="main_column"> - <table summary="segment navigation band" bgcolor=#{@vz.color_band1} width="100%"><tr> + <table summary="segment navigation band" bgcolor=#{the_color.band1} width="100%"><tr> <td width="70%" align="center"> #{doc_types} </td> @@ -812,7 +799,8 @@ WOK end def head_seg rdf=SiSU_XML_Tags::RDF.new(@md) - %{#{doc_type} + %{<!DOCTYPE html> +<html> <head> <meta charset="utf-8"> <title> @@ -840,8 +828,8 @@ WOK </p> <p class="tiny"> copy @ - <a href="#{@vz.url_home}"> - #{@vz.txt_home} + <a href="#{the_url.home}"> + #{the_text.txt_home} </a> </p> </div> @@ -853,8 +841,8 @@ WOK super(md) end def toc_owner_details - %{#{@vz.margin_txt_3} -#{@vz.paragraph_font_small} + %{#{the_margin.txt_3} +#{the_font.paragraph_font_small} <a href="#owner.details"> Owner Details <font size="1" color="#777777"> @@ -862,11 +850,11 @@ WOK </font> </a> </font> -#{@vz.table_close}} +#{the_table_close}} end end class FormatTextObject - @vz=SiSU_Viz::Defaults.new + include SiSU_Parts_HTML attr_accessor :md,:t_o,:txt,:ocn,:format,:table,:link,:linkname,:paranum,:p_num,:headname,:banner,:url def initialize(md,t_o) @md,@t_o=md,t_o @@ -899,7 +887,6 @@ WOK @txt=@txt.gsub(/#{Mx[:mk_o]}[-~]##{Mx[:mk_c]}/,'') end @p_num=ParagraphNumber.new(@md,@ocn) - @vz=SiSU_Viz::Defaults.new end def nametags_scroll(dob) tags='' @@ -1127,21 +1114,21 @@ WOK end end def bold_para - %{#{@vz.margin_txt_0} + %{#{the_margin.txt_0} <p class="bold"> #{@txt} </p> -#{@vz.margin_num_css} +#{the_margin.num_css}     -#{@vz.table_close}} +#{the_table_close}} end def bold_heading %{<p class="bold"> #{@txt} </p> -#{@vz.margin_num_css} +#{the_margin.num_css}     -#{@vz.table_close}} +#{the_table_close}} end def toc_head_copy_at %{<p class="center">#{@txt}</p>\n} @@ -1159,63 +1146,12 @@ WOK class FormatScroll < FormatTextObject def initialize(md,txt) super(md,txt) - @vz=SiSU_Viz::Defaults.new end end class FormatSeg < FormatTextObject def initialize(md,txt) super(md,txt) end - def navigation_toc_lev1_advert - %{#{@banner.home_button}\n -<center> -#{@txt} -#{@two} -</a></center><p>} - end - def navigation_toc_lev1 - %{#{@banner.nav_toc}} - end - def navigation_toc_lev2 #change bold use css - %{<p> -<table summary="navigation segment level 2"> -<tr><td width ="20"> -</td> -<td> - <font size="3" #{@vz.font_face}> - <b>#{@txt}</b> - </font> - </p> -#{@vz.table_close}} - end - def navigation_toc_lev3 #change bold use css - %{<p> -<table summary="navigation segment level 3"> -<tr><td width ="20"> -</td> -<td> - <font size="3" #{@vz.font_face}> - <b>#{@txt}</b> - </font> - </p> -#{@vz.table_close}} - end - def navigation_toc_lev4 - %{<table summary="navigation segment level 4"> -<tr><td width ="80"> -</td> -<td> -<p> - #{@txt} -</p> -#{@vz.table_close}} - end - def navigation_toc_lev5 - end - def navigation_toc_lev6 - end - def navigation_toc_lev7 - end def endnote_seg_body(fn='') #FIX #url construction keep within single line... BUG WATCH 200408 fn='doc' if fn.to_s.empty? #you may wish to reconsider, sends to 'doc' where no segment info %{ @@ -1290,7 +1226,7 @@ WOK <p class="bold"> #{@txt} </p> -#{@vz.table_close}} +#{the_table_close}} end def navigation_heading5 %{<p class="bold"> -- cgit v1.2.3