From e38554e5acad9b3dd93b0e6e4cedd39d5ff2f1a2 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 20:31:23 -0400 Subject: v5 v6: coding, various minor cosmetic --- lib/sisu/v5/constants.rb | 2 +- lib/sisu/v5/digests.rb | 12 +++++------ lib/sisu/v5/html_format.rb | 2 +- lib/sisu/v5/html_minitoc.rb | 3 ++- lib/sisu/v6/constants.rb | 2 +- lib/sisu/v6/digests.rb | 12 +++++------ lib/sisu/v6/html_format.rb | 2 +- lib/sisu/v6/html_minitoc.rb | 3 ++- lib/sisu/v6/texpdf_format.rb | 46 ++++++++++++++++++++--------------------- lib/sisu/v6/xml_docbook5.rb | 2 +- lib/sisu/v6/xml_fictionbook2.rb | 2 +- 11 files changed, 45 insertions(+), 43 deletions(-) (limited to 'lib/sisu') diff --git a/lib/sisu/v5/constants.rb b/lib/sisu/v5/constants.rb index a9be54f0..d47d9a7e 100644 --- a/lib/sisu/v5/constants.rb +++ b/lib/sisu/v5/constants.rb @@ -353,7 +353,7 @@ check: ♩ ♭  ✠  ▭ ▬ ▪ 【】〖〗◢ ◣ ◀ ▶ ◘ ◙ 《》「」 - ‹ › ∗  + ‹ › ∗  ∴ ∷ '〔lv1〕','〔lv2〕','〔lv3〕','〔lv4〕','〔lv5〕','〔lv6〕','〔lv7〕','〔lv8〕','〔lv9〕' '〔 Ѳ1〕','〔 Ѳ2〕','〔 Ѳ3〕','〔 Ѳ4〕','〔 Ѳ5〕','〔Ѳ6〕','〔Ѳ7〕','〔Ѳ8〕','〔Ѳ9〕' ◁▷ diff --git a/lib/sisu/v5/digests.rb b/lib/sisu/v5/digests.rb index 7099b646..3acd51eb 100644 --- a/lib/sisu/v5/digests.rb +++ b/lib/sisu/v5/digests.rb @@ -91,13 +91,13 @@ module SiSU_DigestView if @opt.act[:verbose_plus][:set]==:on \ or @opt.act[:maintenance][:set]==:on SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],@opt.fns,"file://#{@md.file.output_path.hash_digest.dir}/#{@md.file.base_filename.hash_digest}").flow - end - end - if SiSU_Env::SystemCall.new.openssl - SiSU_DigestView::Source::Scroll.new(@particulars).songsheet - else - SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('*EXITED* hash digests will not run without openssl') end + end + if SiSU_Env::SystemCall.new.openssl + SiSU_DigestView::Source::Scroll.new(@particulars).songsheet + else + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('*EXITED* hash digests will not run without openssl') + end rescue SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ diff --git a/lib/sisu/v5/html_format.rb b/lib/sisu/v5/html_format.rb index e244bbb8..058a8f34 100644 --- a/lib/sisu/v5/html_format.rb +++ b/lib/sisu/v5/html_format.rb @@ -217,7 +217,7 @@ module SiSU_HTML_Format @env=SiSU_Env::InfoEnv.new(md.fns) @file=SiSU_Env::FileOp.new(md) @o_str ||=SiSU_Env::ProcessingSettings.new(md).output_dir_structure - @make=SiSU_Env::ProcessingSettings.new(@md) + @make=SiSU_Env::ProcessingSettings.new(md) end def home %{ diff --git a/lib/sisu/v5/html_minitoc.rb b/lib/sisu/v5/html_minitoc.rb index 5366b127..8b802a81 100644 --- a/lib/sisu/v5/html_minitoc.rb +++ b/lib/sisu/v5/html_minitoc.rb @@ -143,7 +143,8 @@ end txt_obj={ txt: title } format_toc=SiSU_HTML_Format::FormatToc.new(@md,txt_obj) - toc_mini=if txt.name =~/^meta/ and txt.obj=~/Document Information/ + toc_mini=if txt.name =~/^meta/ \ + and txt.obj=~/Document Information/ format_toc.mini_tail else format_toc.mini_lev1 end diff --git a/lib/sisu/v6/constants.rb b/lib/sisu/v6/constants.rb index e70a2f98..0f76ed59 100644 --- a/lib/sisu/v6/constants.rb +++ b/lib/sisu/v6/constants.rb @@ -353,7 +353,7 @@ check: ♩ ♭  ✠  ▭ ▬ ▪ 【】〖〗◢ ◣ ◀ ▶ ◘ ◙ 《》「」 - ‹ › ∗  + ‹ › ∗  ∴ ∷ '〔lv1〕','〔lv2〕','〔lv3〕','〔lv4〕','〔lv5〕','〔lv6〕','〔lv7〕','〔lv8〕','〔lv9〕' '〔 Ѳ1〕','〔 Ѳ2〕','〔 Ѳ3〕','〔 Ѳ4〕','〔 Ѳ5〕','〔Ѳ6〕','〔Ѳ7〕','〔Ѳ8〕','〔Ѳ9〕' ◁▷ diff --git a/lib/sisu/v6/digests.rb b/lib/sisu/v6/digests.rb index e708e4e9..1fa2c80f 100644 --- a/lib/sisu/v6/digests.rb +++ b/lib/sisu/v6/digests.rb @@ -91,13 +91,13 @@ module SiSU_DigestView if @opt.act[:verbose_plus][:set]==:on \ or @opt.act[:maintenance][:set]==:on SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],@opt.fns,"file://#{@md.file.output_path.hash_digest.dir}/#{@md.file.base_filename.hash_digest}").flow - end - end - if SiSU_Env::SystemCall.new.openssl - SiSU_DigestView::Source::Scroll.new(@particulars).songsheet - else - SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('*EXITED* hash digests will not run without openssl') end + end + if SiSU_Env::SystemCall.new.openssl + SiSU_DigestView::Source::Scroll.new(@particulars).songsheet + else + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('*EXITED* hash digests will not run without openssl') + end rescue SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ diff --git a/lib/sisu/v6/html_format.rb b/lib/sisu/v6/html_format.rb index de5a7144..2f7b030e 100644 --- a/lib/sisu/v6/html_format.rb +++ b/lib/sisu/v6/html_format.rb @@ -217,7 +217,7 @@ module SiSU_HTML_Format @env=SiSU_Env::InfoEnv.new(md.fns) @file=SiSU_Env::FileOp.new(md) @o_str ||=SiSU_Env::ProcessingSettings.new(md).output_dir_structure - @make=SiSU_Env::ProcessingSettings.new(@md) + @make=SiSU_Env::ProcessingSettings.new(md) end def home %{ diff --git a/lib/sisu/v6/html_minitoc.rb b/lib/sisu/v6/html_minitoc.rb index 13045b0d..b36188ec 100644 --- a/lib/sisu/v6/html_minitoc.rb +++ b/lib/sisu/v6/html_minitoc.rb @@ -143,7 +143,8 @@ end txt_obj={ txt: title } format_toc=SiSU_HTML_Format::FormatToc.new(@md,txt_obj) - toc_mini=if txt.name =~/^meta/ and txt.obj=~/Document Information/ + toc_mini=if txt.name =~/^meta/ \ + and txt.obj=~/Document Information/ format_toc.mini_tail else format_toc.mini_lev1 end diff --git a/lib/sisu/v6/texpdf_format.rb b/lib/sisu/v6/texpdf_format.rb index 97007d17..c1bd0f1c 100644 --- a/lib/sisu/v6/texpdf_format.rb +++ b/lib/sisu/v6/texpdf_format.rb @@ -1188,16 +1188,16 @@ module SiSU_TeX_Pdf @brace_url=SiSU_Viz::Defaults.new.url_decoration @tex2pdf=@@tex3pdf ||=SiSU_Env::SystemCall.new.tex2pdf_engine end - def xetex_code_listings(str,is=:default) # ~ ^ $ & % _ { } #LaTeX special characters - KEEP list + def xetex_code_listings(str,is=:default) # ~ ^ $ & % _ { } #LaTeX special characters - KEEP list word=str.scan(/\S+|\n/) #unless line =~/^(?:@\S|%+\s)/ para_array=[] str=if word word.each do |w| # _ - / # | : ! ^ ~ w=w.gsub(/#{Mx[:gl_o]}#lt#{Mx[:gl_c]}/,'<').gsub(/#{Mx[:gl_o]}#gt#{Mx[:gl_c]}/,'>'). gsub(/[\\]?~/,'~'). - gsub(/[#{Mx[:br_line]}#{Mx[:br_paragraph]}]/,"\n"). #watch - gsub(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'~'). #126 usual - gsub(/\\?\||#{Mx[:gl_o]}#124#{Mx[:gl_c]}/,'|') #unless is=='code' #unless w=~/<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+>/ # | SiSU not really special sisu character but done, also LaTeX + gsub(/[#{Mx[:br_line]}#{Mx[:br_paragraph]}]/,"\n"). #watch + gsub(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'~'). #126 usual + gsub(/\\?\||#{Mx[:gl_o]}#124#{Mx[:gl_c]}/,'|') #unless is=='code' #unless w=~/<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+>/ # | SiSU not really special sisu character but done, also LaTeX para_array << w end str=para_array.join(' ') @@ -1210,30 +1210,30 @@ module SiSU_TeX_Pdf gsub(/#{Mx[:br_eof]}/,''). gsub(/#{Mx[:br_endnotes]}/,''). #problem sequence -> - gsub(/&(?:lt|#060);/,'<'). # < SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#(?:gt|062)#{Mx[:gl_c]}/,'>'). # > SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#123#{Mx[:gl_c]}/,'{'). # { SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#125#{Mx[:gl_c]}/,'}'). # } SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'~'). # ~ SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#035#{Mx[:gl_c]}/,'#'). # # SiSU special character also LaTeX + gsub(/&(?:lt|#060);/,'<'). # < SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#(?:gt|062)#{Mx[:gl_c]}/,'>'). # > SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#123#{Mx[:gl_c]}/,'{'). # { SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#125#{Mx[:gl_c]}/,'}'). # } SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'~'). # ~ SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#035#{Mx[:gl_c]}/,'#'). # SiSU special character also LaTeX gsub(/#{Mx[:gl_o]}#033#{Mx[:gl_c]}/,'!'). # ! SiSU not really special sisu character but done, also LaTeX #gsub(/(^|\s)\*\s/,'\1\asterisk '). # * should you wish to escape astrisk e.g. describing \*{bold}* - gsub(/#{Mx[:gl_o]}#042#{Mx[:gl_c]}/,'*'). # * should you wish to escape astrisk e.g. describing \*{bold}* + gsub(/#{Mx[:gl_o]}#042#{Mx[:gl_c]}/,'*'). # * should you wish to escape astrisk e.g. describing \*{bold}* gsub(/#{Mx[:gl_o]}#045#{Mx[:gl_c]}/,'-'). # - SiSU special character also LaTeX gsub(/#{Mx[:gl_o]}#043#{Mx[:gl_c]}/,'+'). # + SiSU special character also LaTeX gsub(/#{Mx[:gl_o]}#044#{Mx[:gl_c]}/,','). # + SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#038#{Mx[:gl_c]}/,'&'). #unless @txt=~/<:code>/ # / SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#047#{Mx[:gl_c]}/,'/'). # / SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#092#{Mx[:gl_c]}/,'\\'). # \ SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#095#{Mx[:gl_c]}/,'_'). # _ SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#038#{Mx[:gl_c]}/,'&'). #unless @txt=~/<:code>/ # / SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#047#{Mx[:gl_c]}/,'/'). # / SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#092#{Mx[:gl_c]}/,'\\'). # \ SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#095#{Mx[:gl_c]}/,'_'). # _ SiSU special character also LaTeX gsub(/#{Mx[:gl_o]}#124#{Mx[:gl_c]}/,'|'). # | SiSU not really special sisu character but done, also LaTeX gsub(/#{Mx[:gl_o]}#058#{Mx[:gl_c]}/,':'). # : SiSU not really special sisu character but done, also LaTeX - gsub(/#{Mx[:gl_o]}#094#{Mx[:gl_c]}|\^/,'^'). # ^ SiSU not really special sisu character but done, also LaTeX + gsub(/#{Mx[:gl_o]}#094#{Mx[:gl_c]}|\^/,'^'). # ^ SiSU not really special sisu character but done, also LaTeX ##watch placement, problem sequence ^ gsub(/&atild;<\/font><\/sup>/,' '). - gsub(/\\copy(right|mark)?/,'<=copymark>') # ok problem with superscript + gsub(/\\copy(right|mark)?/,'<=copymark>') # ok problem with superscript end - def xetex_special_characters_1(str,is=:default) # ~ ^ $ & % _ { } #LaTeX special characters - KEEP list + def xetex_special_characters_1(str,is=:default) # ~ ^ $ & % _ { } #LaTeX special characters - KEEP list word=str.scan(/\S+|\n/) #unless line =~/^(?:@\S|%+\s)/ para_array=[] str=if word @@ -1245,9 +1245,9 @@ module SiSU_TeX_Pdf end w=w.gsub(/#{Mx[:gl_o]}#lt#{Mx[:gl_c]}/,'<').gsub(/#{Mx[:gl_o]}#gt#{Mx[:gl_c]}/,'>'). gsub(/[\\]?~/,'<=tilde>'). - gsub(/[#{Mx[:br_line]}#{Mx[:br_paragraph]}]/,' \newline '). #watch - gsub(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'<=tilde>'). #126 usual - gsub(/\\?\||#{Mx[:gl_o]}#124#{Mx[:gl_c]}/,'\pipe') #unless is=='code' #unless w=~/<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+>/ # | SiSU not really special sisu character but done, also LaTeX + gsub(/[#{Mx[:br_line]}#{Mx[:br_paragraph]}]/,' \newline '). #watch + gsub(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'<=tilde>'). #126 usual + gsub(/\\?\||#{Mx[:gl_o]}#124#{Mx[:gl_c]}/,'\pipe') #unless is=='code' #unless w=~/<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+>/ # | SiSU not really special sisu character but done, also LaTeX if w !~/#{Mx[:rel_o]}/ \ and w !~/#{Mx[:gl_o]}#/ w=w.gsub(/\#/,'<=hash>') @@ -1264,8 +1264,8 @@ module SiSU_TeX_Pdf gsub(/#{Mx[:br_eof]}/,''). gsub(/#{Mx[:br_endnotes]}/,'') #problem sequence -> - str=str.gsub(/&(?:nbsp);|#{Mx[:nbsp]}/,'\hardspace') unless is==:code # < SiSU special character also LaTeX - str=str.gsub(/&(?:lt|#060);/,'\lt'). # < SiSU special character also LaTeX + str=str.gsub(/&(?:nbsp);|#{Mx[:nbsp]}/,'\hardspace') unless is==:code # < SiSU special character also LaTeX + str=str.gsub(/&(?:lt|#060);/,'\lt'). # < SiSU special character also LaTeX gsub(/#{Mx[:gl_o]}#(?:gt|062)#{Mx[:gl_c]}/,'\gt'). # > SiSU special character also LaTeX gsub(/#{Mx[:gl_o]}#123#{Mx[:gl_c]}/,'\curlyopen'). # { SiSU special character also LaTeX gsub(/#{Mx[:gl_o]}#125#{Mx[:gl_c]}/,'\curlyclose'). # } SiSU special character also LaTeX diff --git a/lib/sisu/v6/xml_docbook5.rb b/lib/sisu/v6/xml_docbook5.rb index 84c2181c..98369836 100644 --- a/lib/sisu/v6/xml_docbook5.rb +++ b/lib/sisu/v6/xml_docbook5.rb @@ -110,7 +110,7 @@ module SiSU_XML_Docbook_Book class Scroll [#{o.ocn}] #{o.ln} #{o.obj}#{comment}" : "<#{o.lc}>[#{o.ocn}] #{o.ln} #{o.obj}#{comment}" end -- cgit v1.2.3