diff options
author | Ralph Amissah <ralph@amissah.com> | 2012-03-12 18:45:04 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2012-03-12 18:45:07 -0400 |
commit | 756caa5d09492586824354864be6a5c9fe244005 (patch) | |
tree | 0eac01253f40ef786242092a5618adc724e013d4 /lib/sisu/v3dv/html_format.rb | |
parent | v3dv: sysenv, param, options, output control hooks code modified (diff) |
v3dv: start using output control hooks
* for config file, document headers, & command line
* v3dv: sysenv, ProcessingSettings, start to use hooks to make it possible
to control (via: the command line; the document markup header, or; the
configuration file) the likes of: ocn, toc, segsubtoc, minitoc,
links-to-manifest, search-form, html-navigation, html-navigation-bar,
html-right-pane, html-top-band; these are switched on by default and may
be switched off in omit lists within configuration file, the document
markup header, or command line. The command line takes precedence & may
switch on or off overriding settings within the document markup header or
the sisu configuration file.
* --inc- on by default, but if switched off in doc header or
configuration, the command line --inc- has precedence; for each possible
exclude configuration the --inc- switch that overrides configuration
settings
* --exc- == --no-; exclude/switch off feature (but --inc- include has
precedence)
* document header @build: :omit: [list output features to be omitted]
* configuration (sisurc.yml) omit:
exclude output feature, overrides configuration settings (omit --dev
development branch modifier once merged back to main)
--exc-ocn, html (seg, scroll), epub, xml, pdf
sisu --dev --exc-ocn --html --epub --xml-sax --xml-dom --xhtml -v \
filename.sst
--exc-toc, html (scroll), epub, pdf
sisu --dev --exc-toc --html --epub --pdf -v filename.sst
--exc-segsubtoc html (seg), epub
sisu --dev --exc-segsubtoc --html --epub -v filename.sst
--exc-minitoc, html (seg), concordance, manifest
sisu --dev --exc-minitoc --html --concordance -v filename.sst
--exc-manifest-minitoc, manifest
sisu --dev --exc-manifest-minitoc --html -v filename.sst
--exc-links_to_manifest, --exc-manifest-links,
html (seg, scroll)
sisu --dev --exc-manifest-links --html -v filename.sst
--exc-search-form, html (seg, scroll), manifest
sisu --dev --exc-search-form --html -v filename.sst
--exc-html-minitoc, html (seg), concordance
sisu --dev --exc-html-minitoc --html --concordance -v filename.sst
--exc-html-navigation, html (seg, scroll)?
sisu --dev --exc-html-navigation --html -v filename.sst
--exc-html-navigation-bar, html (seg)
sisu --dev --exc-html-navigation-bar --html -v filename.sst
--exc-html-search-form, html (seg, scroll)
sisu --dev --exc-html-search-form --html -v filename.sst
--exc-html-right-pane, html (seg, scroll)
sisu --dev --exc-html-right-pane --html -v filename.sst
--exc-html-top-band, html (seg, scroll), concordance (minitoc is
forced on to provide seg navigation)
sisu --dev --exc-html-top-band --html --concordance -v filename.sst
Diffstat (limited to 'lib/sisu/v3dv/html_format.rb')
-rw-r--r-- | lib/sisu/v3dv/html_format.rb | 91 |
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}"> </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}"> </label>}) - elsif @ocn.to_i==0 - @ocn.gsub(/^(\d+|)$/, - %{<label class="#{ocn_class}"><a name="#{@ocn}"> </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%"> #{@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> #{@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="->"> @@ -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="->"> - #{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%"> - -</td> -<td width="75%" align="center"> - #{@tocband_segtoc} -</td> -<td width="5%" align="right"> - #{firstseg} -#{@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}> |