aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/html.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2013-10-23 23:40:45 -0400
committerRalph Amissah <ralph@amissah.com>2013-10-23 23:40:45 -0400
commitedd89902036bde18c91031470e19c871a182cf6d (patch)
tree1269e7b1660aa64896fc21768002e837233c2c24 /lib/sisu/v5/html.rb
parentv4 v5: version & changelog (diff)
v5: options & downstream, more use of opt.act instead of opt.cmd
* opt.act.*.set==:on instead of opt.cmd =~/\S/
Diffstat (limited to 'lib/sisu/v5/html.rb')
-rw-r--r--lib/sisu/v5/html.rb38
1 files changed, 27 insertions, 11 deletions
diff --git a/lib/sisu/v5/html.rb b/lib/sisu/v5/html.rb
index f0b22285..f1abe6c0 100644
--- a/lib/sisu/v5/html.rb
+++ b/lib/sisu/v5/html.rb
@@ -95,14 +95,21 @@ module SiSU_HTML
primary_output_file=(@opt.act[:html_seg][:set]==:on) \
? (@md.file.output_path.html_seg.dir + '/' + @md.file.base_filename.html_segtoc)
: (@md.file.output_path.html_scroll.dir + '/' + @md.file.base_filename.html_scroll)
- unless @opt.cmd =~/q/
- tool=(@opt.cmd =~/[MVvz]/) \
+ unless @opt.act[:quiet][:set]==:on
+ tool=(@opt.act[:verbose][:set]==:on \
+ || @opt.act[:verbose_plus][:set]==:on \
+ || @opt.act[:maintenance][:set]==:on) \
? ("#{@env.program.web_browser} file://#{primary_output_file}")
: ("[#{@opt.f_pth[:lng_is]}] #{@opt.fno}")
- @opt.cmd=~/[MVvz]/ \
- ? SiSU_Screen::Ansi.new(@opt.cmd,'HTML',tool).green_hi_blue
- : SiSU_Screen::Ansi.new(@opt.cmd,'HTML',tool).green_title_hi
- SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"file://#{primary_output_file}").flow if @opt.cmd =~/[MV]/
+ (@opt.act[:verbose][:set]==:on \
+ || @opt.act[:verbose_plus][:set]==:on \
+ || @opt.act[:maintenance][:set]==:on) \
+ ? SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'HTML',tool).green_hi_blue
+ : SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'HTML',tool).green_title_hi
+ if (@opt.act[:verbose_plus][:set]==:on \
+ || @opt.act[:maintenance][:set]==:on)
+ SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],@opt.fns,"file://#{primary_output_file}").flow
+ end
end
data=nil
tuned_file_array=SiSU_HTML::Source::HTML_Environment.new(@particulars).tuned_file_instructions
@@ -128,7 +135,8 @@ module SiSU_HTML
__LINE__.to_s + ':' + __FILE__
end
ensure
- unless @opt.cmd =~/[MV]/ #check maintenance flag
+ unless (@opt.act[:verbose_plus][:set]==:on \
+ || @opt.act[:maintenance][:set]==:on)
texfiles=Dir["#{@env.processing_path.tune}/#{@opt.fns}*"]
texfiles.each do |f|
if FileTest.file?(f)
@@ -153,7 +161,7 @@ module SiSU_HTML
@env,@css=particulars.env,SiSU_Style::CSS.new
end
def tuned_file_instructions
- @tell=SiSU_Screen::Ansi.new(@md.opt.cmd)
+ @tell=SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set])
dal_array=@particulars.dal_array # dal file drawn here
tuned_file_array=SiSU_HTML_Tune::Tune.new(dal_array,@md).songsheet
tuned_file_array
@@ -232,10 +240,14 @@ module SiSU_HTML
def initialize(md=nil,data='')
@data,@md=data,md
@vz=SiSU_Viz::Defaults.new
- @tell=SiSU_Screen::Ansi.new(@md.opt.cmd) if @md
+ @tell=SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set]) if @md
end
def songsheet #extracts toc for scroll & seg
- SiSU_Screen::Ansi.new(@md.opt.cmd,'Toc').txt_grey if @md.opt.cmd =~/[MVv]/
+ if (@md.opt.act[:verbose][:set]==:on \
+ || @md.opt.act[:verbose_plus][:set]==:on \
+ || @md.opt.act[:maintenance][:set]==:on)
+ SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set],'Toc').txt_grey
+ end
toc=nil
@@firstseg=nil
@@toc={ seg: [], seg_mini: [], scr: [] }
@@ -543,7 +555,11 @@ WOK
def in_common
toc_shared=[]
@segtoc=[]
- SiSU_Screen::Ansi.new(@md.opt.cmd,'Scroll & Segtoc').txt_grey if @md.opt.cmd =~/[MVv]/
+ if (@md.opt.act[:verbose][:set]==:on \
+ || @md.opt.act[:verbose_plus][:set]==:on \
+ || @md.opt.act[:maintenance][:set]==:on)
+ SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set],'Scroll & Segtoc').txt_grey
+ end
format_head_toc=SiSU_HTML_Format::HeadToc.new(@md)
dochead=format_head_toc.head
dochead=dochead.gsub(/toc\.(html)/,'doc.\1') #kludge