From 833558063f14471bf46512ae7bf69bf4e5de49c9 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 26 Jun 2011 14:03:16 -0400 Subject: v2 v3: dal_syntax, linebreak in regular text object: ' \\ ' ('
' depreciated) * thanks to Jonas Stein for making me look at this (see bug: #617298 & comments in upstream CHANGELOG_v3) * testing required, downstream outputs affected --- lib/sisu/v2/dal_syntax.rb | 21 +++++++++++++-------- lib/sisu/v3/dal_syntax.rb | 21 +++++++++++++-------- 2 files changed, 26 insertions(+), 16 deletions(-) (limited to 'lib') 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>|
)/,"#{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+.*?)(
|[#{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*(.+?)(
|[#{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*(.+?)(
|[#{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)/,",
#{@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>|
)/,"#{Mx[:br_line]}") #indent used in endnotes, not implemented, replace when ready with: line.gsub!(/(?:
|
)\s*_([12])\s+/,'
<: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>|
)/, - "#{Mx[:br_line]}") #indent used in endnotes, not implemented, replace when ready with: line.gsub!(/(?:
|
)\s*_([12])\s+/,'
<:i\1> ') dob.obj.gsub!(/<:hi>/,"#{Mx[:fa_hilite_o]}") #'') # bright yellow rgb(255,255,0) pale yellow rgb(255,255,200) dob.obj.gsub!(/<:\/hi>/,"#{Mx[:fa_hilite_c]}") #'') 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>|
)\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!(/(?:
|
)\s*_([12])\s+/,'
<:i\1> ') end @data 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>|
)/,"#{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+.*?)(
|[#{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*(.+?)(
|[#{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*(.+?)(
|[#{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)/,",
#{@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>|
)/,"#{Mx[:br_line]}") #indent used in endnotes, not implemented, replace when ready with: line.gsub!(/(?:
|
)\s*_([12])\s+/,'
<: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>|
)/, - "#{Mx[:br_line]}") #indent used in endnotes, not implemented, replace when ready with: line.gsub!(/(?:
|
)\s*_([12])\s+/,'
<:i\1> ') dob.obj.gsub!(/<:hi>/,"#{Mx[:fa_hilite_o]}") #'') # bright yellow rgb(255,255,0) pale yellow rgb(255,255,200) dob.obj.gsub!(/<:\/hi>/,"#{Mx[:fa_hilite_c]}") #'') 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>|
)\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!(/(?:
|
)\s*_([12])\s+/,'
<:i\1> ') end @data -- cgit v1.2.3 From 60bd031de5561592c97a40345ea9791d895ee8d0 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 26 Jun 2011 14:21:07 -0400 Subject: v3: ansi screen reporting include document language code --- lib/sisu/v3/composite.rb | 2 +- lib/sisu/v3/concordance.rb | 4 +++- lib/sisu/v3/dal.rb | 2 +- lib/sisu/v3/digests.rb | 2 +- lib/sisu/v3/epub.rb | 2 +- lib/sisu/v3/html.rb | 2 +- lib/sisu/v3/manifest.rb | 2 +- lib/sisu/v3/manpage.rb | 11 +++++++---- lib/sisu/v3/odf.rb | 2 +- lib/sisu/v3/plaintext.rb | 2 +- lib/sisu/v3/texinfo.rb | 15 +++++++++------ lib/sisu/v3/texpdf.rb | 4 ++-- lib/sisu/v3/xhtml.rb | 2 +- lib/sisu/v3/xml.rb | 2 +- lib/sisu/v3/xml_dom.rb | 2 +- 15 files changed, 32 insertions(+), 24 deletions(-) (limited to 'lib') 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/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/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/manifest.rb b/lib/sisu/v3/manifest.rb index a21b31f9..bed74aab 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 diff --git a/lib/sisu/v3/manpage.rb b/lib/sisu/v3/manpage.rb index 17fef80b..00515e7f 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 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..cd5e2ea3 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 diff --git a/lib/sisu/v3/texinfo.rb b/lib/sisu/v3/texinfo.rb index f7693056..7281a7f9 100644 --- a/lib/sisu/v3/texinfo.rb +++ b/lib/sisu/v3/texinfo.rb @@ -96,17 +96,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) diff --git a/lib/sisu/v3/texpdf.rb b/lib/sisu/v3/texpdf.rb index 918e00a2..c9e0f032 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 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 \ -- cgit v1.2.3 From 7ef0302aa8c9e810bd9d8de86a2b92a2d9bea0fe Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 26 Jun 2011 14:40:52 -0400 Subject: v2 v3: texpdf, define hardspace & provide backslash * define \hardspace to simplify placing a hardspace * provide backslash character in code block --- lib/sisu/v2/texpdf.rb | 4 ++++ lib/sisu/v2/texpdf_format.rb | 5 +++++ lib/sisu/v3/texpdf.rb | 4 ++++ lib/sisu/v3/texpdf_format.rb | 5 +++++ 4 files changed, 18 insertions(+) (limited to 'lib') 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/texpdf.rb b/lib/sisu/v3/texpdf.rb index c9e0f032..0f16e991 100644 --- a/lib/sisu/v3/texpdf.rb +++ b/lib/sisu/v3/texpdf.rb @@ -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' @@ -582,6 +584,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/v3/texpdf_format.rb b/lib/sisu/v3/texpdf_format.rb index 8c53b458..f7e63066 100644 --- a/lib/sisu/v3/texpdf_format.rb +++ b/lib/sisu/v3/texpdf_format.rb @@ -1164,6 +1164,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 -- cgit v1.2.3 From d95f8574ec670222f7236033e7b188c7b5a099ab Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 26 Jun 2011 14:50:18 -0400 Subject: v3: define latex \newcommands for some special characters (for sisu code) * \newcommands for some special characters to simplify dealing with them in sisu code \hardspace \caret \pipe \curlyopen \curlyclose \lt \gt \slash \backslash \underscore \exclaim --- lib/sisu/v3/texpdf.rb | 18 +++++++------ lib/sisu/v3/texpdf_format.rb | 63 ++++++++++++++++---------------------------- 2 files changed, 32 insertions(+), 49 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v3/texpdf.rb b/lib/sisu/v3/texpdf.rb index 0f16e991..522480fd 100644 --- a/lib/sisu/v3/texpdf.rb +++ b/lib/sisu/v3/texpdf.rb @@ -462,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 @@ -533,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 \ @@ -586,6 +578,16 @@ module SiSU_TeX \\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 f7e63066..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!(/&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!(/])/,'\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. -- cgit v1.2.3 From 3dafcaeb713a8b343c8ba7594fd4e1e4f7b0b52b Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 26 Jun 2011 15:02:38 -0400 Subject: v3: constants, a sisupod & an xml related addition --- lib/sisu/v3/constants.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') 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' -- cgit v1.2.3 From 561b3d6e0c2d6b2275ff6db36911b26aa11a62e8 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 26 Jun 2011 15:05:20 -0400 Subject: v3: plaintext, codeblock keep backslashes --- lib/sisu/v3/plaintext.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/sisu/v3/plaintext.rb b/lib/sisu/v3/plaintext.rb index cd5e2ea3..b7ad1680 100644 --- a/lib/sisu/v3/plaintext.rb +++ b/lib/sisu/v3/plaintext.rb @@ -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]}/,"* ") -- cgit v1.2.3 From b975bd03d29ea9046021ebedc07301ce7d8c7550 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 26 Jun 2011 15:14:45 -0400 Subject: v3: html_tune, reduce loops; deal with angle-brackets * deal with angle brackets in markup (test, could cause breakage) * reduce loops in code --- lib/sisu/v3/html_tune.rb | 179 +++++++++++++++++++++++++---------------------- 1 file changed, 94 insertions(+), 85 deletions(-) (limited to 'lib') 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#\1. ') #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]}/,'
') unless dob.is=='table' - dob.obj.gsub!(/#{Mx[:fa_bold_o]}(.+?)#{Mx[:fa_bold_c]}/,'\1') - dob.obj.gsub!(/#{Mx[:fa_italics_o]}(.+?)#{Mx[:fa_italics_c]}/,'\1') - dob.obj.gsub!(/#{Mx[:fa_underscore_o]}(.+?)#{Mx[:fa_underscore_c]}/,'\1') - dob.obj.gsub!(/#{Mx[:fa_superscript_o]}(.+?)#{Mx[:fa_superscript_c]}/,'\1') - dob.obj.gsub!(/#{Mx[:fa_subscript_o]}(.+?)#{Mx[:fa_subscript_c]}/,'\1') - dob.obj.gsub!(/#{Mx[:fa_insert_o]}(.+?)#{Mx[:fa_insert_c]}/,'\1') - dob.obj.gsub!(/#{Mx[:fa_cite_o]}(.+?)#{Mx[:fa_cite_c]}/,'\1') - dob.obj.gsub!(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strike_c]}/,'\1') - dob.obj.gsub!(/#{Mx[:fa_monospace_o]}(.+?)#{Mx[:fa_monospace_c]}/,'\1') # tt, kbd - dob.obj.gsub!(/#{Mx[:mk_o]}:name#(\S+?)#{Mx[:mk_c]}/,'') - 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,%{©}) - if (dob.obj !~/\<:ad\s+\.\.\//) - dob.obj.gsub!(/\<:ad\s+(\S+)?\s+(\S+\.png)\s+(.+)?\;\s+(.+)?\;\s*!\>/, - %{\n
\\3
\n}) - else - dob.obj.gsub!(/\<:ad\s+(\S+)?\s+(\S+\.png)\s+(.+)?\;\s+(.+)?\;\s*\>/, - %{\n
\\3
\n}) - end - dob.obj.gsub!(/!pick/,%{stellar}) - dob.obj.gsub!(/!new/,%{ new}) - dob.obj.gsub!(/<:h(.{1,7}?)>/,'\1') - dob.obj.gsub!(/<:to(\d{1,7}?)>/,'to { \1 } ') - dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'\1') #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}\\1#{@brace_url.xml_close}}) - dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}\\1#{@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+)/,'\1') - end - if dob.obj =~/..\/\S+/ \ - and dob.obj !~/(\"..\/\S+?\"|>\s*..\/\S+<)/ - dob.obj.gsub!(/\.\.(\/\S+)/,%{\1}) - end - dob.obj.gsub!(/©
}) + if (dob.obj !~/\<:ad\s+\.\.\//) + dob.obj.gsub!(/\<:ad\s+(\S+)?\s+(\S+\.png)\s+(.+)?\;\s+(.+)?\;\s*!\>/, + %{\n
\\3
\n}) else - dob.obj.gsub!(/(^|[^}])_/m,'\1>') #code-block: angle brackets special characters - dob.obj.gsub!(/(^|[^}])_/m,'\1>') + dob.obj.gsub!(/\<:ad\s+(\S+)?\s+(\S+\.png)\s+(.+)?\;\s+(.+)?\;\s*\>/, + %{\n
\\3
\n}) end - @tuned_file << dob + dob.obj.gsub!(/!pick/,%{stellar}) + dob.obj.gsub!(/!new/,%{ new}) + dob.obj.gsub!(/<:h(.{1,7}?)>/,'\1') + dob.obj.gsub!(/<:to(\d{1,7}?)>/,'to { \1 } ') + dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'\1') #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}\\1#{@brace_url.xml_close}}) + dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}\\1#{@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+)/,'\1') + end + if dob.obj =~/..\/\S+/ \ + and dob.obj !~/(\"..\/\S+?\"|>\s*..\/\S+<)/ + dob.obj.gsub!(/\.\.(\/\S+)/,%{\1}) + end + dob.obj.gsub!(//m,'\1>') #code-block: angle brackets special characters + 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]})/, - '  \2  ' + #note- endnote- - '\1\2  \2. \3 \4') #endnote- note- (careful may have switched) - dob.obj.gsub!(/(#{Mx[:en_b_o]})([*+]\d+)\s+(.+?)(#{Mx[:en_b_c]})/, - '  \2  ' + #note- endnote- - '\1\2  \2. \3 \4') #endnote- note- (careful may have switched) - dob.obj.gsub!(/(#{Mx[:en_a_o]})([*+]+)\s+(.+?)(#{Mx[:en_a_c]})/, - '  \2  ' + #note- endnote- - '\1\2  \2 \3 \4') #endnote- note- (careful may have switched) - end + dob.gsub!(/#{Mx[:lv_o]}\d:(\S?)#{Mx[:lv_c]}/,'\0#\1. ') #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]})/, + '  \2  ' + #note- endnote- + '\1\2  \2. \3 \4') #endnote- note- (careful may have switched) + dob.obj.gsub!(/(#{Mx[:en_b_o]})([*+]\d+)\s+(.+?)(#{Mx[:en_b_c]})/, + '  \2  ' + #note- endnote- + '\1\2  \2. \3 \4') #endnote- note- (careful may have switched) + dob.obj.gsub!(/(#{Mx[:en_a_o]})([*+]+)\s+(.+?)(#{Mx[:en_a_c]})/, + '  \2  ' + #note- endnote- + '\1\2  \2 \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]}/,'
') unless dob.is=='table' + dob.obj.gsub!(/#{Mx[:fa_bold_o]}(.+?)#{Mx[:fa_bold_c]}/,'\1') + dob.obj.gsub!(/#{Mx[:fa_italics_o]}(.+?)#{Mx[:fa_italics_c]}/,'\1') + dob.obj.gsub!(/#{Mx[:fa_underscore_o]}(.+?)#{Mx[:fa_underscore_c]}/,'\1') + dob.obj.gsub!(/#{Mx[:fa_superscript_o]}(.+?)#{Mx[:fa_superscript_c]}/,'\1') + dob.obj.gsub!(/#{Mx[:fa_subscript_o]}(.+?)#{Mx[:fa_subscript_c]}/,'\1') + dob.obj.gsub!(/#{Mx[:fa_insert_o]}(.+?)#{Mx[:fa_insert_c]}/,'\1') + dob.obj.gsub!(/#{Mx[:fa_cite_o]}(.+?)#{Mx[:fa_cite_c]}/,'\1') + dob.obj.gsub!(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strike_c]}/,'\1') + dob.obj.gsub!(/#{Mx[:fa_monospace_o]}(.+?)#{Mx[:fa_monospace_c]}/,'\1') # tt, kbd + dob.obj.gsub!(/#{Mx[:mk_o]}:name#(\S+?)#{Mx[:mk_c]}/,'') + 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=[] -- cgit v1.2.3 From def544be45f5961df774b517542934b92141fc66 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 26 Jun 2011 15:24:48 -0400 Subject: v3: manpage (sysenv), move output; line-breaks within object * start to honor line-breaks within objects (revisit) * show double escape \\ (backslashes) in code blocks * place under web server directory * sysenv, accommodate manpage changes --- lib/sisu/v3/manpage.rb | 31 +++++++++++++++++-------------- lib/sisu/v3/sysenv.rb | 23 +++++++++++++---------- 2 files changed, 30 insertions(+), 24 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v3/manpage.rb b/lib/sisu/v3/manpage.rb index 00515e7f..0a2c2fcc 100644 --- a/lib/sisu/v3/manpage.rb +++ b/lib/sisu/v3/manpage.rb @@ -266,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 @@ -282,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]}/,'{') @@ -289,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 @@ -304,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| @@ -319,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>/m,'\1') @@ -358,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/sysenv.rb b/lib/sisu/v3/sysenv.rb index d0c88deb..5134b6c2 100644 --- a/lib/sisu/v3/sysenv.rb +++ b/lib/sisu/v3/sysenv.rb @@ -3457,6 +3457,15 @@ 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 manifest def dir output_path.manifest.dir + '/' + base_filename.manifest @@ -3614,11 +3623,11 @@ 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 hash_digest @@ -4224,13 +4233,7 @@ 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 -- cgit v1.2.3 From 408bf6b65fcbdecd8cbcc810e1fe9f7be95da5a1 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 26 Jun 2011 15:44:15 -0400 Subject: v3: info (texinfo) (sysenv), move output; line-breaks within object * backslashes & line-breaks * place under web server directory * info tool setting prompt * sysenv, accommodate info page changes --- lib/sisu/v3/sysenv.rb | 50 +++++++++++++++++++++++++++++++++++++++++++ lib/sisu/v3/texinfo.rb | 5 +++++ lib/sisu/v3/texinfo_format.rb | 3 ++- 3 files changed, 57 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb index 5134b6c2..e89d77c5 100644 --- a/lib/sisu/v3/sysenv.rb +++ b/lib/sisu/v3/sysenv.rb @@ -2286,6 +2286,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 +3268,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) @@ -3466,6 +3478,15 @@ WOK 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 @@ -3630,6 +3651,14 @@ WOK @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 ft='.txt' if @env.output_dir_structure.by_language_code? @@ -4237,6 +4266,27 @@ WOK 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 def sitemaps def ft 'sitemaps' diff --git a/lib/sisu/v3/texinfo.rb b/lib/sisu/v3/texinfo.rb index 7281a7f9..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 @@ -367,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!(/&atild;<\/font><\/sup>/,' ') #txt.gsub!(/\\/,'\\backslash ') txt.gsub!(/<:pb>/,'\\newpage') -- cgit v1.2.3 From f6f89c95513d33f60cdfaedce19c4de3f45dd387 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 26 Jun 2011 15:59:13 -0400 Subject: v3: sysenv, fix some output paths (markup source); accommodate manpage * shared source markup (.sst .ssm & sisupod.zip) fix some paths * placement of markup source, output_path.src.dir, fix * output_path.src.url, fix * manifest info * (epub viewer cosmetic rearrangement) --- lib/sisu/v3/sysenv.rb | 61 +++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 31 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb index e89d77c5..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']) \ @@ -3730,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 @@ -3756,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 @@ -3782,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 @@ -3866,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" @@ -3933,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}" -- cgit v1.2.3 From b232545a79348473d23bc84df838876edea5ecbb Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 26 Jun 2011 16:15:27 -0400 Subject: v3: manifest, manifest enable additional output & source (if shared) * manpage (in fututure have config setting with default false/off) * info (texinfo) (in fututure have config setting with default false/off) * hash digests * locate markup source (if shared) * sisupod (if shared) --- lib/sisu/v3/manifest.rb | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v3/manifest.rb b/lib/sisu/v3/manifest.rb index bed74aab..06745c35 100644 --- a/lib/sisu/v3/manifest.rb +++ b/lib/sisu/v3/manifest.rb @@ -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] << %{

#{id}

#{file}   #{dgst[1]}
#{@brace_url.xml_open}#{url}/#{file}#{@brace_url.xml_close}

#{kb}

- \n} if kb and kb =~/\d+/ + @manifest[:html] << %{

#{id}

#{file}   #{dgst[1]}
#{@brace_url.xml_open}#{url}/#{file}#{@brace_url.xml_close}

#{kb}

\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) -- cgit v1.2.3 From ae914fdb570299f6d8209ddee66b4b579b938b63 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 26 Jun 2011 20:12:18 -0400 Subject: v3: urls (ansi screen reporting), add document language code --- lib/sisu/v3/urls.rb | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3