aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/html_format.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3/html_format.rb')
-rw-r--r--lib/sisu/v3/html_format.rb114
1 files changed, 37 insertions, 77 deletions
diff --git a/lib/sisu/v3/html_format.rb b/lib/sisu/v3/html_format.rb
index 85e47e0b..fa9ac462 100644
--- a/lib/sisu/v3/html_format.rb
+++ b/lib/sisu/v3/html_format.rb
@@ -135,7 +135,7 @@ module SiSU_HTML_Format
end
def png_nav
def toc
- %{<img border="0" width="22" height="22" src="#{url_path_image_sys}/#{icon.up}" alt="TOC" />}
+ %{<img border="0" width="22" height="22" src="#{url_path_image_sys}/#{icon.up}" alt="toc" />}
end
def pre
%{<img border="0" width="22" height="22" src="#{url_path_image_sys}/#{icon.previous}" alt="&lt;&lt;&nbsp;previous" />}
@@ -184,7 +184,7 @@ module SiSU_HTML_Format
end
def copyat
%{#{@vz.paragraph_font_tiny}copy @
- <a href="#{@vz.url_home}" #{@vz.js_home}>
+ <a href="#{@vz.url_home}">
#{@vz.txt_home}
</a></h1>}
end
@@ -213,7 +213,7 @@ module SiSU_HTML_Format
def scroll(text)
if @md.fns =~ /\.(?:-|ssm\.)?sst$/
scroll=%{<td align="center" bgcolor=#{@vz.color_band2}>
- <a href="#{Xx[:html_relative1]}html/#{@file.base_filename.html_scroll}" target="_top" #{@vz.js_doc}>
+ <a href="#{Xx[:html_relative1]}html/#{@file.base_filename.html_scroll}" target="_top">
#{text}
</a>
</td>
@@ -222,7 +222,7 @@ module SiSU_HTML_Format
end
def seg(text)
%{<td align="center" bgcolor="#99CC66">
- <a href="#{@md.file.base_filename.html_segtoc}" target="_top" #{@vz.js_doc}>
+ <a href="#{@md.file.base_filename.html_segtoc}" target="_top">
#{text}
</a>
</td>
@@ -244,7 +244,7 @@ module SiSU_HTML_Format
else @file.base_filename.manifest
end
%{<td align="center" bgcolor=#{@vz.color_band2}>
- <a href="#{manifest_lnk}" target="_top" #{@vz.js_manifest}>
+ <a href="#{manifest_lnk}" target="_top">
#{@vz.nav_txt_manifest}
</a>
</td>}
@@ -256,12 +256,12 @@ module SiSU_HTML_Format
and @cf_defaults.cf_0 =~/p/
%{
<td align="center" bgcolor=#{@vz.color_band2}>
- <a href="#{Xx[:html_relative1]}pdf/#{@file.base_filename.pdf_p}" target="_top" #{@vz.js_portrait}>
+ <a href="#{Xx[:html_relative1]}pdf/#{@file.base_filename.pdf_p}" target="_top">
#{@vz.nav_txt_pdf_portrait}
</a>
</td>
<td align="center" bgcolor=#{@vz.color_band2}>
- <a href="#{Xx[:html_relative1]}pdf/#{@file.base_filename.pdf_l}" target="_top" #{@vz.js_portrait}>
+ <a href="#{Xx[:html_relative1]}pdf/#{@file.base_filename.pdf_l}" target="_top">
#{@vz.nav_txt_pdf_landscape}
</a>
</td>
@@ -331,13 +331,13 @@ WOK
def manifest_link(text)
# @file=SiSU_Env::FileOp.new(@md) if @md
%{<font size=2>
- <a href="#{@md.file.base_filename.manifest}" target="_top" #{@vz.js_manifest}>#{text}</a>
+ <a href="#{@md.file.base_filename.manifest}" target="_top">#{text}</a>
</font>}
end
def concordance_link(text)
if @md.concord_make
%{<font size=2>
- <a href="#{@md.file.base_filename.html_concordance}" target="_top" #{@vz.js_concordance}>
+ <a href="#{@md.file.base_filename.html_concordance}" target="_top">
#{text}
</a>
</font>}
@@ -394,14 +394,13 @@ WOK
#{@vz.color_body}
<a name="top" id="top"></a>
<a name="up" id="up"></a>
-<a name="start" id="start"></a>
-#{@vz.js_top}}
+<a name="start" id="start"></a>}
end
def concordance
if @md.concord_make
%{#{@vz.margin_css}
<h4 class="toc">
- <a href="./#{@md.file.base_filename.html_concordance}" #{@vz.js_concordance}>
+ <a href="./#{@md.file.base_filename.html_concordance}">
<i>Concordance</i>
</a>
</h4>
@@ -418,7 +417,7 @@ WOK
<div id="vertical_links">
<ul id="vertical">
<li class="refbold">
- <a href="#{url}" #{@vz.js_home}>
+ <a href="#{url}">
#{@vz.txt_hp}
</a>
</li>
@@ -439,7 +438,7 @@ WOK
<div id="horizontal_links">
<ul id="horizontal">
<li class="refbold">
- <a href="#{url}" #{@vz.js_home}>
+ <a href="#{url}">
#{@vz.txt_hp}
</a>
</li>
@@ -454,9 +453,9 @@ WOK
<!- quick ref -!>}
end
def links_guide_open(type='horizontal')
- if type=='vertical'; links_guide_vertical_open
- else links_guide_horizontal_open
- end
+ (type=='vertical') \
+ ? links_guide_vertical_open
+ : links_guide_horizontal_open
end
def links_guide_close
insert=''
@@ -545,7 +544,7 @@ WOK
def metadata
%{#{@vz.margin_css}
<h4 class="toc">
- <a href="#{@metalink}" #{@vz.js_metalink}>
+ <a href="#{@metalink}">
<i>MetaData</i>
</a>
</h4>
@@ -634,17 +633,17 @@ WOK
end
%{<table summary="segment hidden control pre and next" width="100%" border="0" cellpadding="0" bgcolor=#{@vz.color_grey_pale} align="center">
<tr><td align="left">
- <a href="#{pre}" target="_top" #{@vz.js_prev}>
+ <a href="#{pre}" target="_top">
#{png_nav.dot_pre}
</a>
</td>
<td align="center">
- <a href="#{up}" target="_top" #{@vz.js_toc}>
+ <a href="#{up}" target="_top">
#{png_nav.dot_toc}
</a>
</td>
<td align="right">
- <a href="#{nxt}" target="_top" #{@vz.js_next}>
+ <a href="#{nxt}" target="_top">
#{png_nav.dot_nxt}
</a>
#{@vz.table_close}}
@@ -655,17 +654,17 @@ WOK
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">
<tr><td align="left">
- <a href="#{pre}" target="_top" #{@vz.js_prev}>
+ <a href="#{pre}" target="_top">
#{png_nav.dot_pre}
</a>
</td>
<td align="center">
- <a href="#{up}" target="_top" #{@vz.js_toc}>
+ <a href="#{up}" target="_top">
#{png_nav.dot_toc}
</a>
</td>
<td align="right">
- <a href="#{nxt}" target="_top" #{@vz.js_next}>
+ <a href="#{nxt}" target="_top">
#{png_nav.dot_nxt}
</a>
#{@vz.table_close}}
@@ -673,17 +672,17 @@ WOK
def toc_nav(f_pre=false,f_nxt=false,use=1)
pre=nxt=''
toc=%{<td align="center" bgcolor=#{@vz.color_band1}>
- <a href="#{@toc}" target="_top" #{@vz.js_toc}>
+ <a href="#{@toc}" target="_top">
#{png_nav.toc}
</a>
</td>}
pre=%{<td align="center" bgcolor=#{@vz.color_band1}>
- <a href="#{@seg_name_html[@seg_name_html_tracker-use]}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top" #{@vz.js_prev}>
+ <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}>
- <a href="#{@seg_name_html[@seg_name_html_tracker+1]}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top" #{@vz.js_next}>
+ <a href="#{@seg_name_html[@seg_name_html_tracker+1]}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top">
#{png_nav.nxt}
</a>
</td>} if f_nxt==true
@@ -714,7 +713,7 @@ WOK
end
def manifest_link(text)
%{<font size=2>
- <a href="#{@md.file.base_filename.manifest}" target="_top" #{@vz.js_manifest}>
+ <a href="#{@md.file.base_filename.manifest}" target="_top">
#{text}
</a>
</font>}
@@ -722,7 +721,7 @@ WOK
def concordance_link(text)
if @md.concord_make
%{<font size=2>
- <a href="#{@md.file.base_filename.html_concordance}" target="_top" #{@vz.js_concordance}>
+ <a href="#{@md.file.base_filename.html_concordance}" target="_top">
#{text}
</a>
</font>}
@@ -746,42 +745,6 @@ WOK
<tr><td valign="top">
<font size="2">}
end
- def heading_advert_local_1
- dir=SiSU_Env::InfoEnv.new(@fns)
- %{ <center>
-<table summary="image" border="0" cellpadding="3" cellspacing="0" align="center">
-<tr><td align="center" bgcolor="white">
- <a href="http://#{@md.ad_url}#{Sfx[:html]}" target="_top">
- <img border="0" src="#{dir.url.images_local}/#{@md.ad_png}" alt="#{@md.ad_alt}">
- </a>
- <p />
-#{@vz.table_close}
-</center>}
- end
- def heading_advert_local_2
- dir=SiSU_Env::InfoEnv.new(@fns)
- %{ <center>
-<table summary="image" border="0" cellpadding="3" cellspacing="0" align="center">
-<tr><td align="center" bgcolor="white">
- <a href="#{@md.ad_url}#{Sfx[:html]}" target="_top">
- <img border="0" src="#{dir.url.images_local}/#{@md.ad_png}" alt="#{@md.ad_alt}">
- </a>
- <p />
-#{@vz.table_close}
-</center>}
- end
- def heading_advert_external
- dir=SiSU_Env::InfoEnv.new(@fns)
- %{ <center>
-<table summary="image" border="0" cellpadding="3" cellspacing="0" align="center">
-<tr><td align="center" bgcolor="white">
- <a href="#{@md.ad_url}#{Sfx[:html]}" target="external">
- <img border="0" src="#{dir.url.images_local}/#{@md.ad_png}" alt="#{@md.ad_alt}">
- </a>
- <p />
-#{@vz.table_close}
-</center>}
- end
def credit
%{
<div class="main_column">
@@ -856,8 +819,7 @@ WOK
#{@vz.color_body}
<a name="top" id="top"></a>
<a name="up" id="up"></a>
-<a name="start" id="start"></a>
-#{@vz.js_top}}
+<a name="start" id="start"></a>}
end
def title_banner(title,subtitle,creator)
%{
@@ -903,7 +865,7 @@ WOK
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
- if t_o.class==Hash
+ if t_o.is_a?(Hash)
@txt =t_o[:txt] || nil
@ocn =t_o[:ocn] || nil
@ocn_display =t_o[:ocn_display] || nil
@@ -957,9 +919,9 @@ WOK
def headname #check whether used
hn=if @t_o.is ==:heading \
and not @t_o.name.empty? #determine use
- hn=if @t_o.is ==:heading; %{<a name="h#{@t_o.name}" id="h#{@t_o.name}"></a>}
- else %{<a name="#{@t_o.name}" id="#{@t_o.name}"></a>}
- end
+ hn=(@t_o.is ==:heading) \
+ ? (%{<a name="h#{@t_o.name}" id="h#{@t_o.name}"></a>})
+ : (%{<a name="#{@t_o.name}" id="#{@t_o.name}"></a>})
else nil
end
hn
@@ -1035,16 +997,14 @@ WOK
end
para_form_css('p','norm')
end
- def break
- @txt=@txt.gsub(/#{Mx[:br_page_new]}|#{Mx[:br_page]}/,'<hr /><br />').
- gsub(/#{Mx[:br_obj]}/,'<hr style="width:30%" /><br />')
- para_form_css('p','norm')
- end
def format(tag,attrib)
para_form_css(tag,attrib)
end
def heading_normal(tag,attrib)
- %{
+ section_break=(tag=~/h[1-4]/) \
+ ? '<p><hr width=90% /></p>'
+ : ''
+ %{#{section_break}
<div class="substance">
#{@p_num.ocn_display}
<#{tag} class="#{attrib}" #{@p_num.id}>#{@p_num.name}