aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/html_lite_shared.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v5/html_lite_shared.rb')
-rw-r--r--lib/sisu/v5/html_lite_shared.rb19
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/sisu/v5/html_lite_shared.rb b/lib/sisu/v5/html_lite_shared.rb
index 7c3cdf0f..fa1cc481 100644
--- a/lib/sisu/v5/html_lite_shared.rb
+++ b/lib/sisu/v5/html_lite_shared.rb
@@ -59,11 +59,10 @@
=end
module SiSU_FormatShared
- require_relative 'defaults' # defaults.rb
- include SiSU_Viz
+ require_relative 'html_parts' # html_parts.rb
class CSS_Format
- require_relative 'defaults' # defaults.rb
require_relative 'se_hub_particulars' # se_hub_particulars.rb
+ include SiSU_Parts_HTML
@@fns=nil
def initialize(md,t_o)
@md,@t_o=md,t_o
@@ -79,10 +78,8 @@ module SiSU_FormatShared
else @@hname
end
@tab="\t"
- @brace_url=SiSU_Viz::Defaults.new.url_decoration
@ocn_html_identifier=SiSU_Env::ProcessingSettings.new(@md).ocn_html_identifier
@@tablehead,@@tablefoot=[],[]
- @vz=SiSU_Viz::Defaults.new
@env=SiSU_Env::InfoEnv.new(@md.fns)
@base_url="#{@env.url.root}/#{@md.fnb}/#{@hname}.html"
end
@@ -104,7 +101,7 @@ module SiSU_FormatShared
w=%{width="#{w}"} if w
h=%{height="#{h}"} if h
c=m[/"(.+?)"/m,1]
- caption=%{<br /><p class="caption">#{c}</p>} if c
+ caption=%{<br><p class="caption">#{c}</p>} if c
png=m.scan(/\S+/)[0]
ins=if u \
and u.strip !~/^image$/
@@ -172,7 +169,7 @@ module SiSU_FormatShared
gsub(/#{Mx[:gl_o]}#([a-z]{2,4})#{Mx[:gl_c]}/u,'&\1;').
gsub(/#{Mx[:url_o]}[_\\](\S+?)#{Mx[:url_c]}/,'<a href="\1" target="_top">\1</a>'). #http ftp matches escaped, no decoration
gsub(/(#{Mx[:lnk_c]})#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,'\1<a href="\2" target="_top">\2</a>'). #special case \{ e.g. \}http://url
- gsub(/(^|#{Mx[:gl_c]}|\s)#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{\\1#{@brace_url.xml_open}<a href="\\2" target="_top">\\2</a>#{@brace_url.xml_close}\\3}) #http ftp matches with decoration
+ gsub(/(^|#{Mx[:gl_c]}|\s)#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{\\1#{the_url_decoration.xml_open}<a href="\\2" target="_top">\\2</a>#{the_url_decoration.xml_close}\\3}) #http ftp matches with decoration
else
s.gsub(/</m,'&lt;').
gsub(/>/m,'&gt;')
@@ -190,7 +187,7 @@ module SiSU_FormatShared
gsub(/#{Mx[:gl_o]}#([a-z]{2,4})#{Mx[:gl_c]}/u,'&\1;').
gsub(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'<a href="\1" target="_top">\1</a>\2'). #http ftp matches escaped, no decoration
gsub(/(#{Mx[:lnk_c]})#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,'\1<a href="\2" target="_top">\2</a>'). #special case \{ e.g. \}http://url
- gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}<a href="\\1" target="_top">\\1</a>#{@brace_url.xml_close}}) #http ftp matches with decoration
+ gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{the_url_decoration.xml_open}<a href="\\1" target="_top">\\1</a>#{the_url_decoration.xml_close}}) #http ftp matches with decoration
end
def paragraph
%{<p class="h#{@lv}" type="substantive" header="#{@hname}">#{@txt}</p>\n} # << "\n"
@@ -252,7 +249,7 @@ GSUB
tag_para(h)
end
def para_table
- %{<p class="norm" align="left"><font #{@vz.font_small} #{@vz.font_color} #{@vz.font_face}>}
+ %{<p class="norm" align="left"><font #{the_font.set_small} #{the_font.set_color} #{the_font.set_face}>}
end
def ocn
%{<label class="ocn">#{@ocn}</label>} << "\n"
@@ -265,13 +262,13 @@ GSUB
parablock=parablock.gsub(/<!f.+?!>/,'')
@@tablehead=1 if parablock =~/#{Mx[:gr_o]}Th#{Mx[:tc_p]}/u
parablock=parablock.gsub(/#{Mx[:gr_o]}Th?#{Mx[:tc_p]}.+?#{Mx[:tc_p]}~(\d+)#{Mx[:gr_c]}/,
- %{<table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">})
+ %{<table summary="normal text css" width="100%" border="0" cellpadding="2" align="center">})
if parablock =~/#{Mx[:gr_o]}TZ#{Mx[:gr_c]}/
tablefoot=[]
@@tablefoot.each {|x| tablefoot << %{<p align="center"><font size=2><i>#{x}</i></font></p>\n}}
@@tablefoot=[]
parablock=parablock.gsub(/#{Mx[:gr_o]}TZ#{Mx[:gr_c]}/,
- %{#{@vz.table_close}\n}) # +
+ %{#{the_table_close}\n}) # +
end
if @@tablehead==1
if parablock =~/#{Mx[:tc_p]}#{Mx[:tc_p]}/u