From 72180b72ce9c1b0d25e7c22188c443f1f7836b3f Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 29 Apr 2010 14:15:49 -0400 Subject: markup for *{emphasis}* configurable as being either bold or italics * the default is that emphasis output is in bold so there is no change at present unless sisurc.yml is configured (markup: emphasis: 'italics') [requested] --- lib/sisu/v2/sysenv.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/sisu/v2/sysenv.rb') diff --git a/lib/sisu/v2/sysenv.rb b/lib/sisu/v2/sysenv.rb index ed0fe136..c5bc63c2 100644 --- a/lib/sisu/v2/sysenv.rb +++ b/lib/sisu/v2/sysenv.rb @@ -875,6 +875,13 @@ module SiSU_Env ? @rc['processing']['concord_max'] \ : (defaults[:concord_max]) end + def markup_emphasis + ((defined? @rc['markup']['emphasis']) \ + && @rc['markup']['emphasis'] \ + && (@rc['markup']['emphasis']=~/italic/)) \ + ? 'italics' \ + : 'bold' + end def current_document @@current_document||=Dir.pwd @@current_document -- cgit v1.2.3 From 88029687c9ad611c1f2c70f789347605dc2041c3 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 30 Apr 2010 19:52:57 -0400 Subject: emphasis display and plaintext line wrap configurable in document or sis * markup for *{emphasis}* configurable as being displayed either bold or italics, the default is that emphasis output is in bold so there is no at present unless configured, either in sisurc.yml (default: emphasis: 'italics'), or the markup source document header @make: :emphasis: 'it [requested] * plaintext, wrap width configurable between 20 to 200 characters, the default width being 78, configuration eithe rin sisurc.yml (default: t 78), or the markup source document header (@make: :plaintext_wrap: 78) --- lib/sisu/v2/sysenv.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'lib/sisu/v2/sysenv.rb') diff --git a/lib/sisu/v2/sysenv.rb b/lib/sisu/v2/sysenv.rb index c5bc63c2..4a2f7ee0 100644 --- a/lib/sisu/v2/sysenv.rb +++ b/lib/sisu/v2/sysenv.rb @@ -876,12 +876,21 @@ module SiSU_Env : (defaults[:concord_max]) end def markup_emphasis - ((defined? @rc['markup']['emphasis']) \ - && @rc['markup']['emphasis'] \ - && (@rc['markup']['emphasis']=~/italic/)) \ + ((defined? @rc['default']['emphasis']) \ + && @rc['default']['emphasis'] \ + && (@rc['default']['emphasis']=~/italic/)) \ ? 'italics' \ : 'bold' end + def plaintext_wrap + ((defined? @rc['default']['text_wrap']) \ + && (@rc['default']['text_wrap']) \ + && (@rc['default']['text_wrap'].to_s=~/\d\d+/) \ + && (@rc['default']['text_wrap'].to_i > 19) \ + && (@rc['default']['text_wrap'].to_i < 201)) \ + ? @rc['default']['text_wrap'].to_i \ + : 78 + end def current_document @@current_document||=Dir.pwd @@current_document -- cgit v1.2.3 From 2708d32e438edcddabdc6d62fc6898cbbe07f2a9 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 1 May 2010 08:58:49 -0400 Subject: *{emphasis}* display configurable as being bold, italics or underscore * markup for *{emphasis}* configurable as being displayed as bold, italics or underscore, the default is that emphasis output is in bold so there is no change unless configured, either in sisurc.yml (default: emphasis: 'bold'), or the markup source document header @make: :emphasis: 'bold' --- lib/sisu/v2/sysenv.rb | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'lib/sisu/v2/sysenv.rb') diff --git a/lib/sisu/v2/sysenv.rb b/lib/sisu/v2/sysenv.rb index 4a2f7ee0..5f3695de 100644 --- a/lib/sisu/v2/sysenv.rb +++ b/lib/sisu/v2/sysenv.rb @@ -876,11 +876,20 @@ module SiSU_Env : (defaults[:concord_max]) end def markup_emphasis - ((defined? @rc['default']['emphasis']) \ - && @rc['default']['emphasis'] \ - && (@rc['default']['emphasis']=~/italic/)) \ - ? 'italics' \ - : 'bold' + if defined? @rc['default']['emphasis'] \ + and @rc['default']['emphasis'] \ + and @rc['default']['emphasis']=~/bold/ + 'bold' + elsif defined? @rc['default']['emphasis'] \ + and @rc['default']['emphasis'] \ + and @rc['default']['emphasis']=~/italic/ + 'italics' + elsif defined? @rc['default']['emphasis'] \ + and @rc['default']['emphasis'] \ + and @rc['default']['emphasis']=~/underscore/ + 'underscore' + else 'bold' + end end def plaintext_wrap ((defined? @rc['default']['text_wrap']) \ -- cgit v1.2.3 From 003c1facff69bbfd2c9fe017406bc11e6d97cce0 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 2 May 2010 19:45:44 -0400 Subject: screen output, & minor arranging --- lib/sisu/v2/sysenv.rb | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'lib/sisu/v2/sysenv.rb') diff --git a/lib/sisu/v2/sysenv.rb b/lib/sisu/v2/sysenv.rb index 5f3695de..05277012 100644 --- a/lib/sisu/v2/sysenv.rb +++ b/lib/sisu/v2/sysenv.rb @@ -689,17 +689,13 @@ module SiSU_Env if @pdfetex_flag; texpdf_cmd=case texpdf when /xetex/ - if @input =~/landscape\.tex$/ - %{#{texpdf} -interaction=#{mode} -fmt=xelatex -papersize="#{papersize} -l" #{@input} #{tell}\n} - else - %{#{texpdf} -interaction=#{mode} -fmt=xelatex -papersize="#{papersize}" #{@input} #{tell}\n} - end + @input =~/landscape\.tex$/ \ + ? %{#{texpdf} -interaction=#{mode} -fmt=xelatex -papersize="#{papersize} -l" #{@input} #{tell}\n} \ + : %{#{texpdf} -interaction=#{mode} -fmt=xelatex -papersize="#{papersize}" #{@input} #{tell}\n} when /xelatex/ - if @input =~/landscape\.tex$/ - %{#{texpdf} -interaction=#{mode} -papersize="#{papersize} -l" #{@input} #{tell}\n} - else - %{#{texpdf} -interaction=#{mode} -papersize="#{papersize}" #{@input} #{tell}\n} - end + @input =~/landscape\.tex$/ \ + ? %{#{texpdf} -interaction=#{mode} -papersize="#{papersize} -l" #{@input} #{tell}\n} \ + : %{#{texpdf} -interaction=#{mode} -papersize="#{papersize}" #{@input} #{tell}\n} when /pdftex/; "#{texpdf} -interaction=#{mode} -fmt=pdflatex #{@input} #{tell}\n" when /pdflatex/; "#{texpdf} -interaction=#{mode} #{@input} #{tell}\n" end -- cgit v1.2.3 From 67e49a2b278b1512fb39a33a779f68a1389f9849 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 3 May 2010 19:09:54 -0400 Subject: ansi, screen info related, arranging --- lib/sisu/v2/sysenv.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'lib/sisu/v2/sysenv.rb') diff --git a/lib/sisu/v2/sysenv.rb b/lib/sisu/v2/sysenv.rb index 05277012..f440fd3f 100644 --- a/lib/sisu/v2/sysenv.rb +++ b/lib/sisu/v2/sysenv.rb @@ -246,10 +246,9 @@ module SiSU_Env if load_prog require @prog else - tell=if @mandatory; SiSU_Screen::Ansi.new(@cmd,"module required: #{@prog}") - else SiSU_Screen::Ansi.new(@cmd,"#{@prog} load requested") - end - tell.warn + @mandatory \ + ? (SiSU_Screen::Ansi.new(@cmd,"module required: #{@prog}").warn) \ + : (SiSU_Screen::Ansi.new(@cmd,"#{@prog} load requested").warn) end load_prog end @@ -1865,8 +1864,7 @@ WOK cmd=if @cmd; @cmd else '' end - tell=SiSU_Screen::Ansi.new(cmd,"WARNING - no local image directory or images:", defaults[:image_local] ) - tell.warn unless cmd =~/q/ + SiSU_Screen::Ansi.new(cmd,"WARNING - no local image directory or images:", defaults[:image_local] ).warn unless cmd =~/q/ @@local_image=false end url.images @@ -1884,8 +1882,7 @@ WOK '../_sisu/image_external' else if @@local_image==true - tell=SiSU_Screen::Ansi.new(@cmd,"WARNING - image directory for external images or no such images:", :image_external ) - tell.warn unless @cmd =~/q/ + SiSU_Screen::Ansi.new(@cmd,"WARNING - image directory for external images or no such images:", :image_external ).warn unless @cmd =~/q/ @@local_image=false end url.images_external @@ -2098,8 +2095,7 @@ WOK if FileTest.file?("#{Dir.pwd}/#{fns_pod}") system("unzip -q #{Dir.pwd}/#{fns_pod} -d #{path.processing}") else - tell=SiSU_Screen::Ansi.new('',"file not found: #{fns_pod}") - tell.warn unless @cmd=~/q/ + SiSU_Screen::Ansi.new('',"file not found: #{fns_pod}").warn unless @cmd=~/q/ end sisupod_processing_path end @@ -3285,7 +3281,7 @@ WOK css_path=['/etc/sisu/css',"#{@home}/.sisu/css","#{@pwd}/_sisu/css"] #BROKEN if defined? @rc['permission_set']['css_modify'] \ and @rc['permission_set']['css_modify'] - tell=SiSU_Screen::Ansi.new(@cmd,"modify is css set to: #{@rc['permission_set']['css_modify']}") + SiSU_Screen::Ansi.new(@cmd,"modify is css set to: #{@rc['permission_set']['css_modify']}").warn if @cmd=~/[MV]/ css_path.each do |x| if FileTest.directory?(x) cd(x) @@ -3296,9 +3292,8 @@ WOK cd(@pwd) end end - else tell=SiSU_Screen::Ansi.new(@cmd,"modify css is not set or is set to: false") + else SiSU_Screen::Ansi.new(@cmd,"modify css is not set or is set to: false").warn if @cmd=~/[MV]/ end - tell.warn if @cmd=~/[MV]/ fn_css=SiSU_Env::CSS_default.new css=SiSU_Style::CSS.new path_style="#{@env.path.output}/#{@env.path.style}" -- cgit v1.2.3