From 0788fabbb581516c3cbb31d2ebc800844e636a6f Mon Sep 17 00:00:00 2001
From: Ralph Amissah <ralph@amissah.com>
Date: Sat, 29 Dec 2012 23:14:23 -0500
Subject: v4: options, sysenv, check (existing) inclusions & exclusions, fixes

* command line, document header, sisurc
---
 lib/sisu/v4/concordance.rb |  6 ++--
 lib/sisu/v4/epub_format.rb |  4 +--
 lib/sisu/v4/manifest.rb    |  5 +--
 lib/sisu/v4/sysenv.rb      | 85 +++++++++++++++++++++++++++-------------------
 4 files changed, 59 insertions(+), 41 deletions(-)

(limited to 'lib')

diff --git a/lib/sisu/v4/concordance.rb b/lib/sisu/v4/concordance.rb
index f93fbd6a..800331d2 100644
--- a/lib/sisu/v4/concordance.rb
+++ b/lib/sisu/v4/concordance.rb
@@ -118,20 +118,20 @@ module SiSU_Concordance
         @doc_details =<<WOK
 <table summary="links to text related to this rudimentary index" width="96%" border="0" bgcolor="white" cellpadding="0" align="center"><tr><td width="2%" align="right">&nbsp;</td><td width="94%" valign="top" align="justify"><h1 class="small"><a href="#{@md.file.base_filename.html_segtoc}"><b>#{@md.title.full}</b></a></h1><p class="bold">#{@md.author}</p></td></tr></table>
 WOK
+        @make=SiSU_Env::ProcessingSettings.new(@md)
       end
       def create
         head_banner=SiSU_HTML_Format::HeadToc.new(@md)
         minitoc=SiSU_HTML_MiniToc::TocMini.new(@md,@data).songsheet.join("\n")
         stylesheet=SiSU_Style::CSS_HeadInfo.new(@md).stylesheet
-        make=SiSU_Env::ProcessingSettings.new(@md)
-        if make.build.manifest_minitoc?
+        if @make.build.manifest_minitoc?
           toc='<div class="toc">' + minitoc + '</div>'
           div_class='content'
         else
           toc=''
           div_class='content0'
         end
-        top_band=if make.build.html_top_band?
+        top_band=if @make.build.html_top_band?
           head_banner.concordance_navigation_band
         else ''
         end
diff --git a/lib/sisu/v4/epub_format.rb b/lib/sisu/v4/epub_format.rb
index 98fc385d..c3642b06 100644
--- a/lib/sisu/v4/epub_format.rb
+++ b/lib/sisu/v4/epub_format.rb
@@ -64,8 +64,8 @@ module SiSU_EPUB_Format
       vz=SiSU_Viz::Defaults.new
     end
     def ocn_display
