diff options
author | Ralph Amissah <ralph@amissah.com> | 2011-06-26 22:42:15 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2011-06-26 22:42:15 -0400 |
commit | 3faddcd7728f76626f0ae324ca3c7efac0697a85 (patch) | |
tree | 1424fcaa4fb9afaec4d5149b8a8602f5dae55eb7 /lib | |
parent | debian/changelog (3.0.12-1) (diff) | |
parent | v3: documentation, on additional breaks in document, (remove some old info) (diff) |
Merge branch 'upstream' into debian/sid
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v2/dal_syntax.rb | 21 | ||||
-rw-r--r-- | lib/sisu/v2/texpdf.rb | 4 | ||||
-rw-r--r-- | lib/sisu/v2/texpdf_format.rb | 5 | ||||
-rw-r--r-- | lib/sisu/v3/composite.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v3/concordance.rb | 4 | ||||
-rw-r--r-- | lib/sisu/v3/constants.rb | 6 | ||||
-rw-r--r-- | lib/sisu/v3/dal.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v3/dal_syntax.rb | 21 | ||||
-rw-r--r-- | lib/sisu/v3/digests.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v3/epub.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v3/html.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v3/html_tune.rb | 179 | ||||
-rw-r--r-- | lib/sisu/v3/manifest.rb | 38 | ||||
-rw-r--r-- | lib/sisu/v3/manpage.rb | 42 | ||||
-rw-r--r-- | lib/sisu/v3/odf.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v3/plaintext.rb | 3 | ||||
-rw-r--r-- | lib/sisu/v3/sysenv.rb | 134 | ||||
-rw-r--r-- | lib/sisu/v3/texinfo.rb | 20 | ||||
-rw-r--r-- | lib/sisu/v3/texinfo_format.rb | 3 | ||||
-rw-r--r-- | lib/sisu/v3/texpdf.rb | 26 | ||||
-rw-r--r-- | lib/sisu/v3/texpdf_format.rb | 68 | ||||
-rw-r--r-- | lib/sisu/v3/urls.rb | 48 | ||||
-rw-r--r-- | lib/sisu/v3/xhtml.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v3/xml.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v3/xml_dom.rb | 2 |
25 files changed, 374 insertions, 266 deletions
diff --git a/lib/sisu/v2/dal_syntax.rb b/lib/sisu/v2/dal_syntax.rb index 76287464..35505d12 100644 --- a/lib/sisu/v2/dal_syntax.rb +++ b/lib/sisu/v2/dal_syntax.rb @@ -122,6 +122,7 @@ module SiSU_Syntax def songsheet @data.compact! @data.each do |dob| + dob=breaks(dob) dob=if @md.sem_tag then sem(dob) else dob end #revisit dob=wordlist_italics(dob) dob=wordlist_bold(dob) @@ -133,6 +134,13 @@ module SiSU_Syntax def sem(dob) #revisit dob=SiSU_sem::Tags.new(dob,@md).rm.all end + def breaks(dob) + if dob.is !~/^(?:meta|comment|code|table)/ + dob.obj.gsub!(/ \\\\(?: |$)/,"#{Mx[:br_line]}") + dob.obj.gsub!(/(?:<:?br>|<br \/>)/,"#{Mx[:br_line]}") # depreciated + end + dob + end def wordlist_italics(dob) dob=dob.dup if (defined? @md.make.italics[:str] \ @@ -166,11 +174,11 @@ module SiSU_Syntax dob end def embolden(given) - given.gsub!(/^!_\s+((?:\{|#{Mx[:lnk_o]})(?:~^ )?.+?(?:\}|#{Mx[:lnk_o]})https?:\/\/\S+.*?)(<br>|[#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}])/, + given.gsub!(/^!_\s+((?:\{|#{Mx[:lnk_o]})(?:~^ )?.+?(?:\}|#{Mx[:lnk_o]})https?:\/\/\S+.*?)([#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}])/, "#{Mx[:fa_bold_o]} \\1 #{Mx[:fa_bold_c]}\\2") given.gsub!(/^!_\s+((?:\{|#{Mx[:lnk_o]})(?:~^ )?.+?(?:\}|#{Mx[:lnk_o]})https?:\/\/\S+.*)/, "#{Mx[:fa_bold_o]} \\1 #{Mx[:fa_bold_c]}") - given.gsub!(/(?:^!_|^#{Mx[:lv_o]}[7-9]:\S*?#{Mx[:lv_c]})\s*(.+?)(<br>|[#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}])/, + given.gsub!(/(?:^!_|^#{Mx[:lv_o]}[7-9]:\S*?#{Mx[:lv_c]})\s*(.+?)([#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}])/, "#{Mx[:fa_bold_o]}\\1#{Mx[:fa_bold_c]}\\2") given.gsub!(/(?:^!_|^#{Mx[:lv_o]}[7-9]:\S*?#{Mx[:lv_c]})\s*(.+?)\s+((?:[*]~\S+\s*)+)/, "#{Mx[:fa_bold_o]}\\1#{Mx[:fa_bold_c]}\\2") @@ -180,7 +188,7 @@ module SiSU_Syntax "#{Mx[:fa_bold_o]}\\1#{Mx[:fa_bold_c]}") end def italicise(given) - given.gsub!(/^\/_\s*(.+?)(<br>|[#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}])/, + given.gsub!(/^\/_\s*(.+?)([#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}])/, "#{Mx[:fa_italics_o]}\\1#{Mx[:fa_italics_c]}\\2") given.gsub!(/^\/_\s*(.+?)\s+((?:[*]~\S+\s*)+)/, "#{Mx[:fa_italics_o]}\\1#{Mx[:fa_italics_c]}\\2") @@ -314,7 +322,7 @@ module SiSU_Syntax dob.obj.gsub!(/\s*@title\b/," #{@md.title.full}") if defined? @md.creator.author \ and @md.creator.author - dob.obj.gsub!(/\s+(?:@creator|@author)/,",<br />#{@md.creator.author}") + dob.obj.gsub!(/\s+(?:@creator|@author)/,",#{Mx[:br_line]}#{@md.creator.author}") else dob.obj.gsub!(/\s+(?:@creator|@author)/,'') end end @@ -352,7 +360,6 @@ module SiSU_Syntax dob.obj.gsub!(/\\\\/,"#{Mx[:gl_o]}#092#{Mx[:gl_c]}") #escaped special character dob.obj.gsub!(/\\\*/,"#{Mx[:gl_o]}#042#{Mx[:gl_c]}") #escaped special character dob.obj.gsub!(/\\\!/,"#{Mx[:gl_o]}#033#{Mx[:gl_c]}") #escaped special character - dob.obj.gsub!(/(?:<:?br>|<br \/>)/,"#{Mx[:br_line]}") #indent used in endnotes, not implemented, replace when ready with: line.gsub!(/(?:<br>|<br \/>)\s*_([12])\s+/,'<br><:i\1> ') if dob.obj=~/(?:https?:|ftp:|\{([^{}]+?)\}(?:#|:|[.]{1,2}\/))\S+/m if dob.obj=~/(?:^|[#{Mx[:gl_c]}#{Mx[:nbsp]} ])\{~\^ (?:.+?)\s*\}(?:(?:https?:|ftp:|:|[.]{1,2}\/)\S+?)\s*#{Mx[:en_a_o]}(.+?)#{Mx[:en_a_c]}/m dob.obj.gsub!(/(^|[#{Mx[:gl_c]}#{Mx[:nbsp]} ])\{~\^ ([^}]+?)\s*\}((?:https?:|ftp:|:|[.]{1,2}\/)\S+?)\s*#{Mx[:en_a_o]}(.+?)#{Mx[:en_a_c]}/m, @@ -388,8 +395,6 @@ module SiSU_Syntax "#{Mx[:pa_o]}:i\\1#{Mx[:pa_c]}#{Mx[:gl_bullet]}") #bullets, shortcut dob.obj.gsub!(/^\s*_([1-9])\s+/, "#{Mx[:pa_o]}:i\\1#{Mx[:pa_c]}") #indent - dob.obj.gsub!(/(?:<:?br>|<br \/>)/, - "#{Mx[:br_line]}") #indent used in endnotes, not implemented, replace when ready with: line.gsub!(/(?:<br>|<br \/>)\s*_([12])\s+/,'<br><:i\1> ') dob.obj.gsub!(/<:hi>/,"#{Mx[:fa_hilite_o]}") #'<span style="background-color: rgb(255,240,196)">') # bright yellow rgb(255,255,0) pale yellow rgb(255,255,200) dob.obj.gsub!(/<:\/hi>/,"#{Mx[:fa_hilite_c]}") #'</span>') dob.obj.gsub!(/(#{Mx[:gr_o]}verse#{Mx[:gr_c]}.+)/m,"\\1\n") @@ -507,7 +512,7 @@ module SiSU_Syntax "#{Mx[:pa_o]}:i\\1#{Mx[:pa_c]}#{Mx[:fa_o]}\\2#{Mx[:fa_c_o]}") #bullets, shortcut line.gsub!(/^\s*_\([1-9]\)\s+/, "#{Mx[:pa_o]}:i\\1#{Mx[:pa_c]}") - line.gsub!(/(?:<:?br>|<br \/>)\s*_[12]\s+/, + line.gsub!(/#{Mx[:br_line]}\s*_[12]\s+/, "#{Mx[:br_line]} ") #indent used in endnotes, not implemented, replace when ready with: line.gsub!(/(?:<br>|<br \/>)\s*_([12])\s+/,'<br><:i\1> ') end @data diff --git a/lib/sisu/v2/texpdf.rb b/lib/sisu/v2/texpdf.rb index a1a2813f..6503c931 100644 --- a/lib/sisu/v2/texpdf.rb +++ b/lib/sisu/v2/texpdf.rb @@ -341,6 +341,8 @@ module SiSU_TeX if dob.tmp =~/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}#{Mx[:rel_o]}\S+?#{Mx[:rel_c]}/ dob.tmp=SiSU_TeX_Pdf::Format_text_object.new(@md,dob.tmp).url_str_internal(dob.tmp) end + elsif dob.is =='code' + dob.tmp=SiSU_TeX_Pdf::Special_characters.new(@md,dob.tmp).special_characters_code elsif dob.is =='break' if dob.obj==Mx[:br_page]; dob.tmp='\newpage' elsif dob.obj==Mx[:br_page_new]; dob.tmp='\clearpage' @@ -573,6 +575,8 @@ module SiSU_TeX \\newcommand{\\Codeblock}[1]{\\normaltext\\raggedright\\small\\ttfamily\\texbackslash#1} \\newcommand{\\monosp}[1]{\\normaltext\\ttfamily\\texbackslash#1} \\newcommand{\\parasep}{\\\\ \\begin{center}*\\hspace{2em}*\\hspace{2em}*\\end{center} \\\\} +\\newcommand{\\hardspace}{{~}} +%\\newcommand{\\hardspace}{\\hspace{.5em}} % \\sloppy \\begin{document} WOK diff --git a/lib/sisu/v2/texpdf_format.rb b/lib/sisu/v2/texpdf_format.rb index b2dd0e32..018232ac 100644 --- a/lib/sisu/v2/texpdf_format.rb +++ b/lib/sisu/v2/texpdf_format.rb @@ -1162,6 +1162,11 @@ WOK str=xetex_special_characters_2(str,is) unless str.nil? # remove this to start with, causes issues @txt=str end + def special_characters_code + str=@txt + str.gsub!(/ \\\\([ #{Mx[:br_nl]}]+|$)/,' \textbackslash\textbackslash\hardspace\1') + str + end end class Use_TeX attr_accessor :url,:txt,:date diff --git a/lib/sisu/v3/composite.rb b/lib/sisu/v3/composite.rb index 674618f9..33c15cc0 100644 --- a/lib/sisu/v3/composite.rb +++ b/lib/sisu/v3/composite.rb @@ -186,7 +186,7 @@ module SiSU_Assemble def insertions? data=@fns_array tuned_file,imagedir=[],[] - SiSU_Screen::Ansi.new(@opt.cmd,'Composite Document',@opt.fns).grey_title_hi unless @opt.cmd =~/q/ + SiSU_Screen::Ansi.new(@opt.cmd,'Composite Document',"[#{@opt.f_pth[:lng_is]}] #{@opt.fns}").grey_title_hi unless @opt.cmd =~/q/ para=data.each do |para| if para =~/^<<\s+(\S+?\.ss[it])$/ \ or para =~/^<<\{(\S+?\.ss[it])\}$/ \ diff --git a/lib/sisu/v3/concordance.rb b/lib/sisu/v3/concordance.rb index 91b63778..2c1c9ddf 100644 --- a/lib/sisu/v3/concordance.rb +++ b/lib/sisu/v3/concordance.rb @@ -77,7 +77,9 @@ module SiSU_Concordance @env,@md=@particulars.env,@particulars.md loc=@env.url.output_tell unless @md.opt.cmd =~/q/ - tool=(@md.opt.cmd =~/[MVv]/) ? "#{@env.program.web_browser} #{@md.file.output_path.html_concordance.dir}/#{@md.file.base_filename.html_concordance}" : @md.fns + tool=(@md.opt.cmd =~/[MVv]/) \ + ? "#{@env.program.web_browser} #{@md.file.output_path.html_concordance.dir}/#{@md.file.base_filename.html_concordance}" \ + : "[#{@opt.f_pth[:lng_is]}]" @md.opt.cmd=~/[MVvz]/ \ ? SiSU_Screen::Ansi.new(@md.opt.cmd,"Concordance",tool).grey_title_hi \ : SiSU_Screen::Ansi.new(@md.opt.cmd,'Concordance',tool).green_title_hi diff --git a/lib/sisu/v3/constants.rb b/lib/sisu/v3/constants.rb index 5e268f4f..ae2a3b18 100644 --- a/lib/sisu/v3/constants.rb +++ b/lib/sisu/v3/constants.rb @@ -114,9 +114,10 @@ Rx[:mx_fa_clean]= /#{Mx[:fa_o]}.+?#{Mx[:fa_c]}|#{Mx[:pa_o]}.+?#{Mx[:pa_c]}|# Rx[:lv],Rx[:lv_1],Rx[:lv_2],Rx[:lv_3],Rx[:lv_4],Rx[:lv_5],Rx[:lv_6],Rx[:lv_7],Rx[:lv_8],Rx[:lv_9]= /〔([1-9]):(\S*?)〕/,/#{Mx[:lv_o_1]}(\S*?)#{Mx[:lv_c]}/,/#{Mx[:lv_o_2]}(\S*?)#{Mx[:lv_c]}/,/#{Mx[:lv_o_3]}(\S*?)#{Mx[:lv_c]}/,/#{Mx[:lv_o_4]}(\S*?)#{Mx[:lv_c]}/,/#{Mx[:lv_o_5]}(\S*?)#{Mx[:lv_c]}/,/#{Mx[:lv_o_6]}(\S*?)#{Mx[:lv_c]}/,/#{Mx[:lv_o_7]}(\S*?)#{Mx[:lv_c]}/,/#{Mx[:lv_o_8]}(\S*?)#{Mx[:lv_c]}/,/#{Mx[:lv_o_9]}(\S*?)#{Mx[:lv_c]}/ Rx[:meta]=/#{Mx[:meta_o]}(\S+?)#{Mx[:meta_c]}/ -Dx[:url_o]='‹'; Dx[:url_c]='›' +Dx[:url_o]='‹'; Dx[:url_c]='›' Dx[:url_o_xml]='<'; Dx[:url_c_xml]='>' -Dx[:rel_o]='‹'; Dx[:rel_c]='›' # Dx[:rel_o]='「'; Dx[:rel_c]='」' +Dx[:rel_o]='‹'; Dx[:rel_c]='›' # Dx[:rel_o]='「'; Dx[:rel_c]='」' +Dx[:lt_xml]='<'; Dx[:gt_xml]='>' Tex[:backslash]="\\\\" Tex[:backslash]="\\\\" Tex[:tilde]='\\\\\\~' @@ -172,6 +173,7 @@ Db[:col_filesize]=10 Db[:col_info_note]=2500 Gt[:grotto]='sisu:' Gt[:src]='src' +Gt[:pod]='pod' Gt[:po]='po4a/po' Gt[:pot]='po4a/pot' Gt[:image]='mm/image' diff --git a/lib/sisu/v3/dal.rb b/lib/sisu/v3/dal.rb index 28e7193d..2475a6ea 100644 --- a/lib/sisu/v3/dal.rb +++ b/lib/sisu/v3/dal.rb @@ -240,7 +240,7 @@ module SiSU_DAL unless @opt.cmd =~/q/ tell=(@opt.cmd=~/[vVM]/) \ ? SiSU_Screen::Ansi.new(@opt.cmd,'Document Abstraction') \ - : SiSU_Screen::Ansi.new(@opt.cmd,'Document Abstraction',@opt.fns) + : SiSU_Screen::Ansi.new(@opt.cmd,'Document Abstraction',"[#{@opt.f_pth[:lng_is]}] #{@opt.fns}") tell.green_title_hi end fn=(@fnx && @fnx =~/\.ss[tmi]$/) \ diff --git a/lib/sisu/v3/dal_syntax.rb b/lib/sisu/v3/dal_syntax.rb index 2f6353bc..4595d6e1 100644 --- a/lib/sisu/v3/dal_syntax.rb +++ b/lib/sisu/v3/dal_syntax.rb @@ -122,6 +122,7 @@ module SiSU_Syntax def songsheet @data.compact! @data.each do |dob| + dob=breaks(dob) dob=if @md.sem_tag then sem(dob) else dob end #revisit dob=wordlist_italics(dob) dob=wordlist_bold(dob) @@ -133,6 +134,13 @@ module SiSU_Syntax def sem(dob) #revisit dob=SiSU_sem::Tags.new(dob,@md).rm.all end + def breaks(dob) + if dob.is !~/^(?:meta|comment|code|table)/ + dob.obj.gsub!(/ \\\\(?: |$)/,"#{Mx[:br_line]}") + dob.obj.gsub!(/(?:<:?br>|<br \/>)/,"#{Mx[:br_line]}") # depreciated + end + dob + end def wordlist_italics(dob) dob=dob.dup if (defined? @md.make.italics[:str] \ @@ -166,11 +174,11 @@ module SiSU_Syntax dob end def embolden(given) - given.gsub!(/^!_\s+((?:\{|#{Mx[:lnk_o]})(?:~^ )?.+?(?:\}|#{Mx[:lnk_o]})https?:\/\/\S+.*?)(<br>|[#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}])/, + given.gsub!(/^!_\s+((?:\{|#{Mx[:lnk_o]})(?:~^ )?.+?(?:\}|#{Mx[:lnk_o]})https?:\/\/\S+.*?)([#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}])/, "#{Mx[:fa_bold_o]} \\1 #{Mx[:fa_bold_c]}\\2") given.gsub!(/^!_\s+((?:\{|#{Mx[:lnk_o]})(?:~^ )?.+?(?:\}|#{Mx[:lnk_o]})https?:\/\/\S+.*)/, "#{Mx[:fa_bold_o]} \\1 #{Mx[:fa_bold_c]}") - given.gsub!(/(?:^!_|^#{Mx[:lv_o]}[7-9]:\S*?#{Mx[:lv_c]})\s*(.+?)(<br>|[#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}])/, + given.gsub!(/(?:^!_|^#{Mx[:lv_o]}[7-9]:\S*?#{Mx[:lv_c]})\s*(.+?)([#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}])/, "#{Mx[:fa_bold_o]}\\1#{Mx[:fa_bold_c]}\\2") given.gsub!(/(?:^!_|^#{Mx[:lv_o]}[7-9]:\S*?#{Mx[:lv_c]})\s*(.+?)\s+((?:[*]~\S+\s*)+)/, "#{Mx[:fa_bold_o]}\\1#{Mx[:fa_bold_c]}\\2") @@ -180,7 +188,7 @@ module SiSU_Syntax "#{Mx[:fa_bold_o]}\\1#{Mx[:fa_bold_c]}") end def italicise(given) - given.gsub!(/^\/_\s*(.+?)(<br>|[#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}])/, + given.gsub!(/^\/_\s*(.+?)([#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}])/, "#{Mx[:fa_italics_o]}\\1#{Mx[:fa_italics_c]}\\2") given.gsub!(/^\/_\s*(.+?)\s+((?:[*]~\S+\s*)+)/, "#{Mx[:fa_italics_o]}\\1#{Mx[:fa_italics_c]}\\2") @@ -314,7 +322,7 @@ module SiSU_Syntax dob.obj.gsub!(/\s*@title\b/," #{@md.title.full}") if defined? @md.creator.author \ and @md.creator.author - dob.obj.gsub!(/\s+(?:@creator|@author)/,",<br />#{@md.creator.author}") + dob.obj.gsub!(/\s+(?:@creator|@author)/,",#{Mx[:br_line]}#{@md.creator.author}") else dob.obj.gsub!(/\s+(?:@creator|@author)/,'') end end @@ -358,7 +366,6 @@ module SiSU_Syntax dob.obj.gsub!(/\\\\/,"#{Mx[:gl_o]}#092#{Mx[:gl_c]}") #escaped special character dob.obj.gsub!(/\\\*/,"#{Mx[:gl_o]}#042#{Mx[:gl_c]}") #escaped special character dob.obj.gsub!(/\\\!/,"#{Mx[:gl_o]}#033#{Mx[:gl_c]}") #escaped special character - dob.obj.gsub!(/(?:<:?br>|<br \/>)/,"#{Mx[:br_line]}") #indent used in endnotes, not implemented, replace when ready with: line.gsub!(/(?:<br>|<br \/>)\s*_([12])\s+/,'<br><:i\1> ') if dob.obj=~/(?:https?:|ftp:|\{([^{}]+?)\}(?:#|:|[.]{1,2}\/))\S+/m if dob.obj=~/(?:^|[#{Mx[:gl_c]}#{Mx[:nbsp]} ])\{~\^ (?:.+?)\s*\}(?:(?:https?:|ftp:|:|[.]{1,2}\/)\S+?)\s*#{Mx[:en_a_o]}(.+?)#{Mx[:en_a_c]}/m dob.obj.gsub!(/(^|[#{Mx[:gl_c]}#{Mx[:nbsp]} ])\{~\^ ([^}]+?)\s*\}((?:https?:|ftp:|:|[.]{1,2}\/)\S+?)\s*#{Mx[:en_a_o]}(.+?)#{Mx[:en_a_c]}/m, @@ -394,8 +401,6 @@ module SiSU_Syntax "#{Mx[:pa_o]}:i\\1#{Mx[:pa_c]}#{Mx[:gl_bullet]}") #bullets, shortcut dob.obj.gsub!(/^\s*_([1-9])\s+/, "#{Mx[:pa_o]}:i\\1#{Mx[:pa_c]}") #indent - dob.obj.gsub!(/(?:<:?br>|<br \/>)/, - "#{Mx[:br_line]}") #indent used in endnotes, not implemented, replace when ready with: line.gsub!(/(?:<br>|<br \/>)\s*_([12])\s+/,'<br><:i\1> ') dob.obj.gsub!(/<:hi>/,"#{Mx[:fa_hilite_o]}") #'<span style="background-color: rgb(255,240,196)">') # bright yellow rgb(255,255,0) pale yellow rgb(255,255,200) dob.obj.gsub!(/<:\/hi>/,"#{Mx[:fa_hilite_c]}") #'</span>') dob.obj.gsub!(/(#{Mx[:gr_o]}verse#{Mx[:gr_c]}.+)/m,"\\1\n") @@ -513,7 +518,7 @@ module SiSU_Syntax "#{Mx[:pa_o]}:i\\1#{Mx[:pa_c]}#{Mx[:fa_o]}\\2#{Mx[:fa_c_o]}") #bullets, shortcut line.gsub!(/^\s*_\([1-9]\)\s+/, "#{Mx[:pa_o]}:i\\1#{Mx[:pa_c]}") - line.gsub!(/(?:<:?br>|<br \/>)\s*_[12]\s+/, + line.gsub!(/#{Mx[:br_line]}\s*_[12]\s+/, "#{Mx[:br_line]} ") #indent used in endnotes, not implemented, replace when ready with: line.gsub!(/(?:<br>|<br \/>)\s*_([12])\s+/,'<br><:i\1> ') end @data diff --git a/lib/sisu/v3/digests.rb b/lib/sisu/v3/digests.rb index 8f89bbe3..a4be38e4 100644 --- a/lib/sisu/v3/digests.rb +++ b/lib/sisu/v3/digests.rb @@ -77,7 +77,7 @@ module SiSU_Digest_view unless @opt.cmd =~/q/ tool=(@opt.cmd =~/[MVv]/) \ ? "#{@env.program.text_editor} file://#{@md.file.output_path.hash_digest.dir}/#{@md.file.base_filename.hash_digest}" \ - : @opt.fns + : "[#{@opt.f_pth[:lng_is]}] #{@opt.fns}" @opt.cmd=~/[MVvz]/ \ ? SiSU_Screen::Ansi.new(@opt.cmd,"Document #{@dg} Digests",tool).green_hi_blue \ : SiSU_Screen::Ansi.new(@opt.cmd,"Document #{@dg} Digests",tool).green_title_hi diff --git a/lib/sisu/v3/epub.rb b/lib/sisu/v3/epub.rb index 7293c601..2522b68a 100644 --- a/lib/sisu/v3/epub.rb +++ b/lib/sisu/v3/epub.rb @@ -86,7 +86,7 @@ module SiSU_EPUB loc=@env.path.url.output_tell unless @opt.cmd =~/q/ tool=if @opt.cmd =~/[MVvz]/; "#{@env.program.epub_viewer} #{@md.file.output_path.epub.dir}/#{@md.file.base_filename.epub}" - else @opt.fns + else "[#{@opt.f_pth[:lng_is]}] #{@opt.fns}" end @opt.cmd=~/[MVvz]/ \ ? SiSU_Screen::Ansi.new(@opt.cmd,'EPUB',tool).green_hi_blue \ diff --git a/lib/sisu/v3/html.rb b/lib/sisu/v3/html.rb index d77d3df6..744cceca 100644 --- a/lib/sisu/v3/html.rb +++ b/lib/sisu/v3/html.rb @@ -88,7 +88,7 @@ module SiSU_HTML loc=@env.url.output_tell unless @opt.cmd =~/q/ tool=if @opt.cmd =~/[MVvz]/; "#{@env.program.web_browser} file://#{@md.file.output_path.html_seg.dir}/#{@md.file.base_filename.html_segtoc}" - else @opt.fns + else "[#{@opt.f_pth[:lng_is]}] #{@opt.fns}" end @opt.cmd=~/[MVvz]/ \ ? SiSU_Screen::Ansi.new(@opt.cmd,'HTML',tool).green_hi_blue \ diff --git a/lib/sisu/v3/html_tune.rb b/lib/sisu/v3/html_tune.rb index 26072704..c97183f1 100644 --- a/lib/sisu/v3/html_tune.rb +++ b/lib/sisu/v3/html_tune.rb @@ -82,7 +82,12 @@ module SiSU_HTML_Tune def hard_output @filename_tune=@file.write_file_processing.html_tune data=[] - @data.each {|x| x.obj.strip; data << x if not x.obj.empty?} #1.9 array? + @data.each do |x| + unless x.obj.empty? + x.obj.strip! + data << x + end + end data.each do |dob| @filename_tune.puts dob, "\n" end @@ -204,48 +209,28 @@ module SiSU_HTML_Tune begin @cX=SiSU_Screen::Ansi.new(@md.opt.cmd).cX SiSU_Screen::Ansi.new(@md.opt.cmd,'Tune').txt_grey if @md.opt.cmd =~/[MVv]/ - data=Tune.new(@data,@md).endnotes_html - data=Tune.new(data,@md).url_markup - data=Tune.new(data,@md).markup + songsheet_array(@data) + #data=songsheet_array(@data) if @md.opt.cmd =~/M/ #Hard Output Tune Optional on/off here - data=Output.new(data,@md).hard_output - Output.new(data,@md).marshal + data=Output.new(@data,@md).hard_output + Output.new(@data,@md).marshal end tuned=Tune.new(@data,@md).output rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error ensure end end - def para_numbers - data=@data - @tuned_file=[] + def songsheet_array(data) + data_tuned=[] + #@tuned_file=[] data.each do |dob| - dob.gsub!(/#{Mx[:lv_o]}\d:(\S?)#{Mx[:lv_c]}/,'\0<a name="H#\1">#\1.</a> ') #fix Mx[:lv_o] - @tuned_file << dob - end - end - def markup - @tuned_file=[] - @data.each do |dob| - dob.obj.gsub!(/#{Mx[:mk_o]}#([a-zA-Z]+)#{Mx[:mk_c]}/,'&\1;') - dob.obj.gsub!(/#{Mx[:mk_o]}(#[0-9]+)#{Mx[:mk_c]}/,'&\1;') - dob.obj.gsub!(/#{Mx[:br_line]}|#{Mx[:br_nl]}/,'<br />') unless dob.is=='table' - dob.obj.gsub!(/#{Mx[:fa_bold_o]}(.+?)#{Mx[:fa_bold_c]}/,'<b>\1</b>') - dob.obj.gsub!(/#{Mx[:fa_italics_o]}(.+?)#{Mx[:fa_italics_c]}/,'<i>\1</i>') - dob.obj.gsub!(/#{Mx[:fa_underscore_o]}(.+?)#{Mx[:fa_underscore_c]}/,'<u>\1</u>') - dob.obj.gsub!(/#{Mx[:fa_superscript_o]}(.+?)#{Mx[:fa_superscript_c]}/,'<sup>\1</sup>') - dob.obj.gsub!(/#{Mx[:fa_subscript_o]}(.+?)#{Mx[:fa_subscript_c]}/,'<sub>\1</sub>') - dob.obj.gsub!(/#{Mx[:fa_insert_o]}(.+?)#{Mx[:fa_insert_c]}/,'<ins>\1</ins>') - dob.obj.gsub!(/#{Mx[:fa_cite_o]}(.+?)#{Mx[:fa_cite_c]}/,'<cite>\1</cite>') - dob.obj.gsub!(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strike_c]}/,'<del>\1</del>') - dob.obj.gsub!(/#{Mx[:fa_monospace_o]}(.+?)#{Mx[:fa_monospace_c]}/,'<tt>\1</tt>') # tt, kbd - dob.obj.gsub!(/#{Mx[:mk_o]}:name#(\S+?)#{Mx[:mk_c]}/,'<a name="\1"></a>') - dob.obj.gsub!(/^#{Mx[:gl_bullet]}/m,'● ') - dob.obj.gsub!(/#{Mx[:nbsp]}/,' ') - dob.obj.gsub!(/<(p|br)>/,'<\1 />') - dob=SiSU_HTML_Tune::Clean_html.new(dob).clean - @tuned_file << dob + dob=angle_brackets(dob) + dob=endnotes_html(dob) + dob=url_markup(dob) + dob=markup(dob) + data_tuned << dob end + data_tuned end def urls(data) @words=[] @@ -297,67 +282,91 @@ module SiSU_HTML_Tune end @words=@words.join(' ') end - def url_markup - data=@data - @tuned_file=[] - data.each do |dob| - unless dob.is=='code' - if dob.obj =~/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}(?:#{Mx[:url_o]}\S+?#{Mx[:url_c]}|#{Mx[:rel_o]}\S+?#{Mx[:rel_c]}|image)/ - @word_mode=dob.obj.scan(/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}(?:#{Mx[:url_o]}\S+?#{Mx[:url_c]}|#{Mx[:rel_o]}\S+?#{Mx[:rel_c]}|image)[()\[\]]*[,.;:!?'"]{0,2}|(?:#{Mx[:gl_o]}\S+?#{Mx[:gl_c]})+|[^#{Mx[:lnk_o]}#{Mx[:lnk_c]}]+/mu) - words=urls(@word_mode) - dob.obj.gsub!(/.+/m,words) - end #consider change, do a while loop - dob.obj.gsub!(/\\copyright/i,%{<sup>©</sup>}) - if (dob.obj !~/\<:ad\s+\.\.\//) - dob.obj.gsub!(/\<:ad\s+(\S+)?\s+(\S+\.png)\s+(.+)?\;\s+(.+)?\;\s*!\>/, - %{\n<center><a href="http:\/\/\\1" target="external"><img src="#{@env.url.images_local}/\\2" alt="\\3"></a></center>\n}) - else - dob.obj.gsub!(/\<:ad\s+(\S+)?\s+(\S+\.png)\s+(.+)?\;\s+(.+)?\;\s*\>/, - %{\n<center><a href="\\1" target="_top"><img src="#{@env.url.images_local}/\\2" alt="\\3"></a></center>\n}) - end - dob.obj.gsub!(/!pick/,%{<img border="0" height="15" width="15" src="#{@env.url.images}/#{@vz.icon_choice}" alt="stellar">}) - dob.obj.gsub!(/!new/,%{ <img border="0" height="15" width="15" src="#{@env.url.images}/#{@vz.icon_new}" alt="new">}) - dob.obj.gsub!(/<:h(.{1,7}?)>/,'<a href="#h\1">\1</a>') - dob.obj.gsub!(/<:to(\d{1,7}?)>/,'<a href="#to\1">to { \1 }</a> ') - dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'<a href="\1" target="_top">\1</a>') #http ftp matches escaped, no decoration - dob.obj.gsub!(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}<a href="mailto:\\1">\\1</a>#{@brace_url.xml_close}}) - dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}<a href="\\1" target="_top">\\1</a>#{@brace_url.xml_close}}) #http ftp matches with decoration - if dob.obj =~/#{Xx[:html_relative2]}\/\S+/ \ - and dob.obj !~/(\"#{Xx[:html_relative2]}\/\S+?\"|>\s*#{Xx[:html_relative2]}\/\S+<)/ - dob.obj.gsub!(/(#{Xx[:html_relative2]}\/\S+)/,'<a href="\1">\1</a>') - end - if dob.obj =~/..\/\S+/ \ - and dob.obj !~/(\"..\/\S+?\"|>\s*..\/\S+<)/ - dob.obj.gsub!(/\.\.(\/\S+)/,%{<a href="#{Xx[:html_relative2]}\1">\1</a>}) - end - dob.obj.gsub!(/<a href=":/,%{<a href="#{@vz.url_site}/}) - dob.obj.gsub!(/<a href="\.\.\//,%{<a href="#{@vz.url_site}/}) - dob.obj.gsub!(/<a href="#{Xx[:html_relative2]}\//,%{<a href="#{@vz.url_site}/}) + def url_markup(dob) + unless dob.is=='code' + if dob.obj =~/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}(?:#{Mx[:url_o]}\S+?#{Mx[:url_c]}|#{Mx[:rel_o]}\S+?#{Mx[:rel_c]}|image)/ + @word_mode=dob.obj.scan(/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}(?:#{Mx[:url_o]}\S+?#{Mx[:url_c]}|#{Mx[:rel_o]}\S+?#{Mx[:rel_c]}|image)[()\[\]]*[,.;:!?'"]{0,2}|(?:#{Mx[:gl_o]}\S+?#{Mx[:gl_c]})+|[^#{Mx[:lnk_o]}#{Mx[:lnk_c]}]+/mu) + words=urls(@word_mode) + dob.obj.gsub!(/.+/m,words) + end #consider change, do a while loop + dob.obj.gsub!(/\\copyright/i,%{<sup>©</sup>}) + if (dob.obj !~/\<:ad\s+\.\.\//) + dob.obj.gsub!(/\<:ad\s+(\S+)?\s+(\S+\.png)\s+(.+)?\;\s+(.+)?\;\s*!\>/, + %{\n<center><a href="http:\/\/\\1" target="external"><img src="#{@env.url.images_local}/\\2" alt="\\3"></a></center>\n}) else - dob.obj.gsub!(/(^|[^}])_</m,'\1<'); dob.obj.gsub!(/(^|[^}])_>/m,'\1>') #code-block: angle brackets special characters - dob.obj.gsub!(/(^|[^}])_</m,'\1<'); dob.obj.gsub!(/(^|[^}])_>/m,'\1>') + dob.obj.gsub!(/\<:ad\s+(\S+)?\s+(\S+\.png)\s+(.+)?\;\s+(.+)?\;\s*\>/, + %{\n<center><a href="\\1" target="_top"><img src="#{@env.url.images_local}/\\2" alt="\\3"></a></center>\n}) end - @tuned_file << dob + dob.obj.gsub!(/!pick/,%{<img border="0" height="15" width="15" src="#{@env.url.images}/#{@vz.icon_choice}" alt="stellar">}) + dob.obj.gsub!(/!new/,%{ <img border="0" height="15" width="15" src="#{@env.url.images}/#{@vz.icon_new}" alt="new">}) + dob.obj.gsub!(/<:h(.{1,7}?)>/,'<a href="#h\1">\1</a>') + dob.obj.gsub!(/<:to(\d{1,7}?)>/,'<a href="#to\1">to { \1 }</a> ') + dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'<a href="\1" target="_top">\1</a>') #http ftp matches escaped, no decoration + dob.obj.gsub!(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}<a href="mailto:\\1">\\1</a>#{@brace_url.xml_close}}) + dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}<a href="\\1" target="_top">\\1</a>#{@brace_url.xml_close}}) #http ftp matches with decoration + if dob.obj =~/#{Xx[:html_relative2]}\/\S+/ \ + and dob.obj !~/(\"#{Xx[:html_relative2]}\/\S+?\"|>\s*#{Xx[:html_relative2]}\/\S+<)/ + dob.obj.gsub!(/(#{Xx[:html_relative2]}\/\S+)/,'<a href="\1">\1</a>') + end + if dob.obj =~/..\/\S+/ \ + and dob.obj !~/(\"..\/\S+?\"|>\s*..\/\S+<)/ + dob.obj.gsub!(/\.\.(\/\S+)/,%{<a href="#{Xx[:html_relative2]}\1">\1</a>}) + end + dob.obj.gsub!(/<a href=":/,%{<a href="#{@vz.url_site}/}) + dob.obj.gsub!(/<a href="\.\.\//,%{<a href="#{@vz.url_site}/}) + dob.obj.gsub!(/<a href="#{Xx[:html_relative2]}\//,%{<a href="#{@vz.url_site}/}) + else + dob.obj.gsub!(/(^|[^}])_</m,'\1<'); dob.obj.gsub!(/(^|[^}])_>/m,'\1>') #code-block: angle brackets special characters + dob.obj.gsub!(/(^|[^}])_</m,'\1<'); dob.obj.gsub!(/(^|[^}])_>/m,'\1>') end + dob end - def endnotes_html + def para_numbers data=@data @tuned_file=[] data.each do |dob| - unless dob.is =~/^code/ - dob.obj.gsub!(/(#{Mx[:en_a_o]}|#{Mx[:en_b_o]})(\d+)\s+(.+?)(#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/, - ' <a name="-\2" href="#_\2"> <sup>\2</sup> </a> ' + #note- endnote- - '\1\2 <a name="_\2" href="#-\2"> <sup>\2.</sup></a> \3 \4') #endnote- note- (careful may have switched) - dob.obj.gsub!(/(#{Mx[:en_b_o]})([*+]\d+)\s+(.+?)(#{Mx[:en_b_c]})/, - ' <a name="-\2" href="#_\2"> <sup>\2</sup> </a> ' + #note- endnote- - '\1\2 <a name="_\2" href="#-\2"> <sup>\2.</sup></a> \3 \4') #endnote- note- (careful may have switched) - dob.obj.gsub!(/(#{Mx[:en_a_o]})([*+]+)\s+(.+?)(#{Mx[:en_a_c]})/, - ' <a name="-\2" href="#_\2"> <sup>\2</sup> </a> ' + #note- endnote- - '\1\2 <a name="_\2" href="#-\2"> <sup>\2</sup></a> \3 \4') #endnote- note- (careful may have switched) - end + dob.gsub!(/#{Mx[:lv_o]}\d:(\S?)#{Mx[:lv_c]}/,'\0<a name="H#\1">#\1.</a> ') #fix Mx[:lv_o] @tuned_file << dob end end + def angle_brackets(dob) + dob.obj.gsub!(/<([a-z:\/]+)>/,"#{Dx[:lt_xml]}\\1#{Dx[:gt_xml]}") + dob + end + def endnotes_html(dob) + unless dob.is =~/^code/ + dob.obj.gsub!(/(#{Mx[:en_a_o]}|#{Mx[:en_b_o]})(\d+)\s+(.+?)(#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/, + ' <a name="-\2" href="#_\2"> <sup>\2</sup> </a> ' + #note- endnote- + '\1\2 <a name="_\2" href="#-\2"> <sup>\2.</sup></a> \3 \4') #endnote- note- (careful may have switched) + dob.obj.gsub!(/(#{Mx[:en_b_o]})([*+]\d+)\s+(.+?)(#{Mx[:en_b_c]})/, + ' <a name="-\2" href="#_\2"> <sup>\2</sup> </a> ' + #note- endnote- + '\1\2 <a name="_\2" href="#-\2"> <sup>\2.</sup></a> \3 \4') #endnote- note- (careful may have switched) + dob.obj.gsub!(/(#{Mx[:en_a_o]})([*+]+)\s+(.+?)(#{Mx[:en_a_c]})/, + ' <a name="-\2" href="#_\2"> <sup>\2</sup> </a> ' + #note- endnote- + '\1\2 <a name="_\2" href="#-\2"> <sup>\2</sup></a> \3 \4') #endnote- note- (careful may have switched) + end + dob + end + def markup(dob) + dob.obj.gsub!(/#{Mx[:mk_o]}#([a-zA-Z]+)#{Mx[:mk_c]}/,'&\1;') + dob.obj.gsub!(/#{Mx[:mk_o]}(#[0-9]+)#{Mx[:mk_c]}/,'&\1;') + dob.obj.gsub!(/#{Mx[:br_line]}|#{Mx[:br_nl]}/,'<br />') unless dob.is=='table' + dob.obj.gsub!(/#{Mx[:fa_bold_o]}(.+?)#{Mx[:fa_bold_c]}/,'<b>\1</b>') + dob.obj.gsub!(/#{Mx[:fa_italics_o]}(.+?)#{Mx[:fa_italics_c]}/,'<i>\1</i>') + dob.obj.gsub!(/#{Mx[:fa_underscore_o]}(.+?)#{Mx[:fa_underscore_c]}/,'<u>\1</u>') + dob.obj.gsub!(/#{Mx[:fa_superscript_o]}(.+?)#{Mx[:fa_superscript_c]}/,'<sup>\1</sup>') + dob.obj.gsub!(/#{Mx[:fa_subscript_o]}(.+?)#{Mx[:fa_subscript_c]}/,'<sub>\1</sub>') + dob.obj.gsub!(/#{Mx[:fa_insert_o]}(.+?)#{Mx[:fa_insert_c]}/,'<ins>\1</ins>') + dob.obj.gsub!(/#{Mx[:fa_cite_o]}(.+?)#{Mx[:fa_cite_c]}/,'<cite>\1</cite>') + dob.obj.gsub!(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strike_c]}/,'<del>\1</del>') + dob.obj.gsub!(/#{Mx[:fa_monospace_o]}(.+?)#{Mx[:fa_monospace_c]}/,'<tt>\1</tt>') # tt, kbd + dob.obj.gsub!(/#{Mx[:mk_o]}:name#(\S+?)#{Mx[:mk_c]}/,'<a name="\1"></a>') + dob.obj.gsub!(/^#{Mx[:gl_bullet]}/m,'● ') + dob.obj.gsub!(/#{Mx[:nbsp]}/,' ') + dob.obj.gsub!(/<(p|br)>/,'<\1 />') + dob=SiSU_HTML_Tune::Clean_html.new(dob).clean + dob + end def output data=@data @tuned_file=[] diff --git a/lib/sisu/v3/manifest.rb b/lib/sisu/v3/manifest.rb index a21b31f9..06745c35 100644 --- a/lib/sisu/v3/manifest.rb +++ b/lib/sisu/v3/manifest.rb @@ -88,7 +88,7 @@ module SiSU_Manifest url_html="file://#{@md.file.output_path.manifest.dir}/#{@md.file.base_filename.manifest}" @opt.cmd=~/[MVvz]/ \ ? SiSU_Screen::Ansi.new(@opt.cmd,'Manifest',"#{xbrowser} #{url_html}").green_hi_blue \ - : SiSU_Screen::Ansi.new(@opt.cmd,'Manifest',@opt.fns).green_title_hi + : SiSU_Screen::Ansi.new(@opt.cmd,'Manifest',"[#{@opt.f_pth[:lng_is]}] #{@opt.fns}").green_title_hi SiSU_Screen::Ansi.new(@opt.cmd,"#{browser} #{url_html}").grey_tab if @opt.cmd =~/v/i end data=SiSU_HTML::Source::Html_environment.new(@particulars).tuned_file_instructions @@ -143,8 +143,7 @@ module SiSU_Manifest size=(File.size("#{pth}/#{file}")/1024.00).to_s kb=/([0-9]+\.[0-9]{0,1})/m.match(size)[1] @manifest[:txt] << "#{file} #{id} #{kb}\n" - @manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="#{rel}/#{file}">#{id}</a></p></th><td class="right"><p class="tiny"><a href="#{rel}/#{file}">#{file}</a> #{dgst[1]}<br />#{@brace_url.xml_open}<a href="#{url}/#{file}">#{url}/#{file}</a>#{@brace_url.xml_close}</p></td><td class="right"><p class="right">#{kb}</p> - </td></tr>\n} if kb and kb =~/\d+/ + @manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="#{rel}/#{file}">#{id}</a></p></th><td class="right"><p class="tiny"><a href="#{rel}/#{file}">#{file}</a> #{dgst[1]}<br />#{@brace_url.xml_open}<a href="#{url}/#{file}">#{url}/#{file}</a>#{@brace_url.xml_close}</p></td><td class="right"><p class="right">#{kb}</p></td></tr>\n} if kb and kb =~/\d+/ end def published_manifests? @f=SiSU_Env::SiSU_file.new(@md) #.base_filename @@ -384,11 +383,25 @@ module SiSU_Manifest pth,rel,url='','','' summarize(id,file,pth,rel,url) end - if FileTest.file?("#{@base_path}/#{@md.fn[:digest]}")==true - id,file="Digest/DCC - Document Content Certificate (#{@dg})",@md.fn[:digest] - pth=@base_path - rel,url='','' - #pth='' + if FileTest.file?(@f.place_file.manpage.dir)==true + pth=@f.output_path.manpage.dir + rel=@f.output_path.manpage.rel_sm + url=@f.output_path.manpage.url + id,file='Manpage',@f.base_filename.manpage + summarize(id,file,pth,rel,url) + end + if FileTest.file?(@f.place_file.texinfo.dir)==true + pth=@f.output_path.texinfo.dir + rel=@f.output_path.texinfo.rel_sm + url=@f.output_path.texinfo.url + id,file='Texinfo',@f.base_filename.texinfo + summarize(id,file,pth,rel,url) + end + if FileTest.file?(@f.place_file.hash_digest.dir)==true + pth=@f.output_path.hash_digest.dir + rel=@f.output_path.hash_digest.rel_sm + url=@f.output_path.hash_digest.url + id,file="Digest/DCC - Document Content Certificate (#{@dg})",@f.base_filename.hash_digest summarize(id,file,pth,rel,url) end end @@ -407,7 +420,8 @@ module SiSU_Manifest req=@md.fns if FileTest.file?(@f.place_file.src.dir)==true pth=@f.output_path.src.dir - rel=@f.output_path.src.rel_sm + rel=@f.output_path.src.rel + #rel=@f.output_path.src.rel_sm url=@f.output_path.src.url id,file='Markup Composite File (SiSU source)',@f.base_filename.src summarize_sources(id,file,pth,rel,url) @@ -415,7 +429,8 @@ module SiSU_Manifest else if FileTest.file?(@f.place_file.src.dir)==true pth=@f.output_path.src.dir - rel=@f.output_path.src.rel_sm + rel=@f.output_path.src.rel + #rel=@f.output_path.src.rel_sm url=@f.output_path.src.url id,file='Markup (SiSU source)',@f.base_filename.src summarize_sources(id,file,pth,rel,url) @@ -423,7 +438,8 @@ module SiSU_Manifest end if FileTest.file?(@f.place_file.sisupod.dir)==true pth=@f.output_path.sisupod.dir - rel=@f.output_path.sisupod.rel_sm + rel=@f.output_path.sisupod.rel + #rel=@f.output_path.sisupod.rel_sm url=@f.output_path.sisupod.url id,file='SiSU doc (zip)',@f.base_filename.sisupod summarize_sources(id,file,pth,rel,url) diff --git a/lib/sisu/v3/manpage.rb b/lib/sisu/v3/manpage.rb index 17fef80b..0a2c2fcc 100644 --- a/lib/sisu/v3/manpage.rb +++ b/lib/sisu/v3/manpage.rb @@ -84,10 +84,13 @@ module SiSU_Manpage @env=SiSU_Env::Info_env.new(@opt.fns) path=@env.path.output_tell tool=(@opt.cmd =~/[MVv]/) \ - ? "#{@env.program.text_editor} #{@md.file.output_path.manpage}/#{@md.file.base_filename.manpage}" \ - : '' - SiSU_Screen::Ansi.new(@opt.cmd,'Manpage',tool).green_hi_blue unless @opt.cmd =~/q/ - SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@md.file.output_path.manpage}/#{@md.file.base_filename.manpage}").flow if @opt.cmd =~/[MV]/ + ? "#{@env.program.text_editor} #{@md.file.output_path.manpage.dir}/#{@md.file.base_filename.manpage}" \ + : "[#{@opt.f_pth[:lng_is]}] #{@opt.fns}" + @opt.cmd=~/[MVvz]/ \ + && @opt.cmd !~/q/ \ + ? SiSU_Screen::Ansi.new(@opt.cmd,'Manpage',tool).green_hi_blue \ + : SiSU_Screen::Ansi.new(@opt.cmd,'Manpage',tool).green_title_hi + SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@md.file.output_path.manpage.dir}/#{@md.file.base_filename.manpage}").flow if @opt.cmd =~/[MV]/ @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here SiSU_Manpage::Source::Scroll.new(@md,@dal_array).songsheet SiSU_Env::Info_skin.new(@md).select #watch @@ -263,14 +266,14 @@ WOK dob.obj.gsub!(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strike_c]}/,'--\1--') dob.obj.gsub!(/#{Mx[:fa_cite_o]}(.+?)#{Mx[:fa_cite_c]}/,'"\1"') dob.obj.gsub!(/#{Mx[:fa_monospace_o]}(.+?)#{Mx[:fa_monospace_c]}/,'\1') - dob.obj.gsub!(/\A\s*#{Mx[:fa_italics_o]}(.+?)#{Mx[:fa_italics_c]}#{Mx[:br_line]}/m,"#{Mx[:br_line]}.I \\1#{Mx[:br_line]}") - dob.obj.gsub!(/\s*#{Mx[:fa_italics_o]}(.+?)#{Mx[:fa_italics_c]}/m,"#{Mx[:br_line]}.I \\1#{Mx[:br_line]}") - dob.obj.gsub!(/\A\s*#{Mx[:fa_bold_o]}(.+?)#{Mx[:fa_bold_c]}#{Mx[:br_line]}/m,"#{Mx[:br_line]}.BI \\1#{Mx[:br_line]}") - dob.obj.gsub!(/\s*#{Mx[:fa_bold_o]}(.+?)#{Mx[:fa_bold_c]}/,"#{Mx[:br_line]}.B \\1#{Mx[:br_line]}") - dob.obj.gsub!(/\s*#{Mx[:fa_underscore_o]}(.+?)#{Mx[:fa_underscore_c]}/,"#{Mx[:br_line]}.I \\1#{Mx[:br_line]}") + dob.obj.gsub!(/\A\s*#{Mx[:fa_italics_o]}(.+?)#{Mx[:fa_italics_c]}#{Mx[:br_line]}([,.:!?](?: |$))?/m,"#{Mx[:br_line]}.I \\1\\2#{Mx[:br_line]}") + dob.obj.gsub!(/\s*#{Mx[:fa_italics_o]}(.+?)#{Mx[:fa_italics_c]}([,.:!?](?: |$))?/m,"#{Mx[:br_line]}.I \\1\\2#{Mx[:br_line]}") + dob.obj.gsub!(/\A\s*#{Mx[:fa_bold_o]}(.+?)#{Mx[:fa_bold_c]}([,.:!?](?: |$))?#{Mx[:br_line]}/m,"#{Mx[:br_line]}.BI \\1\\2#{Mx[:br_line]}") + dob.obj.gsub!(/\s*#{Mx[:fa_bold_o]}(.+?)#{Mx[:fa_bold_c]}([,.:!?](?: |$))?/,"#{Mx[:br_line]}.B \\1\\2#{Mx[:br_line]}") + dob.obj.gsub!(/\s*#{Mx[:fa_underscore_o]}(.+?)#{Mx[:fa_underscore_c]}([,.:!?](?: |$))?/,"#{Mx[:br_line]}.I \\1\\2#{Mx[:br_line]}") unless dob.is=='code' - dob.obj.gsub!(/(?:^|\s)#{Mx[:lnk_o]}(.+?)#{Mx[:lnk_c]}#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,"\\1 #{@brace_url.txt_open}\\2#{@brace_url.txt_close}") - dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s)#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,"\\1#{@brace_url.txt_open}\\2#{@brace_url.txt_close}") + dob.obj.gsub!(/(?:^|\s)#{Mx[:lnk_o]}(.+?)#{Mx[:lnk_c]}#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}([,.:!?](?: |$))?/,"\\1 #{@brace_url.txt_open}\\2#{@brace_url.txt_close}\\3") + dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s)#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}([,.:!?](?: |$))?/,"\\1#{@brace_url.txt_open}\\2#{@brace_url.txt_close}\\3") @manpage[:endnotes]=extract_endnotes(dob.obj) dob.obj.gsub!(/#{Mx[:en_a_o]}([\d*+]+)\s*(?:.+?)#{Mx[:en_a_c]}/m,'[^\1]') # endnote marker marked up dob.obj.gsub!(/#{Mx[:en_b_o]}([\d*+]+)\s*(?:.+?)#{Mx[:en_b_c]}/m,'[^\1]') # endnote marker marked up @@ -279,6 +282,7 @@ WOK dob.obj.gsub!(/#{Mx[:gl_o]}#035#{Mx[:gl_c]}/,'#') dob.obj.gsub!(/#{Mx[:gl_o]}#042#{Mx[:gl_c]}/,'*') dob.obj.gsub!(/#{Mx[:gl_o]}#045#{Mx[:gl_c]}/,'-') + dob.obj.gsub!(/#{Mx[:gl_o]}#092#{Mx[:gl_c]}/,'\e') dob.obj.gsub!(/#{Mx[:gl_o]}#047#{Mx[:gl_c]}/,'/') dob.obj.gsub!(/#{Mx[:gl_o]}#095#{Mx[:gl_c]}/,'_') dob.obj.gsub!(/#{Mx[:gl_o]}#123#{Mx[:gl_c]}/,'{') @@ -286,6 +290,7 @@ WOK dob.obj.gsub!(/#{Mx[:gl_o]}#126#{Mx[:gl_c]}/,'~') dob.obj.gsub!(/#{Mx[:gl_o]}#169#{Mx[:gl_c]}/,'©') else + dob.obj.gsub!(/\\/,'\e') dob.obj.gsub!(/(?:#{Mx[:br_line]}|#{Mx[:br_nl]})\s*/,"\n\n") # watch #dob.obj.gsub!(/(?:#{Mx[:br_line]}|#{Mx[:br_nl]})+\s*/,"\n") # watch end @@ -301,10 +306,9 @@ WOK dob.obj.gsub!(/(^|[^}])_([<>])/m,'\1\2') # _<_< dob.obj.gsub!(/\A(.+)?\Z/m,".nf\n\n\\1\n\n.fi") end - else - dob.obj.gsub!(/(?:#{Mx[:br_line]}|#{Mx[:br_nl]})\s*/,"\n\n") #unless para =~/#{Mx[:lv_o]}\d:/ #watch introduces a bug end - dob.obj.gsub!(/(?:#{Mx[:br_line]}|#{Mx[:br_nl]})+\s*/,"\n\n.br\n\n") # watch + #dob.obj.gsub!(/(?:#{Mx[:br_line]}|#{Mx[:br_nl]})+\s*/m,"\n.br\n") # watch + dob.obj.gsub!(/(?:#{Mx[:br_line]}|#{Mx[:br_nl]})+\s*/m,"\n\n") # watch blit=dob.obj.scan(/\[[^\]]+\]|[^\[]+/) blit_array=[] blit.each do |x| @@ -316,7 +320,7 @@ WOK end dob.obj=blit_array.join dob.obj.gsub!(/#{Mx[:gl_o]}:name#\S+?#{Mx[:gl_c]}/mi,'') #added - dob.obj.gsub!(/\s\\\s+(#{Mx[:br_line]}|#{Mx[:br_nl]})/,'\1') #a messy solution + #dob.obj.gsub!(/\s\\\s+(#{Mx[:br_line]}|#{Mx[:br_nl]})/,'\1') #a messy solution dob.obj.gsub!(/#{Mx[:br_page]}\s*|#{Mx[:br_page_new]}/,'') # remove page breaks dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s)#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'\1\2') dob.obj.gsub!(/<a href=".+?">(.+?)<\/a>/m,'\1') @@ -355,12 +359,14 @@ WOK end if dob.obj dob.obj.gsub!(/\s(\[)/m,' \ \1') - dob.obj.gsub!(/(?:#{Mx[:br_line]}|#{Mx[:br_nl]})/,"\n\n") + dob.obj.gsub!(/(?:#{Mx[:br_line]}|#{Mx[:br_nl]})\s*/,"\n\n") # watch dob.obj.gsub!(/#{Mx[:gl_o]}#126#{Mx[:gl_c]}/,'~') dob.obj.gsub!(/#{Mx[:gl_o]}#123#{Mx[:gl_c]}/,'{') dob.obj.gsub!(/#{Mx[:pa_o]}\S+#{Mx[:pa_c]}/,' ') - dob.obj.gsub!(/<!.+!>/,' ') - dob.obj.gsub!(/<:\S+>/,' ') + unless dob.is =='code' + dob.obj.gsub!(/<!.+!>/,' ') + dob.obj.gsub!(/<:\S+>/,' ') + end end dob end diff --git a/lib/sisu/v3/odf.rb b/lib/sisu/v3/odf.rb index a223600e..c42ce349 100644 --- a/lib/sisu/v3/odf.rb +++ b/lib/sisu/v3/odf.rb @@ -85,7 +85,7 @@ module SiSU_ODF unless @opt.cmd =~/q/ tool=(@opt.cmd =~/[MVv]/) \ ? "#{@env.program.odf_viewer} file://#{@md.file.output_path.odt.dir}/#{@md.file.base_filename.odt}" \ - : @opt.fns + : "[#{@opt.f_pth[:lng_is]}] #{@opt.fns}" @opt.cmd=~/[MVvz]/ \ ? SiSU_Screen::Ansi.new(@opt.cmd,'Opendocument (ODF:ODT)',tool).green_hi_blue \ : SiSU_Screen::Ansi.new(@opt.cmd,'Opendocument (ODF:ODT)',tool).green_title_hi diff --git a/lib/sisu/v3/plaintext.rb b/lib/sisu/v3/plaintext.rb index 09ecf56c..b7ad1680 100644 --- a/lib/sisu/v3/plaintext.rb +++ b/lib/sisu/v3/plaintext.rb @@ -85,7 +85,7 @@ module SiSU_Plaintext path=env.path.output_tell tool=(@opt.cmd =~/[MVv]/) \ ? "#{env.program.text_editor} #{md.file.output_path.txt.dir}/#{md.file.base_filename.txt}" \ - : @opt.fns + : "[#{@opt.f_pth[:lng_is]}] #{@opt.fns}" @opt.cmd=~/[MVvz]/ \ ? SiSU_Screen::Ansi.new(@opt.cmd,'Plaintext',tool).green_hi_blue \ : SiSU_Screen::Ansi.new(@opt.cmd,'Plaintext',tool).green_title_hi @@ -316,6 +316,7 @@ WOK dob.obj.gsub!(/#{Mx[:gl_o]}#125#{Mx[:gl_c]}/,'}') dob.obj.gsub!(/#{Mx[:gl_o]}#126#{Mx[:gl_c]}/,'~') dob.obj.gsub!(/#{Mx[:gl_o]}#169#{Mx[:gl_c]}/,'©') + dob.obj.gsub!(/#{Mx[:gl_o]}#092#{Mx[:gl_c]}/,'\\') end if dob.of=='block' # watch dob.obj.gsub!(/#{Mx[:gl_o]}●#{Mx[:gl_c]}/,"* ") diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb index d0c88deb..d709cd52 100644 --- a/lib/sisu/v3/sysenv.rb +++ b/lib/sisu/v3/sysenv.rb @@ -2253,14 +2253,10 @@ WOK web_browser end def epub_viewer - if defined? @rc['program_select']['epub_viewer'] \ - and @rc['program_select']['epub_viewer'] =~/\S\S+/ - @rc['program_select']['epub_viewer'] - elsif defined? @rc['program_select']['epub_viewer'] \ - and @rc['program_select']['epub_viewer'] =~/\S\S+/ - @rc['program_select']['epub_viewer'] - else 'ebook-viewer' #'calibre' 'fbreader' - end + ((defined? @rc['program_select']['epub_viewer']) \ + && @rc['program_select']['epub_viewer'] =~/\S\S+/) \ + ? @rc['program_select']['epub_viewer'] \ + : 'ebook-viewer' #'calibre' 'fbreader' end def xml_viewer ((defined? @rc['program_select']['xml_viewer']) \ @@ -2286,6 +2282,12 @@ WOK ? @rc['program_select']['man'] \ : 'nroff -man' #'nroff -man' #'groff -man -Tascii' end + def texinfo + ((defined? @rc['program_select']['info_viewer']) \ + && @rc['program_select']['info_viewer'] =~/\S\S+/) \ + ? @rc['program_select']['info_viewer'] \ + : 'pinfo -f' #'pinfo -f' 'info' 'tkinfo' + end def file_encoding is=(defined? @rc['program_set']['file_encoding']) ? @rc['program_set']['encoding'] : '' (is.nil? || is==true) ? 'encoding' : is @@ -3262,6 +3264,12 @@ WOK fn=base_filename.manpage file=make_file(path,fn) end + def texinfo + path=output_path.texinfo.dir + make_path(path) + fn=base_filename.texinfo + file=make_file(path,fn) + end def hash_digest path=output_path.hash_digest.dir make_path(path) @@ -3457,6 +3465,24 @@ WOK end self end + def manpage + def dir + output_path.manpage.dir + '/' + base_filename.manpage + end + def rel + output_path.manpage.rel + '/' + base_filename.manpage + end + self + end + def texinfo + def dir + output_path.texinfo.dir + '/' + base_filename.texinfo + end + def rel + output_path.texinfo.rel + '/' + base_filename.texinfo + end + self + end def manifest def dir output_path.manifest.dir + '/' + base_filename.manifest @@ -3614,11 +3640,19 @@ WOK pdf_l + @md.fn[:pdf_l_legal] end def manpage - ft='.1' + ft='1' if @env.output_dir_structure.by_language_code? - @md.fnb + ft + @md.fnb + '.' + ft else - @md.fnb + @md.lang_code_insert + ft + @md.fnb + '.' + @md.opt.f_pth[:lng_is] + '.' + ft + end + end + def texinfo + ft='info' + if @env.output_dir_structure.by_language_code? + @md.fnb + '.' + ft + else + @md.fnb + '.' + @md.opt.f_pth[:lng_is] + '.' + ft end end def hash_digest @@ -3692,9 +3726,9 @@ WOK end def ab_src if @env.output_dir_structure.by_language_code? - "#{output_path.base.url}/#{@ft}/#{@md.opt.lng}" + "#{output_path.base.dir}/#{@ft}/#{@md.opt.lng}" else - "#{output_path.base.url}/#{@ft}" + "#{output_path.base.dir}/#{@ft}" end end self @@ -3718,9 +3752,9 @@ WOK end def ab_src if @env.output_dir_structure.by_language_code? - "#{output_path.base.dir}/#{@ft}/#{@md.opt.lng}" + "#{output_path.base.url}/#{@ft}/#{@md.opt.lng}" else - "#{output_path.base.dir}/#{@ft}" + "#{output_path.base.url}/#{@ft}" end end self @@ -3744,7 +3778,7 @@ WOK end def ab_src if @env.output_dir_structure.by_language_code? - "#{@ft}/#{@md.opt.lng}" + "../../#{@ft}/#{@md.opt.lng}" else "#{@ft}" end @@ -3828,24 +3862,6 @@ WOK end self end - def sisupod - def dir - "#{output_path.base.dir}/pod" - end - def url - "#{output_path.base.url}/pod" - end - def rel - "#{output_path.base.rel}/pod" - end - def rcp - "#{output_path.base.rcp}/pod" - end - def rel_sm - #"#{output_path.base.rel}/pod" - end - self - end def sisugit def dir "#{output_path.base.dir}/git" @@ -3895,6 +3911,27 @@ WOK end self end + def sisupod + def ft + Gt[:src] + '/' + Gt[:pod] + end + def dir + set_path(ft).dir.ab_src + end + def url + set_path(ft).url.ab_src + end + def rel + set_path(ft).rel.ab_src + end + def rcp + set_path(ft).rcp.ab_src + end + def rel_sm + #"#{output_path.base.rel}/pod" + end + self + end def po def dir "#{output_path.base.dir}/po4a/#{@md.fnb}/po/#{@md.opt.lng}" @@ -4224,13 +4261,28 @@ WOK set_path(ft).rcp.ab end def rel_sm - if @env.output_dir_structure.by_language_code? - '' - elsif @env.output_dir_structure.by_filetype? - '' - else - '' - end + set_path(ft).rel_sm.ab + end + self + end + def texinfo + def ft + 'texinfo' + end + def dir + set_path(ft).dir.ab + end + def url + set_path(ft).url.ab + end + def rel + set_path(ft).rel.ab + end + def rcp + set_path(ft).rcp.ab + end + def rel_sm + set_path(ft).rel_sm.ab end self end diff --git a/lib/sisu/v3/texinfo.rb b/lib/sisu/v3/texinfo.rb index f7693056..f1e3d5a2 100644 --- a/lib/sisu/v3/texinfo.rb +++ b/lib/sisu/v3/texinfo.rb @@ -77,6 +77,7 @@ module SiSU_TexInfo include SiSU_TexInfo def initialize(opt) @opt=opt + @md=SiSU_Param::Parameters.new(@opt).get @env=SiSU_Env::Info_env.new(@opt.fns) @vz=SiSU_Env::Get_init.instance.skin end @@ -96,17 +97,20 @@ module SiSU_TexInfo end def song begin - unless @opt.cmd =~/q/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,'TexInfo') - tell.green_title_hi - end + tool=(@opt.cmd =~/[MVv]/) \ + ? "#{@env.program.texinfo} #{@md.file.output_path.texinfo.dir}/#{@md.file.base_filename.texinfo}" \ + : "[#{@opt.f_pth[:lng_is]}] #{@opt.fns}" + tell=@opt.cmd=~/[MVvz]/ \ + && @opt.cmd !~/q/ \ + ? SiSU_Screen::Ansi.new(@opt.cmd,'TexInfo',tool).green_hi_blue \ + : SiSU_Screen::Ansi.new(@opt.cmd,'TexInfo',tool).green_title_hi + tell @md=SiSU_Param::Parameters.new(@opt).get - puts "\t#{@@cX.grey}TexInfo#{@@cX.off}" directories @marshalfile=SiSU_Env::Info_file.new(@opt.fns).marshal.dal_content if FileTest.file?(@marshalfile)==true File.open(@marshalfile) { |f| @@tuned_file=Marshal.load(f)} - tell.meta_verse_skipped unless @opt.cmd =~/q/ + #tell.meta_verse_skipped if @opt.cmd =~/[vVM]/ else tex_array=IO.readlines(@opt.fns,'') SiSU_Metaverse.songsheet(tex_array) @@ -364,6 +368,10 @@ module SiSU_TexInfo puts filename if @md.opt.cmd =~/M/ data.each {|s| (filename_texinfo.puts s,"\n") if s} filename_texinfo.close + file_info_src=%{#{@env.processing_path.texi}/#{@md.fnb}.info} + file_info="#{@md.file.output_path.texinfo.dir}/#{@md.file.base_filename.texinfo}" + SiSU_Env::SiSU_file.new(@md).mkdir + system("cp #{file_info_src} #{file_info}") end def makeinfo if @md.fns =~/\.(?:-|ssm\.)?sst$/ diff --git a/lib/sisu/v3/texinfo_format.rb b/lib/sisu/v3/texinfo_format.rb index b9fb3256..cd98754a 100644 --- a/lib/sisu/v3/texinfo_format.rb +++ b/lib/sisu/v3/texinfo_format.rb @@ -376,7 +376,8 @@ WOK txt.gsub!(/#{Mx[:gl_o]}#042#{Mx[:gl_c]}/,'*') txt.gsub!(/#{Mx[:gl_o]}#047#{Mx[:gl_c]}/,'/') txt.gsub!(/#{Mx[:gl_o]}#095#{Mx[:gl_c]}/,'_') - txt.gsub!(/#{Mx[:br_nl]}+/,"\n") + txt.gsub!(/#{Mx[:gl_o]}#092#{Mx[:gl_c]}/,'\\') + txt.gsub!(/(?:#{Mx[:br_line]}|#{Mx[:br_nl]})\s*/,"\n\n") # watch txt.gsub!(/<sup><font face=symbol>&atild;<\/font><\/sup>/,' ') #txt.gsub!(/\\/,'\\backslash ') txt.gsub!(/<:pb>/,'\\newpage') diff --git a/lib/sisu/v3/texpdf.rb b/lib/sisu/v3/texpdf.rb index 918e00a2..522480fd 100644 --- a/lib/sisu/v3/texpdf.rb +++ b/lib/sisu/v3/texpdf.rb @@ -103,11 +103,11 @@ module SiSU_TeX def song begin @md=@particulars.md - SiSU_Screen::Ansi.new(@opt.cmd,'LaTeX/PDF',@md.fns).green_title_hi unless @opt.cmd =~/q/ + SiSU_Screen::Ansi.new(@opt.cmd,'LaTeX/PDF',"[#{@opt.f_pth[:lng_is]}] #{@opt.fns}").green_title_hi unless @opt.cmd =~/q/ if @opt.cmd =~/[MVv]/ path=@env.url.output_tell SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.program.pdf_viewer} #{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_l}pdf").flow - SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.program.pdf_viewer} #{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_p}pdf").flow + SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@opt.fns} #{@env.program.pdf_viewer} #{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_p}pdf").flow end @md=@particulars.md $flag=@md.opt.cmd #introduced to pass 0 for no object citation numbers... to texpdf_format @@ -349,6 +349,8 @@ module SiSU_TeX if dob.tmp =~/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}#{Mx[:rel_o]}\S+?#{Mx[:rel_c]}/ dob.tmp=SiSU_TeX_Pdf::Format_text_object.new(@md,dob.tmp).url_str_internal(dob.tmp) end + elsif dob.is =='code' + dob.tmp=SiSU_TeX_Pdf::Special_characters.new(@md,dob.tmp).special_characters_code elsif dob.is =='break' if dob.obj==Mx[:br_page]; dob.tmp='\newpage' elsif dob.obj==Mx[:br_page_new]; dob.tmp='\clearpage' @@ -460,10 +462,6 @@ module SiSU_TeX dob else 'error' #should never occur end - if dob.tmp =~/<=curly/ #takes care of escaped curly braces, expand - sp_char=SiSU_TeX_Pdf::Special_characters.new(@md,dob) - dob.tmp=sp_char.special_characters_curly(dob.tmp) - end dob=enclose(dob) unless dob.tmp =~/^$/ dob else @@ -531,10 +529,6 @@ module SiSU_TeX dob.tmp.gsub!(/\s*(?:#{Mx[:br_line]}|#{Mx[:br_nl]})\s*/,' \newline ') #% tread with care dob.tmp.gsub!(/(\.#{Tex[:tilde]}\S*\s*|<:\S+>|#{Mx[:fa_o]}.*?#{Mx[:fa_c]}|#{Mx[:gr_o]}.*?#{Mx[:gr_c]}|<!.*?!>|<!>)/,' ') #% tread with care end - if dob.tmp =~/<=curly/ #takes care of escaped curly braces, expand - sp_char=SiSU_TeX_Pdf::Special_characters.new(@md,dob) - dob.tmp=sp_char.special_characters_curly(dob.tmp) - end dob end if dob.tmp =~/(?:#{Mx[:url_o]}\S+?#{Mx[:url_c]}|image\b)/m \ @@ -582,6 +576,18 @@ module SiSU_TeX \\newcommand{\\Codeblock}[1]{\\normaltext\\raggedright\\small\\ttfamily\\texbackslash#1} \\newcommand{\\monosp}[1]{\\normaltext\\ttfamily\\texbackslash#1} \\newcommand{\\parasep}{\\\\ \\begin{center}*\\hspace{2em}*\\hspace{2em}*\\end{center} \\\\} +\\newcommand{\\hardspace}{{~}} +%\\newcommand{\\hardspace}{\\hspace{.5em}} +\\newcommand{\\caret}{{\\^{~}}} +\\newcommand{\\pipe}{{\\textbar}} +\\newcommand{\\curlyopen}{\{} +\\newcommand{\\curlyclose}{\}} +\\newcommand{\\lt}{{\UseTextSymbol{OML}{<}}} +\\newcommand{\\gt}{{\UseTextSymbol{OML}{>}}} +\\newcommand{\\slash}{{/}} +\\newcommand{\\underscore}{\\_} +\\newcommand{\\exclaim}{\\Verbatim{!}} +% (tilde hash amp affected by http) % \\sloppy \\begin{document} WOK diff --git a/lib/sisu/v3/texpdf_format.rb b/lib/sisu/v3/texpdf_format.rb index 8c53b458..d7942121 100644 --- a/lib/sisu/v3/texpdf_format.rb +++ b/lib/sisu/v3/texpdf_format.rb @@ -983,7 +983,7 @@ WOK w.gsub!(/[\\]?~/,'<=tilde>') w.gsub!(/[#{Mx[:br_line]}#{Mx[:br_paragraph]}]/,' \newline ') #watch w.gsub!(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'<=tilde>') #126 usual - w.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 + w.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.gsub!(/\#/,'<=hash>') @@ -1000,26 +1000,26 @@ WOK str.gsub!(/#{Mx[:br_eof]}/,'') str.gsub!(/#{Mx[:br_endnotes]}/,'') #problem sequence -> - str.gsub!(/&(?:nbsp);|#{Mx[:nbsp]}/,'<=hardspace>') unless is=='code' # < SiSU special character also LaTeX - str.gsub!(/&(?:lt|#060);/,'<=lt>') # < SiSU special character also LaTeX - str.gsub!(/#{Mx[:gl_o]}#(?:gt|062)#{Mx[:gl_c]}/,'<=gt>') # > SiSU special character also LaTeX - str.gsub!(/#{Mx[:gl_o]}#123#{Mx[:gl_c]}/,'<=curlyopen>') # { SiSU special character also LaTeX - str.gsub!(/#{Mx[:gl_o]}#125#{Mx[:gl_c]}/,'<=curlyclose>') # } SiSU special character also LaTeX - str.gsub!(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'<=tilde>') # ~ SiSU special character also LaTeX - str.gsub!(/#{Mx[:gl_o]}#035#{Mx[:gl_c]}/,'\#') # # SiSU special character also LaTeX - str.gsub!(/#{Mx[:gl_o]}#033#{Mx[:gl_c]}/,'!') # ! SiSU not really special sisu character but done, also LaTeX - str.gsub!(/(^|\s)\*\s/,'\1\asterisk ') # * should you wish to escape astrisk e.g. describing \*{bold}* - str.gsub!(/#{Mx[:gl_o]}#042#{Mx[:gl_c]}/,'\*') # * should you wish to escape astrisk e.g. describing \*{bold}* - str.gsub!(/#{Mx[:gl_o]}#045#{Mx[:gl_c]}/,'-') # - SiSU special character also LaTeX - str.gsub!(/#{Mx[:gl_o]}#043#{Mx[:gl_c]}/,'+') # + SiSU special character also LaTeX - str.gsub!(/#{Mx[:gl_o]}#044#{Mx[:gl_c]}/,',') # + SiSU special character also LaTeX - str.gsub!(/#{Mx[:gl_o]}#038#{Mx[:gl_c]}/,'<=amp>') #unless @txt=~/<:code>/ # / SiSU special character also LaTeX - str.gsub!(/#{Mx[:gl_o]}#047#{Mx[:gl_c]}/,'<=slash>') # / SiSU special character also LaTeX - str.gsub!(/#{Mx[:gl_o]}#092#{Mx[:gl_c]}/,'<=backslash>') # \ SiSU special character also LaTeX - str.gsub!(/#{Mx[:gl_o]}#095#{Mx[:gl_c]}/,'<=underscore>') # _ SiSU special character also LaTeX - str.gsub!(/#{Mx[:gl_o]}#124#{Mx[:gl_c]}/,'|') # | SiSU not really special sisu character but done, also LaTeX - str.gsub!(/#{Mx[:gl_o]}#058#{Mx[:gl_c]}/,':') # : SiSU not really special sisu character but done, also LaTeX - str.gsub!(/#{Mx[:gl_o]}#094#{Mx[:gl_c]}|\^/,'<=caret>') # ^ SiSU not really special sisu character but done, also LaTeX + str.gsub!(/&(?:nbsp);|#{Mx[:nbsp]}/,'\hardspace') unless is=='code' # < SiSU special character also LaTeX + str.gsub!(/&(?:lt|#060);/,'\lt') # < SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#(?:gt|062)#{Mx[:gl_c]}/,'\gt') # > SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#123#{Mx[:gl_c]}/,'\curlyopen') # { SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#125#{Mx[:gl_c]}/,'\curlyclose') # } SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'<=tilde>') # ~ SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#035#{Mx[:gl_c]}/,'\#') # # SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#033#{Mx[:gl_c]}/,'!') # ! SiSU not really special sisu character but done, also LaTeX + str.gsub!(/(^|\s)\*\s/,'\1\asterisk ') # * should you wish to escape astrisk e.g. describing \*{bold}* + str.gsub!(/#{Mx[:gl_o]}#042#{Mx[:gl_c]}/,'\*') # * should you wish to escape astrisk e.g. describing \*{bold}* + str.gsub!(/#{Mx[:gl_o]}#045#{Mx[:gl_c]}/,'-') # - SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#043#{Mx[:gl_c]}/,'+') # + SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#044#{Mx[:gl_c]}/,',') # + SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#038#{Mx[:gl_c]}/,'<=amp>') #unless @txt=~/<:code>/ # / SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#047#{Mx[:gl_c]}/,'\slash') # / SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#092#{Mx[:gl_c]}/,'\textbackslash') # \ SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#095#{Mx[:gl_c]}/,'<=underscore>') # _ SiSU special character also LaTeX + str.gsub!(/#{Mx[:gl_o]}#124#{Mx[:gl_c]}/,'|') # | SiSU not really special sisu character but done, also LaTeX + str.gsub!(/#{Mx[:gl_o]}#058#{Mx[:gl_c]}/,':') # : SiSU not really special sisu character but done, also LaTeX + str.gsub!(/#{Mx[:gl_o]}#094#{Mx[:gl_c]}|\^/,'\caret') # ^ SiSU not really special sisu character but done, also LaTeX ##watch placement, problem sequence ^ str.gsub!(/<sup><font face=symbol>&atild;<\/font><\/sup>/,' ') str.gsub!(/\\copy(right|mark)?/,'<=copymark>') # ok problem with superscript @@ -1043,8 +1043,6 @@ WOK str.gsub!(/\\~(\[)/,'{$\tilde$}\1') str.gsub!(/(\])\\~/,'\1{$\tilde$}') str.gsub!(/<=tilde>/,'{$\tilde$}') - str.gsub!(/<=pipe>/,'{\textbar}') - str.gsub!(/<=caret>/,'{\^{~}}') str.gsub!(/<=hash>/,'{\#}') else str.gsub!(/ |#{Mx[:nbsp]}/,'~') # ~ character for hardspace @@ -1099,44 +1097,27 @@ WOK def xetex_special_characters_3(str) str.gsub!(/<br(\s*[^\/][^>])/,'\1') # clean up, incredibly messy :-( footnote indents, problems if match exists in ordinary paragraphs? check! Work Area 200501 a bit tricky as must be able to match multiple times, and to clean remainder str.gsub!(/([^<][^b][^r]\s+)\/>/,'\1') # clean up, incredibly messy :-( footnote indents, problems if match exists in ordinary paragraphs? check! Work Area 200501 a bit tricky as must be able to match multiple times, and to clean remainder - #problem sequence (another kludge) -> - str.gsub!(/<=lt>/m,'{\UseTextSymbol{OML}{<}}') - str.gsub!(/<=gt>/m,'{\UseTextSymbol{OML}{>}}') - str.gsub!(/<=underscore>/,'\_') while str =~/(https?:\/\/\S+?)(?:<=tilde>\S+)+/ #tilde in urls \href treated differently from text #FIX str.gsub!(/(https?:\/\/\S+?)(?:<=tilde>(\S+))+/,'\1~\2') end str.gsub!(/<=tilde>/,'{$\tilde$}') - str.gsub!(/<=pipe>/,'{\textbar}') - str.gsub!(/<=caret>/,'{\^{~}}') - str.gsub!(/<=exclaim>/,'\Verbatim{!}') str.gsub!(/(https?:\/\/\S+?)(?:(?:<=hash>)(\S+))+/,'\1#\2') #hash in urls \href treated differently from text #FIX str.gsub!(/<=hash>/,'{\#}') - str.gsub!(/<=hardspace>/,'{~}') #changed ... 2005 while str =~/(https?:\/\/\S+?)(?:<=amp>\S+)+/ #amp in urls \href treated differently from text #FIX str.gsub!(/(https?:\/\/\S+?)(?:<=amp>(\S+))+/,'\1&\2') end str.gsub!(/<=amp>/,'{\\\&}') #changed ... 2005 - str.gsub!(/<=slash>/,'{/}') - str.gsub!(/<=backslash>/,'{\textbackslash}') str.gsub!(/<=copymark>\s*(.+)/, '^\copyright \textnormal{\1} \2') # watch likely to be problematic str end - def special_characters_curly(str) - str.gsub!(/<=curlyopen>/,'\{') - str.gsub!(/<=curlyclose>/,'\}') - str - end def special_characters_code_fix(str) - str.gsub!(/<=hardspace>/,'{~}') - str.gsub!(/<=pipe>/,'{\textbar}') str.gsub!(/<=tilde>/,'{$\tilde$}') str end def special_characters_unsafe_1(str) #depreciated, make obsolete # some substitutions are sequence sensitive, rearrange with care. - str.gsub!(/\\backslash (copyright|clearpage|newpage)/,"\\\\\\1") #kludge bad solution, find out where tail is sent through specChar ! + str.gsub!(/\\textbackslash (copyright|clearpage|newpage)/,"\\\\\\1") #kludge bad solution, find out where tail is sent through specChar ! str end def special_characters #special characters - some substitutions are sequence sensitive, rearrange with care. @@ -1164,6 +1145,11 @@ WOK str=xetex_special_characters_2(str,is) unless str.nil? # remove this to start with, causes issues @txt=str end + def special_characters_code + str=@txt + str.gsub!(/ \\\\([ #{Mx[:br_nl]}]+|$)/,' \textbackslash\textbackslash\hardspace\1') + str + end end class Use_TeX attr_accessor :url,:txt,:date diff --git a/lib/sisu/v3/urls.rb b/lib/sisu/v3/urls.rb index ee81786c..2e73a91f 100644 --- a/lib/sisu/v3/urls.rb +++ b/lib/sisu/v3/urls.rb @@ -131,57 +131,57 @@ module SiSU_urls def show def source def src(x,y) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@md.file.output_path.src.dir}/#{y}").result + SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","#{@prog.text_editor} #{@md.file.output_path.src.dir}/#{y}").result end def pod(x,y) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} #{@env.url.output_tell}/pod/#{y}").result + SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","#{@prog.web_browser} #{@env.url.output_tell}/pod/#{y}").result end self end def generic(x,y) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} #{@env.url.output_tell}/#{@fnb}/#{y}").result + SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","#{@prog.web_browser} #{@env.url.output_tell}/#{@fnb}/#{y}").result end def meta(x,y) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} ~#{y}/#{@fnb}.#{y}").result + SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","#{@prog.text_editor} ~#{y}/#{@fnb}.#{y}").result end def text(x) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} file://#{@md.file.output_path.txt.dir}/#{@md.file.base_filename.txt}").result + SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","#{@prog.web_browser} file://#{@md.file.output_path.txt.dir}/#{@md.file.base_filename.txt}").result end def epub(x) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.epub_viewer} #{@md.file.output_path.epub.dir}/#{@md.file.base_filename.epub}").result + SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","#{@prog.epub_viewer} #{@md.file.output_path.epub.dir}/#{@md.file.base_filename.epub}").result end def html def scroll(x) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} file://#{@md.file.output_path.html_scroll.dir}/#{@md.file.base_filename.html_scroll}").result + SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","#{@prog.web_browser} file://#{@md.file.output_path.html_scroll.dir}/#{@md.file.base_filename.html_scroll}").result end def toc(x) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} file://#{@md.file.output_path.html_seg.dir}/#{@md.file.base_filename.html_segtoc}").result + SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","#{@prog.web_browser} file://#{@md.file.output_path.html_seg.dir}/#{@md.file.base_filename.html_segtoc}").result end def concordance(x) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} file://#{@md.file.output_path.html_concordance.dir}/#{@md.file.base_filename.html_concordance}").result + SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","#{@prog.web_browser} file://#{@md.file.output_path.html_concordance.dir}/#{@md.file.base_filename.html_concordance}").result end def manifest(x) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} file://#{@md.file.output_path.manifest.dir}/#{@md.file.base_filename.manifest}").result + SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","#{@prog.web_browser} file://#{@md.file.output_path.manifest.dir}/#{@md.file.base_filename.manifest}").result end self end def odt(x) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.odf_viewer} file://#{@md.file.output_path.odt.dir}/#{@md.file.base_filename.odt}").result + SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","#{@prog.odf_viewer} file://#{@md.file.output_path.odt.dir}/#{@md.file.base_filename.odt}").result end def pdf def portrait(x) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.pdf_viewer} #{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_p}pdf").result + SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","#{@prog.pdf_viewer} #{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_p}pdf").result end def landscape(x) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.pdf_viewer} #{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_l}pdf").result + SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","#{@prog.pdf_viewer} #{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_l}pdf").result end self end def manpage(x) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.manpage_viewer} #{@md.file.output_path.manpage.dir}/#{@md.file.base_filename.manpage}").result + SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","#{@prog.manpage_viewer} #{@md.file.output_path.manpage.dir}/#{@md.file.base_filename.manpage}").result end def pinfo(x,y) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","cd #{@env.processing_path.texinfo}; pinfo ./#{@fnb}.#{y}; cd -").result + SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","pinfo -f #{@md.file.output_path.texinfo.dir}/#{@md.file.base_filename.texinfo}").result end def po4a def po(x,y) @@ -193,29 +193,29 @@ module SiSU_urls self end def xhtml(x) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} file://#{@md.file.output_path.xhtml.dir}/#{@md.file.base_filename.xhtml}").result + SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","#{@prog.web_browser} file://#{@md.file.output_path.xhtml.dir}/#{@md.file.base_filename.xhtml}").result end def xml def sax(x) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} file://#{@md.file.output_path.xml_sax.dir}/#{@md.file.base_filename.xml_sax}").result + SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","#{@prog.web_browser} file://#{@md.file.output_path.xml_sax.dir}/#{@md.file.base_filename.xml_sax}").result end def dom(x) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} file://#{@md.file.output_path.xml_dom.dir}/#{@md.file.base_filename.xml_dom}").result + SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","#{@prog.web_browser} file://#{@md.file.output_path.xml_dom.dir}/#{@md.file.base_filename.xml_dom}").result end def sitemap(x) #BROKEN - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} file://#{@md.file.output_path.sitemaps.dir}/#{@md.file.base_filename.sitemap}").result + SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","#{@prog.web_browser} file://#{@md.file.output_path.sitemaps.dir}/#{@md.file.base_filename.sitemap}").result end self end def hash_digest(x) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} file://#{@md.file.output_path.hash_digest.dir}/#{@md.file.base_filename.hash_digest}").result + SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x}","#{@prog.web_browser} file://#{@md.file.output_path.hash_digest.dir}/#{@md.file.base_filename.hash_digest}").result end def db def psql(x,y) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x} DBI psql","#{@pwd_stub}::#{@opt.fns}",y).result + SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x} DBI psql","#{@pwd_stub}::#{@opt.fns}",y).result end def sqlite(x,y) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x} DBI sqlite","sqlite3 #{@env.path.webserv}/#{@md.opt.f_pth[:pth_stub]}/sisu_sqlite.db", "#{y}").result + SiSU_Screen::Ansi.new(@opt.cmd,"[#{@opt.f_pth[:lng_is]}] -#{x} DBI sqlite","sqlite3 #{@env.path.webserv}/#{@md.opt.f_pth[:pth_stub]}/sisu_sqlite.db", "#{y}").result end self end @@ -272,7 +272,7 @@ module SiSU_urls end def urls_select unless @opt.cmd =~/q/ - i="(output manifest) #{@md.file.output_path.manifest.dir}/#{@md.file.base_filename.manifest}" + i="(output manifest) [#{@opt.f_pth[:lng_is]}] #{@md.file.output_path.manifest.dir}/#{@md.file.base_filename.manifest}" @opt.cmd=~/[MVvz]/ \ ? SiSU_Screen::Ansi.new(@opt.cmd,'URLs').grey_title_hi \ : SiSU_Screen::Ansi.new(@opt.cmd,'URL',i).green_hi_blue @@ -383,7 +383,7 @@ module SiSU_urls end end def urls_all - i="(output manifest) #{@env.url.output_tell}/#{@fnb}/sisu_manifest.html" + i="(output manifest) [#{@opt.f_pth[:lng_is]}] #{@env.url.output_tell}/#{@fnb}/sisu_manifest.html" SiSU_Screen::Ansi.new(@opt.cmd,'URLs',i).grey_title_hi @u.each do |x,y| tell=case x diff --git a/lib/sisu/v3/xhtml.rb b/lib/sisu/v3/xhtml.rb index a1b393f2..ba8238d2 100644 --- a/lib/sisu/v3/xhtml.rb +++ b/lib/sisu/v3/xhtml.rb @@ -86,7 +86,7 @@ module SiSU_XHTML tool=if @opt.cmd =~/[MV]/; "#{@env.program.web_browser} file://#{@md.file.output_path.xhtml.dir}/#{@md.file.base_filename.xhtml}#{path}/#{@md.fnb}/#{@md.fn[:xhtml]}\n\t#{@env.program.xml_viewer} file://#{@md.file.output_path.xhtml.dir}/#{@md.file.base_filename.xhtml}#{path}/#{@md.fnb}/#{@md.fn[:xhtml]}" elsif @opt.cmd =~/v/; "#{@env.program.web_browser} file://#{@md.file.output_path.xhtml.dir}/#{@md.file.base_filename.xhtml}" - else @opt.fns + else "[#{@opt.f_pth[:lng_is]}] #{@opt.fns}" end @opt.cmd=~/[MVvz]/ \ ? SiSU_Screen::Ansi.new(@opt.cmd,'invert','XHTML',tool).colorize \ diff --git a/lib/sisu/v3/xml.rb b/lib/sisu/v3/xml.rb index e821cfd4..23cfb5bc 100644 --- a/lib/sisu/v3/xml.rb +++ b/lib/sisu/v3/xml.rb @@ -85,7 +85,7 @@ module SiSU_XML_SAX loc=@env.url.output_tell tool=if @opt.cmd =~/[MV]/; "#{@env.program.web_browser} file://#{@md.file.output_path.xml_sax.dir}/#{@md.file.base_filename.xml_sax}\n\t#{@env.program.xml_viewer} file://#{@md.file.output_path.xml_sax.dir}/#{@md.file.base_filename.xml_sax}" elsif @opt.cmd =~/v/; "#{@env.program.web_browser} file://#{@md.file.output_path.xml_sax.dir}/#{@md.file.base_filename.xml_sax}" - else @opt.fns + else "[#{@opt.f_pth[:lng_is]}] #{@opt.fns}" end @opt.cmd=~/[MVvz]/ \ ? SiSU_Screen::Ansi.new(@opt.cmd,'invert','XML SAX',tool).colorize \ diff --git a/lib/sisu/v3/xml_dom.rb b/lib/sisu/v3/xml_dom.rb index db6a8786..22b11ebc 100644 --- a/lib/sisu/v3/xml_dom.rb +++ b/lib/sisu/v3/xml_dom.rb @@ -83,7 +83,7 @@ module SiSU_XML_DOM loc=@env.url.output_tell tool=if @opt.cmd =~/[MV]/; "#{@env.program.web_browser} file://#{@md.file.output_path.xml_dom.dir}/#{@md.file.base_filename.xml_dom}\n\t#{@env.program.xml_viewer} file://#{@md.file.output_path.xml_dom.dir}/#{@md.file.base_filename.xml_dom}" elsif @opt.cmd =~/v/; "#{@env.program.web_browser} file://#{@md.file.output_path.xml_dom.dir}/#{@md.file.base_filename.xml_dom}" - else @opt.fns + else "[#{@opt.f_pth[:lng_is]}] #{@opt.fns}" end @opt.cmd=~/[MVvz]/ \ ? SiSU_Screen::Ansi.new(@opt.cmd,'invert','XML DOM',tool).colorize \ |