aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/html_format.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v5/html_format.rb')
-rw-r--r--lib/sisu/v5/html_format.rb238
1 files changed, 87 insertions, 151 deletions
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
%{
<table summary="segment navigation available documents types: toc,doc,pdf,concordance" border="0" cellpadding="3" cellspacing="0">
<tr>
-<td align="center" bgcolor=#{@vz.color_band2}>
+<td align="center" bgcolor=#{the_color.band2}>
#{wgt.manifest(page)}
#{wgt.search}
</tr></table>}
@@ -172,14 +172,6 @@ module SiSU_HTML_Format
def rdf
SiSU_XML_Tags::RDF.new(md)
end
- def doc_type
- %{<!DOCTYPE html>
-<html>\n}
- end
- def table_close
- %{ </font>
-#{@vz.table_close}}
- end
def button_home(page=:seg)
button=%{ <table summary="home button / home information" border="0" cellpadding="3" cellspacing="0">\n <tr><td align="left" bgcolor="#ffffff">\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
- %{<td align="center" bgcolor=#{@vz.color_band2}>
+ %{<td align="center" bgcolor=#{the_color.band2}>
<a href="../index.html" target="_top">
- #{@vz.nav_txt_homepage}</a>
+ #{the_nav.txt_homepage}</a>
</td>
}
end
def scroll(text)
if @md.fns =~ /\.(?:-|ssm\.)?sst$/
- %{<td align="center" bgcolor=#{@vz.color_band2}>
+ %{<td align="center" bgcolor=#{the_color.band2}>
<a href="#{Xx[:html_relative1]}html/#{@file.base_filename.html_scroll}" target="_top">
#{text}
</a>
@@ -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
- %{<td align="center" bgcolor=#{@vz.color_band2}>
- <font face="#{@vz.font_fonts}" size="2">
- #{brace_url.xml_open}<a href="#{manifest_lnk}" target="_top">#{@md.file.output_path.manifest.url}/#{@file.base_filename.manifest}</a>#{brace_url.xml_close}
+ %{<td align="center" bgcolor=#{the_color.band2}>
+ <font face="#{the_font.set_fonts}" size="2">
+ #{the_url_decoration.xml_open}<a href="#{manifest_lnk}" target="_top">#{@md.file.output_path.manifest.url}/#{@file.base_filename.manifest}</a>#{the_url_decoration.xml_close}
</font>
</td>}
else
- %{<td align="center" bgcolor=#{@vz.color_band2}>
+ %{<td align="center" bgcolor=#{the_color.band2}>
<a href="#{manifest_lnk}" target="_top">
- #{@vz.nav_txt_manifest}
+ #{the_nav.txt_manifest}
</a>
</td>}
end
@@ -291,7 +283,7 @@ module SiSU_HTML_Format
#{make_scroll_search_form_and_manifest_link}
</td>
WOK
- %{<table summary="table of contents scroll navigation band" id="toc" width="100%" bgcolor=#{@vz.color_band1}>
+ %{<table summary="table of contents scroll navigation band" id="toc" width="100%" bgcolor=#{the_color.band1}>
<tr><td width="20%">
#{button_home(:scroll)}
</td>
@@ -300,7 +292,7 @@ WOK
</td>
<td width="20%">
&nbsp;
-#{@vz.table_close}
+#{the_table_close}
<p>}
else ''
end
@@ -316,14 +308,14 @@ WOK
else ''
end
if @make.build.html_top_band?
- %{<table summary="concordance navigation band" id="toc" width="100%" bgcolor=#{@vz.color_band1}>
+ %{<table summary="concordance navigation band" id="toc" width="100%" bgcolor=#{the_color.band1}>
<tr><td width="20%">
#{button_home}
</td>
<td width="75%" align="center">
#{doc_types}
#{up_button}
-#{@vz.table_close}
+#{the_table_close}
<p>}
else ''
end
@@ -344,7 +336,7 @@ WOK
else ''
end
if @make.build.html_top_band?
- %{<table summary="table of contents segment navigation band" id="toc" width="100%" bgcolor=#{@vz.color_band1}>
+ %{<table summary="table of contents segment navigation band" id="toc" width="100%" bgcolor=#{the_color.band1}>
<tr><td width="20%">
#{button_home(page)}
</td>
@@ -353,7 +345,7 @@ WOK
</td>
<td width="5%" align="right">
&nbsp;#{firstseg}&nbsp;
-#{@vz.table_close}
+#{the_table_close}
<p>}
else ''
end
@@ -376,8 +368,8 @@ WOK
end
def make_scroll_search_form_and_manifest_link
wgt=SiSU_HTML_Format::Widget.new(@md)
- %{<td align="center" bgcolor=#{@vz.color_band2}>
- #{@vz.nav_txt_doc_link}
+ %{<td align="center" bgcolor=#{the_color.band2}>
+ #{the_nav.txt_doc_link}
</td>
}
%{<table summary="toc segment and scroll with pdf" border="0" cellpadding="3" cellspacing="0">
@@ -389,13 +381,13 @@ WOK
def make_scroll_seg_pdf
seg=''
wgt=SiSU_HTML_Format::Widget.new(@md)
- seg=%{<td align="center" bgcolor=#{@vz.color_band2}>
- #{@vz.nav_txt_toc_link}
+ seg=%{<td align="center" bgcolor=#{the_color.band2}>
+ #{the_nav.txt_toc_link}
</td>
}
%{<table summary="toc scroll and segment with pdf" border="0" cellpadding="3" cellspacing="0">
<tr>
-<td align="center" bgcolor=#{@vz.color_band2}>
+<td align="center" bgcolor=#{the_color.band2}>
#{wgt.manifest}
#{wgt.search}
</tr></table>}
@@ -404,14 +396,15 @@ WOK
wgt=SiSU_HTML_Format::Widget.new(@md)
%{<table summary="toc scroll and segment with pdf" border="0" cellpadding="3" cellspacing="0">
<tr>
-<td align="center" bgcolor=#{@vz.color_band2}>
+<td align="center" bgcolor=#{the_color.band2}>
#{wgt.manifest}
#{wgt.search}
</tr></table>}
end
def head
rdf=SiSU_XML_Tags::RDF.new(@md)
- %{#{doc_type}
+ %{<!DOCTYPE html>
+<html>
<head>
<meta charset="utf-8">
<title>
@@ -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>&nbsp;<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>&nbsp;</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>&nbsp;</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}
&nbsp;&nbsp;&nbsp;
-#{@vz.table_close}}
+#{the_table_close}}
end
def bold_heading
%{<p class="bold">
#{@txt}
</p>
-#{@vz.margin_num_css}
+#{the_margin.num_css}
&nbsp;&nbsp;&nbsp;
-#{@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">