-      @make=SiSU_Env::ProcessingSettings.new(@md)
-      if @make.build.ocn?
+      make=SiSU_Env::ProcessingSettings.new(@md)
+      if make.build.ocn?
         ocn_class='ocn'
         if @ocn.to_i==0
           @ocn.gsub(/^(\d+|)$/,
diff --git a/lib/sisu/v4/manifest.rb b/lib/sisu/v4/manifest.rb
index 9c4fceb9..0571a332 100644
--- a/lib/sisu/v4/manifest.rb
+++ b/lib/sisu/v4/manifest.rb
@@ -777,10 +777,11 @@ WOK
       end
       def check_output(data)
         begin
+          make=SiSU_Env::ProcessingSettings.new(@md)
           minitoc=SiSU_HTML_MiniToc::TocMini.new(@md,data).songsheet.join("\n")
           id,file='',''
           vz=SiSU_Viz::Defaults.new
-          search_form=if @f.build.search_form?
+          search_form=if make.build.search_form?
             "<td>#{@env.widget_static.search_form}</td>"
           else ''
           end
@@ -802,7 +803,7 @@ SiSU manifest: #{@md.title.full}
 <body bgcolor="#ffffff" text="#000000" link="#003090" lang="en" xml:lang="en">
 #{format_head_toc.seg_head_navigation_band(:manifest)}
 WOK
-          if @f.build.manifest_minitoc?
+          if make.build.manifest_minitoc?
             if @o_str.dump_or_redirect?
             elsif @f.output_dir_structure.by_language_code? \
             or @f.output_dir_structure.by_filetype?
diff --git a/lib/sisu/v4/sysenv.rb b/lib/sisu/v4/sysenv.rb
index f41417fa..f97063ca 100644
--- a/lib/sisu/v4/sysenv.rb
+++ b/lib/sisu/v4/sysenv.rb
@@ -3584,7 +3584,9 @@ WOK
       @env_rc ||=SiSU_Env::InfoEnv.new(@md.fns)
     end
     def doc_rc #document rc, make instructions
-      @md.make
+      (defined? @md.make) \
+      ? @md.make
+      : nil
     end
     def cmd_rc_act #command-line rc
       @cmd_rc_act=@md.opt.opt_act
@@ -3595,8 +3597,9 @@ WOK
           true
         elsif cmd_rc_act[:ocn][:set]==:off
           false
-        elsif defined? @md.make.ocn? \
-        and @md.make.ocn? ==:off
+        elsif doc_rc.is_a?(Method) \
+        and defined? doc_rc.ocn? \
+        and doc_rc.toc? ==:off
           false
         elsif env_rc.build.ocn? ==:off
           false
@@ -3609,8 +3612,9 @@ WOK
           true
         elsif cmd_rc_act[:toc][:set]==:off
           false
-        elsif defined? @md.make.toc? \
-        and @md.make.toc? ==:off
+        elsif doc_rc.is_a?(Method) \
+        and defined? doc_rc.toc? \
+        and doc_rc.toc? ==:off
           false
         elsif env_rc.build.toc? ==:off
           false
@@ -3623,8 +3627,9 @@ WOK
           true
         elsif cmd_rc_act[:manifest][:set]==:off
           false
-        elsif defined? @md.make.manifest? \
-        and @md.make.manifest? ==:off
+        elsif doc_rc.is_a?(Method) \
+        and defined? doc_rc.manifest? \
+        and doc_rc.manifest? ==:off
           false
         elsif env_rc.build.manifest? ==:off
           false
@@ -3637,8 +3642,9 @@ WOK
           true
         elsif cmd_rc_act[:links_to_manifest][:set]==:off
           false
-        elsif defined? @md.make.links_to_manifest? \
-        and @md.make.links_to_manifest? ==:off
+        elsif doc_rc.is_a?(Method) \
+        and defined? doc_rc.links_to_manifest? \
+        and doc_rc.links_to_manifest? ==:off
           false
         elsif env_rc.build.links_to_manifest? ==:off
           false
@@ -3651,8 +3657,9 @@ WOK
           true
         elsif cmd_rc_act[:metadata][:set]==:off
           false
-        elsif defined? @md.make.metadata? \
-        and @md.make.metadata? ==:off
+        elsif doc_rc.is_a?(Method) \
+        and defined? doc_rc.metadata? \
+        and doc_rc.metadata? ==:off
           false
         elsif env_rc.build.metadata? ==:off
           false
@@ -3667,8 +3674,9 @@ WOK
           true
         elsif cmd_rc_act[:minitoc][:set]==:off
           false
-        elsif defined? @md.make.minitoc? \
-        and @md.make.minitoc? ==:off
+        elsif doc_rc.is_a?(Method) \
+        and defined? doc_rc.minitoc? \
+        and doc_rc.minitoc? ==:off
           false
         elsif env_rc.build.minitoc? ==:off
           false
@@ -3685,9 +3693,10 @@ WOK
         elsif cmd_rc_act[:manifest_minitoc][:set]==:off \
         || cmd_rc_act[:minitoc][:set]==:off
           false
-        elsif defined? @md.make.manifest_minitoc? \
-        and (@md.make.manifest_minitoc? ==:off \
-        || @md.make.minitoc? ==:off)
+        elsif doc_rc.is_a?(Method) \
+        and defined? doc_rc.manifest_minitoc? \
+        and (doc_rc.manifest_minitoc? ==:off \
+        || doc_rc.minitoc? ==:off)
           false
         elsif env_rc.build.manifest_minitoc? ==:off \
         || env_rc.build.minitoc? ==:off
@@ -3707,9 +3716,10 @@ WOK
         elsif cmd_rc_act[:html_minitoc][:set]==:off \
         || cmd_rc_act[:minitoc][:set]==:off
           false
-        elsif defined? @md.make.html_minitoc? \
-        and (@md.make.html_minitoc? ==:off \
-        || @md.make.minitoc? ==:off)
+        elsif doc_rc.is_a?(Method) \
+        and defined? doc_rc.html_minitoc? \
+        and (doc_rc.html_minitoc? ==:off \
+        || doc_rc.minitoc? ==:off)
           false
         elsif env_rc.build.html_minitoc? ==:off \
         || env_rc.build.minitoc? ==:off
@@ -3725,8 +3735,9 @@ WOK
           true
         elsif cmd_rc_act[:html_top_band][:set]==:off
           false
-        elsif defined? @md.make.html_top_band? \
-        and @md.make.html_top_band? ==:off
+        elsif doc_rc.is_a?(Method) \
+        and defined? doc_rc.html_top_band? \
+        and doc_rc.html_top_band? ==:off
           false
         elsif env_rc.build.html_top_band? ==:off
           false
@@ -3739,8 +3750,9 @@ WOK
           true
         elsif cmd_rc_act[:html_navigation][:set]==:off
           false
-        elsif defined? @md.make.html_navigation? \
-        and @md.make.html_navigation? ==:off
+        elsif doc_rc.is_a?(Method) \
+        and defined? doc_rc.html_navigation? \
+        and doc_rc.html_navigation? ==:off
           false
         elsif env_rc.build.html_navigation? ==:off
           false
@@ -3753,8 +3765,9 @@ WOK
           true
         elsif cmd_rc_act[:html_navigation_bar][:set]==:off
           false
-        elsif defined? @md.make.html_navigation_bar? \
-        and @md.make.html_navigation_bar? ==:off
+        elsif doc_rc.is_a?(Method) \
+        and defined? doc_rc.html_navigation_bar? \
+        and doc_rc.html_navigation_bar? ==:off
           false
         elsif env_rc.build.html_navigation_bar? ==:off
           false
@@ -3767,8 +3780,9 @@ WOK
           true
         elsif cmd_rc_act[:search_form][:set]==:off
           false
-        elsif defined? @md.make.html_search_form? \
-        and @md.make.search_form? ==:off
+        elsif doc_rc.is_a?(Method) \
+        and defined? doc_rc.html_search_form? \
+        and doc_rc.search_form? ==:off
           false
         elsif env_rc.build.search_form? ==:off
           false
@@ -3783,9 +3797,10 @@ WOK
         elsif cmd_rc_act[:html_search_form][:set]==:off \
         || cmd_rc_act[:search_form][:set]==:off
           false
-        elsif defined? @md.make.html_search_form? \
-        and (@md.make.html_search_form? ==:off \
-        || @md.make.search_form? ==:off)
+        elsif doc_rc.is_a?(Method) \
+        and defined? doc_rc.html_search_form? \
+        and (doc_rc.html_search_form? ==:off \
+        || doc_rc.search_form? ==:off)
           false
         elsif env_rc.build.html_search_form? ==:off \
         || env_rc.build.search_form? ==:off
@@ -3801,8 +3816,9 @@ WOK
           true
         elsif cmd_rc_act[:html_right_pane][:set]==:off
           false
-        elsif defined? @md.make.html_right_pane? \
-        and @md.make.html_right_pane? ==:off
+        elsif doc_rc.is_a?(Method) \
+        and defined? doc_rc.html_right_pane? \
+        and doc_rc.html_right_pane? ==:off
           false
         elsif env_rc.build.html_right_pane? ==:off
           false
@@ -3815,8 +3831,9 @@ WOK
           true
         elsif cmd_rc_act[:segsubtoc][:set]==:off
           false
-        elsif defined? @md.make.segsubtoc? \
-        and @md.make.segsubtoc? ==:off
+        elsif doc_rc.is_a?(Method) \
+        and defined? doc_rc.segsubtoc? \
+        and doc_rc.segsubtoc? ==:off
           false
         elsif env_rc.build.segsubtoc? ==:off
           false
-- 
cgit v1.2.3