aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3dv/html_format.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3dv/html_format.rb')
-rw-r--r--lib/sisu/v3dv/html_format.rb91
1 files changed, 40 insertions, 51 deletions
diff --git a/lib/sisu/v3dv/html_format.rb b/lib/sisu/v3dv/html_format.rb
index d8b44760..56360455 100644
--- a/lib/sisu/v3dv/html_format.rb
+++ b/lib/sisu/v3dv/html_format.rb
@@ -62,27 +62,22 @@ module SiSU_HTML_Format
def initialize(md,ocn)
@md,@ocn=md,ocn.to_s
@ocn ||=''
- vz=SiSU_Env::GetInit.instance.skin
- @skin_no_ocn=if defined? vz.ocn_display_off \
- and vz.ocn_display_off==true
- true
- else false
- end
end
def ocn_display
- if @md.markup.inspect =~/no_ocn/ \
- or @md.opt.mod.inspect =~/--no-ocn/ \
- or @skin_no_ocn
+ @make=SiSU_Env::ProcessingSettings.new(@md)
+ if @make.build.ocn?
+ ocn_class='ocn'
+ if @ocn.to_i==0
+ @ocn.gsub(/^(\d+|)$/,
+ %{<label class="#{ocn_class}"><a name="#{@ocn}">&nbsp;</a></label>})
+ else
+ @ocn.gsub(/^(\d+|)$/,
+ %{<label class="#{ocn_class}"><a name="#{@ocn}" href="##{@ocn}" class="lnk#{ocn_class}">\\1</a></label>})
+ end
+ else
ocn_class='ocn_off'
@ocn.gsub(/^(\d+|)$/,
%{<label class="#{ocn_class}">&nbsp;</label>})
- elsif @ocn.to_i==0
- @ocn.gsub(/^(\d+|)$/,
- %{<label class="#{ocn_class}"><a name="#{@ocn}">&nbsp;</a></label>})
- else
- ocn_class='ocn'
- @ocn.gsub(/^(\d+|)$/,
- %{<label class="#{ocn_class}"><a name="#{@ocn}" href="##{@ocn}" class="lnk#{ocn_class}">\\1</a></label>})
end
end
def name
@@ -109,7 +104,7 @@ module SiSU_HTML_Format
@metalink='#metadata'
@tocband_scroll,@tocband_segtoc=nil,nil
@stylesheet=SiSU_Style::CSS_HeadInfo.new(md).stylesheet
- @o_str ||=SiSU_Env::OutputStructure.new(md).output_dir_structure
+ @o_str ||=SiSU_Env::ProcessingSettings.new(md).output_dir_structure
@index='index'
@toc="#{@md.file.output_path.html_seg.dir}/#{@md.file.base_filename.html_segtoc}"
end
@@ -206,7 +201,8 @@ module SiSU_HTML_Format
@cf_defaults=SiSU_Env::InfoProcessingFlag.new
@env=SiSU_Env::InfoEnv.new(md.fns)
@file=SiSU_Env::FileOp.new(md)
- @o_str ||=SiSU_Env::OutputStructure.new(md).output_dir_structure
+ @o_str ||=SiSU_Env::ProcessingSettings.new(md).output_dir_structure
+ @make=SiSU_Env::ProcessingSettings.new(@md)
end
def home
%{<td align="center" bgcolor=#{@vz.color_band2}>
@@ -234,11 +230,15 @@ module SiSU_HTML_Format
}
end
def search
- env=SiSU_Env::InfoEnv.new(@md.fns,@md)
- env.widget.search_form('sisusearch',nil,nil,true)
+ if @make.build.html_search_form?
+ env=SiSU_Env::InfoEnv.new(@md.fns,@md)
+ env.widget.search_form('sisusearch',nil,nil,true)
+ else ''
+ end
end
def manifest
- if not @o_str.dump_or_redirect?
+ if @make.build.links_to_manifest? \
+ and not @o_str.dump_or_redirect?
manifest_lnk=if @file.output_dir_structure.by_language_code? \
or @file.output_dir_structure.by_filetype?
"#{Xx[:html_relative1]}manifest/#{@file.base_filename.manifest}"
@@ -321,28 +321,30 @@ module SiSU_HTML_Format
def initialize(md)
super(md)
@md=md
- @o_str ||=SiSU_Env::OutputStructure.new(md).output_dir_structure
+ @o_str ||=SiSU_Env::ProcessingSettings.new(md).output_dir_structure
+ @make=SiSU_Env::ProcessingSettings.new(@md)
end
def scroll_head_navigation_band
- pdf=if @md.programs[:pdf]
- <<WOK
+ if @make.build.html_top_band?
+ search_and_manifest=<<WOK
<td align="center" width="60%">
- #{make_seg_scroll_pdf}
+ #{make_scroll_search_form_and_manifest_link}
</td>
WOK
- else ''
- end
- %{<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=#{@vz.color_band1}>
<tr><td width="20%">
#{@vz.banner_band}
-</td>#{pdf}
+</td>#{search_and_manifest}
<td width="20%">
&nbsp;
#{@vz.table_close}
<p />}
+ else ''
+ end
end
def concordance_navigation_band(type='')
- %{<table summary="concordance navigation band" id="toc" width="100%" bgcolor=#{@vz.color_band1}>
+ if @make.build.html_top_band?
+ %{<table summary="concordance navigation band" id="toc" width="100%" bgcolor=#{@vz.color_band1}>
<tr><td width="20%">
#{@vz.banner_band}
</td>
@@ -352,6 +354,8 @@ WOK
</a>&nbsp;
#{@vz.table_close}
<p />}
+ else ''
+ end
end
def seg_head_navigation_band(type='')
firstseg=%{<a href="#{@md.firstseg}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top" alt="-&gt;">
@@ -369,25 +373,6 @@ WOK
#{@vz.table_close}
<p />}
end
- def seg_head_navigation_band_bottom(type='') #retired 2.7.9
- if type=~/pdf/
- @tocband_segtoc=make_scroll_seg_pdf
- end
- firstseg=%{<a href="#{@md.firstseg}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top" alt="-&gt;">
- #{png_nav.nxt}
- </a>} if @md.firstseg =~/\S+/
- %{<table summary="table of contents segment navigation band" id="toc" width="100%" bgcolor=#{@vz.color_band1}>
-<tr><td width="20%">
- &nbsp;
-</td>
-<td width="75%" align="center">
- #{@tocband_segtoc}
-</td>
-<td width="5%" align="right">
- &nbsp;#{firstseg}&nbsp;
-#{@vz.table_close}
-<p />}
- end
def manifest_link(text)
# @file=SiSU_Env::FileOp.new(@md) if @md
%{<font size=2>
@@ -404,7 +389,7 @@ WOK
else ''
end
end
- def make_seg_scroll_pdf
+ def make_scroll_search_form_and_manifest_link
wgt=SiSU_HTML_Format::Widget.new(@md)
scroll=%{<td align="center" bgcolor=#{@vz.color_band2}>
#{@vz.nav_txt_doc_link}
@@ -992,6 +977,7 @@ WOK
end
@p_num=ParagraphNumber.new(@md,@ocn)
@vz=SiSU_Env::GetInit.instance.skin
+ @make=SiSU_Env::ProcessingSettings.new(@md)
end
def nametags_scroll(dob)
tags=''
@@ -1134,8 +1120,11 @@ WOK
heading_normal('h6','norm')
end
def title_heading(tag,attrib)
+ cl=(@make.build.html_minitoc?) \
+ ? 'content'
+ : 'content0'
%{
-<div class="content">
+<div class="#{cl}">
<#{tag} class="#{attrib}">
#{@named}#{@txt}
</#{tag}>