From edd89902036bde18c91031470e19c871a182cf6d Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 23 Oct 2013 23:40:45 -0400 Subject: v5: options & downstream, more use of opt.act instead of opt.cmd * opt.act.*.set==:on instead of opt.cmd =~/\S/ --- lib/sisu/v5/sst_do_inline_footnotes.rb | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'lib/sisu/v5/sst_do_inline_footnotes.rb') diff --git a/lib/sisu/v5/sst_do_inline_footnotes.rb b/lib/sisu/v5/sst_do_inline_footnotes.rb index 02b4a171..836d0d29 100644 --- a/lib/sisu/v5/sst_do_inline_footnotes.rb +++ b/lib/sisu/v5/sst_do_inline_footnotes.rb @@ -124,7 +124,7 @@ module SiSU_ConvertFootnotes protected def create_dal dal_array=[] - SiSU_Screen::Ansi.new(@opt.cmd,'convert footnotes').green_title_hi unless @opt.cmd =~/q/ + SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'convert footnotes').green_title_hi unless @opt.act[:quiet][:set]==:on file_array=IO.readlines(@opt.fns,'') file_array.each do |l| if l =~/\r\n/ then l.gsub!(/\r\n/,"\n") @@ -137,12 +137,12 @@ module SiSU_ConvertFootnotes or @md.opt.mod.inspect =~/=footnotes-force/ meta=nil dal=SiSU_ConvertFootnotes::Make.new(@md,file_array).song - SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@md.fns}.fn").output if @md.opt.cmd =~/v/ - SiSU_Screen::Ansi.new(@opt.cmd,"#{@md.fns}.fn -> #{@md.fns}.fn").txt_red unless @md.opt.cmd =~/q/ + SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],@opt.fns,"#{@md.fns}.fn").output if @md.opt.act[:verbose][:set]==:on + SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],"#{@md.fns}.fn -> #{@md.fns}.fn").txt_red unless @md.opt.act[:quiet][:set]==:on dal.each {|s| dal_array << "#{s.strip}\n\n" unless s.strip.empty?} dal_array else - SiSU_Screen::Ansi.new(@md.opt.cmd,'*WARN* no footnote conversion done, problem with source file','to override use --convert=footnote-force (this is not advised)').warn if @cmd !~/q/ + SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set],'*WARN* no footnote conversion done, problem with source file','to override use --convert=footnote-force (this is not advised)').warn unless @md.opt.act[:quiet][:set]==:on '' end end @@ -353,7 +353,10 @@ module SiSU_ConvertFootnotes end def set_heading_top #% make sure no false positives unless @md.set_heading_top - puts "\tdocument contains no top level heading, (will have to manufacture one)" if @md.opt.cmd =~/[MV]/ + if (@md.opt.act[:verbose_plus][:set]==:on \ + || @md.opt.act[:maintenance][:set]==:on) + puts "\tdocument contains no top level heading, (will have to manufacture one)" + end data=@data @tuned_file=[] data.each do |para| @@ -374,7 +377,10 @@ module SiSU_ConvertFootnotes end def set_heading_seg #% make sure no false positives unless @md.set_heading_seg - puts "\tdocument contains no segment level, (will have to manufacture one)" if @md.opt.cmd =~/[MV]/ + if (@md.opt.act[:verbose_plus][:set]==:on \ + || @md.opt.act[:maintenance][:set]==:on) + puts "\tdocument contains no segment level, (will have to manufacture one)" + end data=@data @tuned_file=[] data.each do |para| @@ -396,7 +402,10 @@ module SiSU_ConvertFootnotes end def set_header_title #% make sure no false positives unless @md.set_header_title - puts "\t no document title provided, (will have to manufacture one)" if @md.opt.cmd =~/[MV]/ + if (@md.opt.act[:verbose_plus][:set]==:on \ + || @md.opt.act[:maintenance][:set]==:on) + puts "\t no document title provided, (will have to manufacture one)" + end data=@data @tuned_file=[] data.each do |para| -- cgit v1.2.3