From b1b2fe8cc3120d2a53e4c211748107ced1b1b40b Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 15 May 2011 23:10:49 -0400 Subject: v3: sysenv, output_path & place_file, modified, (affects many libraries) * paths for dir, url, relative and rcp that vary with output dir structure * cope with alterative dir structures * manifest url paths, fix * dal_expand_insertions, fix * rsync, review * scp disabled --- data/doc/sisu/CHANGELOG_v3 | 12 + lib/sisu/v3/concordance.rb | 8 +- lib/sisu/v3/dal_expand_insertions.rb | 59 +-- lib/sisu/v3/digests.rb | 4 +- lib/sisu/v3/epub.rb | 8 +- lib/sisu/v3/html.rb | 4 +- lib/sisu/v3/html_segments.rb | 6 +- lib/sisu/v3/manifest.rb | 194 +++++---- lib/sisu/v3/odf.rb | 10 +- lib/sisu/v3/plaintext.rb | 4 +- lib/sisu/v3/po4a.rb | 4 +- lib/sisu/v3/share_src.rb | 12 +- lib/sisu/v3/sisupod_make.rb | 12 +- lib/sisu/v3/sitemaps.rb | 4 +- lib/sisu/v3/sysenv.rb | 793 ++++++++++++++++++++++++++++++----- lib/sisu/v3/texpdf.rb | 18 +- lib/sisu/v3/urls.rb | 40 +- lib/sisu/v3/xhtml.rb | 8 +- lib/sisu/v3/xml.rb | 8 +- lib/sisu/v3/xml_dom.rb | 8 +- 20 files changed, 897 insertions(+), 319 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index d0c1354b..a48a8cc3 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -31,6 +31,18 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.0.9.orig.tar.gz * sysenv * output directory structure check, fix & start testing alternatives sisurc.yml output_by: (language|filetype|filename) + * output paths restructured, to have dir, url rel(ative) & rcp (for rsync or scp) + * url paths to output files (requires setup in sisurc.yml) + * consolidated output paths, directory & url, affecting many files + + * rsync of output must cope with alternative file structures + + * scp, disable until looked at + + * dal_expand_insertions, fix resulting urls for shortcut for sisu generated + document in same output directory + + * manifest, url path, fix %% 3.0.8.orig.tar.gz (2011-05-05:18/4) http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/debian/3.0.8-1 diff --git a/lib/sisu/v3/concordance.rb b/lib/sisu/v3/concordance.rb index d97c7786..72031419 100644 --- a/lib/sisu/v3/concordance.rb +++ b/lib/sisu/v3/concordance.rb @@ -77,7 +77,7 @@ 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}/#{@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}" : @md.fns @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 @@ -202,8 +202,8 @@ WOK end def songsheet begin - mkdir_p(@file.output_path.html_concordance) unless FileTest.directory?(@file.output_path.html_concordance) - @file_concordance=File.open(@file.place_file.html_concordance,'w') + mkdir_p(@file.output_path.html_concordance.dir) unless FileTest.directory?(@file.output_path.html_concordance.dir) + @file_concordance=File.open(@file.place_file.html_concordance.dir,'w') map_para rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error ensure @@ -337,7 +337,7 @@ WOK end credits=@vz.credits_sisu @file_concordance << %{\n} # footer - SiSU_Screen::Ansi.new(@opt.cmd,@md.fns,"#{@md.file.output_path.html_concordance}/#{@md.file.base_filename.html_concordance}").flow if @md.opt.cmd =~/[MV]/ + SiSU_Screen::Ansi.new(@opt.cmd,@md.fns,"#{@md.file.output_path.html_concordance.dir}/#{@md.file.base_filename.html_concordance}").flow if @md.opt.cmd =~/[MV]/ end end end diff --git a/lib/sisu/v3/dal_expand_insertions.rb b/lib/sisu/v3/dal_expand_insertions.rb index 0f925bc0..e6b586aa 100644 --- a/lib/sisu/v3/dal_expand_insertions.rb +++ b/lib/sisu/v3/dal_expand_insertions.rb @@ -131,58 +131,41 @@ module SiSU_insertions output_filetypes=output_filetypes_in_cmd(cmd,source) output_filetypes[:gen].each do |o_f| describe = case o_f - when /sisu_manifest.html/; '~^ document manifest' - when /toc.html/; ' html, segmented text' - when /doc.html/; ' html, scroll, document in one' - when /\.epub/; ' epub' - when /landscape.pdf/; ' pdf, landscape' - when /portrait.pdf/; ' pdf, portrait' - when /opendocument.odt/; ' odf:odt, open document text' - when /scroll.xhtml/; ' xhtml scroll' - when /sax.xml/; ' xml, sax' - when /dom.xml/; ' xml, dom' - when /plain.txt/; ' plain text utf-8' - #when /manpage.1/; ' man, 1' - when /wiki.txt/; ' wiki text' - when /concordance.html/; ' concordance' - when /digest.txt/; ' dcc, document content certificate (digests)' + when /sisu_manifest.html/; "~^ { document manifest }#{@md.file.output_path.manifest.url}/#{@md.file.base_filename.manifest}" + when /toc.html/; " { html, segmented text }#{@md.file.output_path.html_seg.url}/#{@md.file.base_filename.html_segtoc}" + when /doc.html/; " { html, scroll, document in one }#{@md.file.output_path.html_scroll.url}/#{@md.file.base_filename.html_scroll}" + when /\.epub/; " { epub }#{@md.file.output_path.epub.url}/#{@md.file.base_filename.epub}" + when /landscape.pdf/; " { pdf, landscape }#{@md.file.output_path.pdf.url}/#{@md.file.base_filename.pdf_l_a4}" #chose a default pdf + when /portrait.pdf/; " { pdf, portrait }#{@md.file.output_path.pdf.url}/#{@md.file.base_filename.pdf_p_a4}" #chose a default pdf + when /opendocument.odt/; " { odf:odt, open document text }#{@md.file.output_path.odt.url}/#{@md.file.base_filename.odt}" + when /scroll.xhtml/; " { xhtml scroll }#{@md.file.output_path.xhtml.url}/#{@md.file.base_filename.xhtml}" + when /sax.xml/; " { xml, sax }#{@md.file.output_path.xml_sax.url}/#{@md.file.base_filename.xml_sax}" + when /dom.xml/; " { xml, dom }#{@md.file.output_path.xml_dom.url}/#{@md.file.base_filename.xml_dom}" + when /plain.txt/; " { plain text utf-8 }#{@md.file.output_path.txt.url}/#{@md.file.base_filename.txt}" + #when /manpage.1/; " man, 1" + when /concordance.html/; " { concordance }#{@md.file.output_path.html_concordance.url}/#{@md.file.base_filename.html_concordance}" + when /digest.txt/; " { dcc, document content certificate (digests) }#{@md.file.output_path.hash_digest.url}/#{@md.file.base_filename.hash_digest}" else nil end if describe tuned_file_tmp << if @u.remote #to double space <:br> at beginning of entry - if describe =~/epub/ - "#{Mx[:nbsp]*4} { #{describe} }#{@u.remote}/epub/#{url_dir}#{o_f} " - elsif describe =~/^~\^ / - "#{Mx[:nbsp]*4} {#{describe} }#{@u.remote}/#{url_dir}/#{o_f} " - else "#{Mx[:nbsp]*4} { #{describe} }#{@u.remote}/#{url_dir}/#{o_f} " - end - else - if describe =~/epub/ - "#{Mx[:nbsp]*4} { #{describe} }../epub/#{url_dir}#{o_f} " - elsif describe =~/^~\^ / - "#{Mx[:nbsp]*4} {#{describe} }../#{url_dir}/#{o_f} " - else "#{Mx[:nbsp]*4} { #{describe} }../#{url_dir}/#{o_f} " - end + "#{Mx[:nbsp]*4} #{describe} " + else # remove ... + "[provide document placement host location]" end end end output_filetypes[:src].each do |o_f| describe=case o_f - when /#{source}\.zip/; ' markup source (zipped) pod' - when /#{source}/; ' markup source text' + when /#{source}\.zip/; " { markup source (zipped) pod }#{@md.file.output_path.sisupod.url}/#{@md.file.base_filename.sisupod}" + when /#{source}/; " { markup source text }#{@md.file.output_path.src.url}/#{@md.file.base_filename.src}" else nil end if describe tuned_file_tmp << if @u.remote - x=if describe =~/zip/ - "#{Mx[:nbsp]*4} {#{describe} }#{@u.src_pod}/#{o_f} " - else "#{Mx[:nbsp]*4} {#{describe} }#{@u.src_txt}/#{o_f} " - end + "#{Mx[:nbsp]*4} #{describe} " else - x=if describe =~/zip/ - "#{Mx[:nbsp]*4} { #{describe} }../pod/#{o_f} " - else "#{Mx[:nbsp]*4} { #{describe} }../zip/#{o_f} " - end + "[provide document placement host location]" end end end diff --git a/lib/sisu/v3/digests.rb b/lib/sisu/v3/digests.rb index e7b303ba..8f89bbe3 100644 --- a/lib/sisu/v3/digests.rb +++ b/lib/sisu/v3/digests.rb @@ -76,12 +76,12 @@ module SiSU_Digest_view @env,@md,@dal_array=@particulars.env,@particulars.md,@particulars.dal_array unless @opt.cmd =~/q/ tool=(@opt.cmd =~/[MVv]/) \ - ? "#{@env.program.text_editor} file://#{@md.file.output_path.hash_digest}/#{@md.file.base_filename.hash_digest}" \ + ? "#{@env.program.text_editor} file://#{@md.file.output_path.hash_digest.dir}/#{@md.file.base_filename.hash_digest}" \ : @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 - SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"file://#{@md.file.output_path.hash_digest}/#{@md.file.base_filename.hash_digest}").flow if @opt.cmd =~/[MV]/ + SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"file://#{@md.file.output_path.hash_digest.dir}/#{@md.file.base_filename.hash_digest}").flow if @opt.cmd =~/[MV]/ end SiSU_Digest_view::Source::Scroll.new(@particulars).songsheet SiSU_Env::Info_skin.new(@md).select diff --git a/lib/sisu/v3/epub.rb b/lib/sisu/v3/epub.rb index 8b2b2d1d..422c1e68 100644 --- a/lib/sisu/v3/epub.rb +++ b/lib/sisu/v3/epub.rb @@ -85,13 +85,13 @@ module SiSU_EPUB @env=@particulars.env loc=@env.path.url.output_tell unless @opt.cmd =~/q/ - tool=if @opt.cmd =~/[MVvz]/; "#{@env.program.epub_viewer} #{@md.file.output_path.epub}/#{@md.file.base_filename.epub}" + tool=if @opt.cmd =~/[MVvz]/; "#{@env.program.epub_viewer} #{@md.file.output_path.epub.dir}/#{@md.file.base_filename.epub}" else @opt.fns end @opt.cmd=~/[MVvz]/ \ ? SiSU_Screen::Ansi.new(@opt.cmd,'EPUB',tool).green_hi_blue \ : SiSU_Screen::Ansi.new(@opt.cmd,'EPUB',tool).green_title_hi - SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@md.file.output_path.epub}/#{@md.file.base_filename.epub}").flow if @opt.cmd =~/[MV]/ + SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@md.file.output_path.epub.dir}/#{@md.file.base_filename.epub}").flow if @opt.cmd =~/[MV]/ end @env.processing_path.epub_bld #(@md) @env.processing_path.epub_cp_images(@md) @@ -639,11 +639,11 @@ module SiSU_EPUB SiSU_EPUB_Concordance::Source.new(@md.opt).read end def output_zip - mkdir_p(@md.file.output_path.epub) unless FileTest.directory?(@md.file.output_path.epub) + mkdir_p(@md.file.output_path.epub.dir) unless FileTest.directory?(@md.file.output_path.epub.dir) system(" cd #{@md.env.processing_path.epub} zip -qXr9D #{@epub_doc} * - mv #{@epub_doc} #{@md.file.place_file.epub} + mv #{@epub_doc} #{@md.file.place_file.epub.dir} cd #{Dir.pwd} ") unless @md.opt.cmd.inspect =~/M/ diff --git a/lib/sisu/v3/html.rb b/lib/sisu/v3/html.rb index 5c044594..8d10b7da 100644 --- a/lib/sisu/v3/html.rb +++ b/lib/sisu/v3/html.rb @@ -87,13 +87,13 @@ module SiSU_HTML @env=@particulars.env 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}/#{@md.file.base_filename.html_segtoc}" + 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 end @opt.cmd=~/[MVvz]/ \ ? SiSU_Screen::Ansi.new(@opt.cmd,'HTML',tool).green_hi_blue \ : SiSU_Screen::Ansi.new(@opt.cmd,'HTML',tool).green_title_hi - SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"file://#{@md.file.output_path.html_seg}/#{@md.file.base_filename.html_segtoc}").flow if @opt.cmd =~/[MV]/ + SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"file://#{@md.file.output_path.html_seg.dir}/#{@md.file.base_filename.html_segtoc}").flow if @opt.cmd =~/[MV]/ end SiSU_Env::Info_skin.new(@md).select data=nil diff --git a/lib/sisu/v3/html_segments.rb b/lib/sisu/v3/html_segments.rb index 2ac89805..fb9b01cb 100644 --- a/lib/sisu/v3/html_segments.rb +++ b/lib/sisu/v3/html_segments.rb @@ -233,11 +233,11 @@ module SiSU_HTML_seg dirout=SiSU_Env::Info_env.new(@md.fns) dir_sisu=dirout.path.output @file=SiSU_Env::SiSU_file.new(@md) - unless FileTest.directory?(@file.output_path.html_seg) - mkdir_p(@file.output_path.html_seg) if File.writable?("#{@file.output_path.base}/.") + unless FileTest.directory?(@file.output_path.html_seg.dir) + mkdir_p(@file.output_path.html_seg.dir) if File.writable?("#{@file.output_path.base.dir}/.") end Seg.new(@md).tail - segfilename="#{@file.output_path.html_seg}/#{@md.fnl[:pre]}#{@@seg_name_html[tracking-1]}#{@md.fnl[:mid]}#{Sfx[:html]}#{@md.fnl[:post]}" + segfilename="#{@file.output_path.html_seg.dir}/#{@md.fnl[:pre]}#{@@seg_name_html[tracking-1]}#{@md.fnl[:mid]}#{Sfx[:html]}#{@md.fnl[:post]}" output_seg_file=File.new(segfilename,'w') if @@seg_name_html[tracking-1] minitoc=(@env.html_minitoc?) \ ? @minitoc \ diff --git a/lib/sisu/v3/manifest.rb b/lib/sisu/v3/manifest.rb index 4373ad26..90f8df55 100644 --- a/lib/sisu/v3/manifest.rb +++ b/lib/sisu/v3/manifest.rb @@ -84,7 +84,7 @@ module SiSU_Manifest browser=@env.program.console_web_browser # webserv_url=@env.path.url.output_tell #fix in sysenv unless @opt.cmd =~/q/ - url_html="file://#{@md.file.output_path.manifest}/#{@md.file.base_filename.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 @@ -105,7 +105,7 @@ module SiSU_Manifest @env=SiSU_Env::Info_env.new(@md.fns) @fnb=@md.fnb @base_url="#{@env.url.root}/#{@fnb}" - @base_path=@md.file.output_path.manifest + @base_path=@md.file.output_path.manifest.dir @@dg ||=SiSU_Env::Info_env.new.digest.type @dg=@@dg l=SiSU_Env::Standardise_language.new(@md.opt.lng).language @@ -121,17 +121,17 @@ module SiSU_Manifest manifest << x end end - def summarize(id,file,pth='',img='● ') + def summarize(id,file,pth='',url='',img='● ') 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] << %{

#{img}#{id}

#{file}

#{@brace_url.xml_open}#{@base_url}/#{file}#{@brace_url.xml_close}

#{kb}

\n} + @manifest[:html] << %{

#{img}#{id}

#{file}

#{@brace_url.xml_open}#{url}/#{file}#{@brace_url.xml_close}

#{kb}

\n} end - def summarize_html_seg(id,file,pth='',img='● ') + def summarize_html_seg(id,file,pth='',url='',img='● ') 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] << %{

#{img}#{id}

#{file}

#{@brace_url.xml_open}#{@base_url}/#{file}#{@brace_url.xml_close}

#{kb}

\n} + @manifest[:html] << %{

#{img}#{id}

#{file}

#{@brace_url.xml_open}#{url}/#{file}#{@brace_url.xml_close}

#{kb}

\n} end def summarize_sources(id,file,pth,url) sys=SiSU_Env::System_call.new @@ -175,143 +175,163 @@ module SiSU_Manifest @manifest[:html] << %{

#{lnk}

  #{@brace_url.xml_open}#{static}#{@brace_url.xml_close}

\n} end def output_tests - if FileTest.file?(@md.file.place_file.html_segtoc)==true + if FileTest.file?(@md.file.place_file.html_segtoc.dir)==true img=%{TOC linked } - pth=@md.file.output_path.html_seg + pth=@md.file.output_path.html_seg.dir + url=@md.file.output_path.html_seg.url id,file='HTML, table of contents (for segmented text)',@md.file.base_filename.html_segtoc - summarize_html_seg(id,file,pth,img) + summarize_html_seg(id,file,pth,url,img) end - if FileTest.file?(@md.file.place_file.html_scroll)==true + if FileTest.file?(@md.file.place_file.html_scroll.dir)==true img=%{Full Text } - pth=@md.file.output_path.html_scroll + pth=@md.file.output_path.html_scroll.dir + url=@md.file.output_path.html_scroll.url id,file='HTML, full length document',@md.file.base_filename.html_scroll - summarize(id,file,pth,img) + summarize(id,file,pth,url,img) end - if FileTest.file?(@md.file.place_file.html_book_index)==true - pth=@md.file.output_path.html_seg + if FileTest.file?(@md.file.place_file.html_book_index.dir)==true + pth=@md.file.output_path.html_seg.dir + url=@md.file.output_path.html_seg.url id,file='HTML, (book type) index',@md.file.base_filename.html_book_index - summarize(id,file,pth) + summarize(id,file,pth,url) end - if FileTest.file?(@md.file.place_file.html_concordance)==true - pth=@md.file.output_path.html_seg + if FileTest.file?(@md.file.place_file.html_concordance.dir)==true + pth=@md.file.output_path.html_seg.dir + url=@md.file.output_path.html_seg.url id,file='HTML, concordance file',@md.file.base_filename.html_concordance - summarize(id,file,pth) + summarize(id,file,pth,url) end - if FileTest.file?(@md.file.place_file.epub)==true + if FileTest.file?(@md.file.place_file.epub.dir)==true img=%{EPUB } id,file='EPUB (Electronic Publication, e-book standard)',@md.file.base_filename.epub - pth=@md.file.output_path.epub - summarize(id,file,pth,img) + pth=@md.file.output_path.epub.dir + url=@md.file.output_path.epub.url + summarize(id,file,pth,url,img) end - if FileTest.file?("#{@md.file.output_path.pdf}/#{@md.file.base_filename.pdf_p_letter}")==true + if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_p_letter}")==true img=%{PDF portrait } - pth=@md.file.output_path.pdf + pth=@md.file.output_path.pdf.dir + url=@md.file.output_path.pdf.url id,file="PDF, U.S. letter size, portrait/vertical document (recommended for printing)","#{@md.file.base_filename.pdf_p_letter}" - summarize(id,file,pth,img) + summarize(id,file,pth,url,img) end - if FileTest.file?("#{@md.file.output_path.pdf}/#{@md.file.base_filename.pdf_l_letter}")==true + if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_l_letter}")==true img=%{PDF landscape } - pth=@md.file.output_path.pdf + pth=@md.file.output_path.pdf.dir + url=@md.file.output_path.pdf.url id,file="PDF, U.S. letter size, landscape/horizontal document (recommended for screen viewing)","#{@md.file.base_filename.pdf_l_letter}" - summarize(id,file,pth,img) + summarize(id,file,pth,url,img) end - if FileTest.file?("#{@md.file.output_path.pdf}/#{@md.file.base_filename.pdf_p_a4}")==true + if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_p_a4}")==true img=%{PDF portrait } - pth=@md.file.output_path.pdf + pth=@md.file.output_path.pdf.dir + url=@md.file.output_path.pdf.url id,file="PDF, A4 size, portrait/vertical document (recommended for printing)","#{@md.file.base_filename.pdf_p_a4}" - summarize(id,file,pth,img) + summarize(id,file,pth,url,img) end - if FileTest.file?("#{@md.file.output_path.pdf}/#{@md.file.base_filename.pdf_l_a4}")==true + if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_l_a4}")==true img=%{PDF landscape } - pth=@md.file.output_path.pdf + pth=@md.file.output_path.pdf.dir + url=@md.file.output_path.pdf.url id,file="PDF, A4 size, landscape/horizontal document (recommended for screen viewing)","#{@md.file.base_filename.pdf_l_a4}" - summarize(id,file,pth,img) + summarize(id,file,pth,url,img) end - if FileTest.file?("#{@md.file.output_path.pdf}/#{@md.file.base_filename.pdf_p_a5}")==true + if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_p_a5}")==true img=%{PDF portrait } - pth=@md.file.output_path.pdf + pth=@md.file.output_path.pdf.dir + url=@md.file.output_path.pdf.url id,file="PDF, A5 (book) size, portrait/vertical document (recommended for printing)","#{@md.file.base_filename.pdf_p_a5}" - summarize(id,file,pth,img) + summarize(id,file,pth,url,img) end - if FileTest.file?("#{@md.file.output_path.pdf}/#{@md.file.base_filename.pdf_l_a5}")==true + if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_l_a5}")==true img=%{PDF landscape } - pth=@md.file.output_path.pdf + pth=@md.file.output_path.pdf.dir + url=@md.file.output_path.pdf.url id,file="PDF, A5 (book) size, landscape/horizontal document (recommended for screen viewing)","#{@md.file.base_filename.pdf_l_a5}" - summarize(id,file,pth,img) + summarize(id,file,pth,url,img) end - if FileTest.file?("#{@md.file.output_path.pdf}/#{@md.file.base_filename.pdf_p_b5}")==true + if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_p_b5}")==true img=%{PDF portrait } - pth=@md.file.output_path.pdf + pth=@md.file.output_path.pdf.dir + url=@md.file.output_path.pdf.url id,file="PDF, B5 (book) size, portrait/vertical document (recommended for printing)","#{@md.file.base_filename.pdf_p_b5}" - summarize(id,file,pth,img) + summarize(id,file,pth,url,img) end - if FileTest.file?("#{@md.file.output_path.pdf}/#{@md.file.base_filename.pdf_l_b5}")==true + if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_l_b5}")==true img=%{PDF landscape } - pth=@md.file.output_path.pdf + pth=@md.file.output_path.pdf.dir + url=@md.file.output_path.pdf.url id,file="PDF, B5 (book) size, landscape/horizontal document (recommended for screen viewing)","#{@md.file.base_filename.pdf_l_b5}" - summarize(id,file,pth,img) + summarize(id,file,pth,url,img) end - if FileTest.file?("#{@md.file.output_path.pdf}/#{@md.file.base_filename.pdf_p_legal}")==true + if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_p_legal}")==true img=%{PDF portrait } - pth=@md.file.output_path.pdf + pth=@md.file.output_path.pdf.dir + url=@md.file.output_path.pdf.url id,file="PDF, U.S. legal size, portrait/vertical document (recommended for printing)","#{@md.file.base_filename.pdf_p_legal}" - summarize(id,file,pth,img) + summarize(id,file,pth,url,img) end - if FileTest.file?("#{@md.file.output_path.pdf}/#{@md.file.base_filename.pdf_l_legal}")==true + if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_l_legal}")==true img=%{PDF landscape } - pth=@md.file.output_path.pdf + pth=@md.file.output_path.pdf.dir + url=@md.file.output_path.pdf.url id,file="PDF, U.S. legal size, landscape/horizontal document (recommended for screen viewing)","#{@md.file.base_filename.pdf_l_legal}" - summarize(id,file,pth,img) + summarize(id,file,pth,url,img) end - if FileTest.file?(@md.file.place_file.odt)==true + if FileTest.file?(@md.file.place_file.odt.dir)==true img=%{ODF/ODT } - pth=@md.file.output_path.odt + pth=@md.file.output_path.odt.dir + url=@md.file.output_path.odf.url id,file='ODF:ODT (Open Document Format)',@md.file.base_filename.odt - summarize(id,file,pth,img) + summarize(id,file,pth,url,img) end - if FileTest.file?(@md.file.place_file.xhtml)==true - pth=@md.file.output_path.xhtml + if FileTest.file?(@md.file.place_file.xhtml.dir)==true + pth=@md.file.output_path.xhtml.dir + url=@md.file.output_path.xhtml.url + id,file='ODF:ODT (Open Document Format)',@md.file.base_filename.odt id,file='XHTML',@md.file.base_filename.xhtml - summarize(id,file,pth) + summarize(id,file,pth,url) end - if FileTest.file?(@md.file.place_file.xml_sax)==true - pth=@md.file.output_path.xml_sax + if FileTest.file?(@md.file.place_file.xml_sax.dir)==true + pth=@md.file.output_path.xml_sax.dir + url=@md.file.output_path.xml_sax.url id,file='XML SAX',@md.file.base_filename.xml_sax - summarize(id,file,pth) + summarize(id,file,pth,url) end - if FileTest.file?(@md.file.place_file.xml_dom)==true - pth=@md.file.output_path.xml_dom + if FileTest.file?(@md.file.place_file.xml_dom.dir)==true + pth=@md.file.output_path.xml_dom.dir + url=@md.file.output_path.xml_dom.url id,file='XML DOM',@md.file.base_filename.xml_dom - summarize(id,file,pth) + summarize(id,file,pth,url) end - if FileTest.file?(@md.file.place_file.txt)==true + if FileTest.file?(@md.file.place_file.txt.dir)==true if @md.opt.cmd =~/a/; id='Plaintext (Unix (UTF-8) with footnotes)' elsif @md.opt.cmd =~/e/; id='Plaintext (Unix (UTF-8) with endnotes)' elsif @md.opt.cmd =~/A/; id='Plaintext (dos (UTF-8) with footnotes)' elsif @md.opt.cmd =~/E/; id='Plaintext (dos (UTF-8) with endnotes)' else id='Plaintext (UTF-8)' end - pth=@md.file.output_path.txt + pth=@md.file.output_path.txt.dir + url=@md.file.output_path.txt.url file=@md.file.base_filename.txt - summarize(id,file,pth) + summarize(id,file,pth,url) end if FileTest.file?("#{@base_path}/#{@md.fns}.tex")==true id,file='LaTeX (portrait)',"#{@md.fns}.tex" - #pth=@base_path - pth='' - summarize(id,file,pth) + pth,url='','' + summarize(id,file,pth,url) end if FileTest.file?("#{@base_path}/#{@md.fns}.tex")==true id,file='LaTeX (landscape)',"#{@md.fns}.landscape.tex" - #pth=@base_path - pth='' - summarize(id,file,pth) + pth,url='','' + summarize(id,file,pth,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 + url='' #pth='' - summarize(id,file,pth) + summarize(id,file,pth,url) end end def published_versions @@ -321,7 +341,7 @@ module SiSU_Manifest end end def language_versions - if FileTest.file?(@md.file.place_file.manifest)==true + if FileTest.file?(@md.file.place_file.manifest.dir)==true id,file='Markup (SiSU source)',@md.fns published_languages(id,file) end @@ -329,29 +349,29 @@ module SiSU_Manifest def source_tests if @md.fns =~/\.ssm\.sst$/ #% decide whether to extract and include requested/required documents req=@md.fns - if FileTest.file?(@md.file.place_file.src)==true - pth=@md.file.output_path.src - url=@env.url.src_txt + if FileTest.file?(@md.file.place_file.src.dir)==true + pth=@md.file.output_path.src.dir + url=@md.file.output_path.src.url id,file='Markup Composite File (SiSU source)',@md.file.base_filename.src - summarize_sources(id,file,pth,url,url) + summarize_sources(id,file,pth,url) end else - if FileTest.file?(@md.file.place_file.src)==true - pth=@md.file.output_path.src - url=@env.url.src_txt + if FileTest.file?(@md.file.place_file.src.dir)==true + pth=@md.file.output_path.src.dir + url=@md.file.output_path.src.url id,file='Markup (SiSU source)',@md.file.base_filename.src summarize_sources(id,file,pth,url) end end - if FileTest.file?(@md.file.place_file.sisupod)==true - pth=@md.file.output_path.sisupod - url=@env.url.src_pod + if FileTest.file?(@md.file.place_file.sisupod.dir)==true + pth=@md.file.output_path.sisupod.dir + url=@md.file.output_path.sisupod.url id,file='SiSU doc (zip)',@md.file.base_filename.sisupod summarize_sources(id,file,pth,url) end - if FileTest.file?(@md.file.place_file.pot)==true - pth=@md.file.output_path.pot - url=@env.url.pot + if FileTest.file?(@md.file.place_file.pot.dir)==true + pth=@md.file.output_path.pot.dir + url=@md.file.output_path.pot.url id,file='SiSU pot',@md.file.base_filename.pot summarize_sources(id,file,pth,url) end diff --git a/lib/sisu/v3/odf.rb b/lib/sisu/v3/odf.rb index 81344d4c..a223600e 100644 --- a/lib/sisu/v3/odf.rb +++ b/lib/sisu/v3/odf.rb @@ -84,12 +84,12 @@ module SiSU_ODF @env.odf_structure unless @opt.cmd =~/q/ tool=(@opt.cmd =~/[MVv]/) \ - ? "#{@env.program.odf_viewer} file://#{@md.file.output_path.odt}/#{@md.file.base_filename.odt}" \ + ? "#{@env.program.odf_viewer} file://#{@md.file.output_path.odt.dir}/#{@md.file.base_filename.odt}" \ : @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 - SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"file://#{@md.file.output_path.odt}/#{@md.file.base_filename.odt}").flow if @opt.cmd =~/[MV]/ + SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"file://#{@md.file.output_path.odt.dir}/#{@md.file.base_filename.odt}").flow if @opt.cmd =~/[MV]/ end SiSU_ODF::Source::Scroll.new(@particulars).songsheet SiSU_Env::Info_skin.new(@md).select @@ -699,7 +699,7 @@ module SiSU_ODF env=SiSU_Env::SiSU_file.new(@md) env.mkdir env.make_path(@env.processing_path.odt) - env.make_path(@md.file.output_path.odt) + env.make_path(@md.file.output_path.odt.dir) filename="#{@env.processing_path.odt}/content.xml" od=File.new(filename,'w+') @content.each do |para| # this is a hack @@ -707,11 +707,11 @@ module SiSU_ODF end od.close opendoc=@md.fn[:odf] - mkdir_p(@md.file.output_path.odt) unless FileTest.directory?(@md.file.output_path.odt) + mkdir_p(@md.file.output_path.odt.dir) unless FileTest.directory?(@md.file.output_path.odt.dir) system(" cd #{@env.processing_path.odf} zip -qr #{opendoc} * - mv #{opendoc} #{@md.file.place_file.odt} + mv #{opendoc} #{@md.file.place_file.odt.dir} cd #{Dir.pwd} ") end diff --git a/lib/sisu/v3/plaintext.rb b/lib/sisu/v3/plaintext.rb index 74de7a0e..09ecf56c 100644 --- a/lib/sisu/v3/plaintext.rb +++ b/lib/sisu/v3/plaintext.rb @@ -84,12 +84,12 @@ module SiSU_Plaintext unless @opt.cmd =~/q/ path=env.path.output_tell tool=(@opt.cmd =~/[MVv]/) \ - ? "#{env.program.text_editor} #{md.file.output_path.txt}/#{md.file.base_filename.txt}" \ + ? "#{env.program.text_editor} #{md.file.output_path.txt.dir}/#{md.file.base_filename.txt}" \ : @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 - SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{md.file.output_path.txt}/#{md.file.base_filename.txt}").flow if @opt.cmd =~/[MV]/ + SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{md.file.output_path.txt.dir}/#{md.file.base_filename.txt}").flow if @opt.cmd =~/[MV]/ end dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here wrap_width=if defined? md.make.plaintext_wrap \ diff --git a/lib/sisu/v3/po4a.rb b/lib/sisu/v3/po4a.rb index d65191e0..880bda98 100644 --- a/lib/sisu/v3/po4a.rb +++ b/lib/sisu/v3/po4a.rb @@ -948,9 +948,9 @@ GSUB git=SiSU_Git::Source.new(@md.opt) git.create_file_structure_git unless FileTest.directory?(@file.output_path.pot_git) if @md.opt.f_pth[:lng] =='en' - cp(@file.place_file.pot, @file.output_path.pot_git) + cp(@file.place_file.pot.dir, @file.output_path.pot_git) else # naive, work on --> - cp(@file.place_file.po, @file.output_path.po_git) #unless FileTest.file?(@file.place_file.po_git) + cp(@file.place_file.po.dir, @file.output_path.po_git) #unless FileTest.file?(@file.place_file.po_git.dir) end git.read end diff --git a/lib/sisu/v3/share_src.rb b/lib/sisu/v3/share_src.rb index 5a31f368..f1703b37 100644 --- a/lib/sisu/v3/share_src.rb +++ b/lib/sisu/v3/share_src.rb @@ -75,20 +75,20 @@ module SiSU_Markup @opt.cmd=~/[MVvz]/ \ ? SiSU_Screen::Ansi.new(@opt.cmd,'Share Document Source!',@opt.fns).green_hi_blue \ : SiSU_Screen::Ansi.new(@opt.cmd,'Share Document Source!',@opt.fns).green_title_hi - SiSU_Screen::Ansi.new(@opt.cmd,"Copy sisu markup file to output directory","#{@opt.fns} -> #{@file.output_path.src}").warn if @opt.cmd =~/[MVv]/ + SiSU_Screen::Ansi.new(@opt.cmd,"Copy sisu markup file to output directory","#{@opt.fns} -> #{@file.output_path.src.dir}").warn if @opt.cmd =~/[MVv]/ end - mkdir_p(@file.output_path.src) unless FileTest.directory?(@file.output_path.src) - if FileTest.directory?(@file.output_path.src) - unless @opt.fns =~/\.ssm$/; cp(@opt.fns,@file.output_path.src) + mkdir_p(@file.output_path.src.dir) unless FileTest.directory?(@file.output_path.src.dir) + if FileTest.directory?(@file.output_path.src.dir) + unless @opt.fns =~/\.ssm$/; cp(@opt.fns,@file.output_path.src.dir) else req=@opt.fns.gsub(/(.+?\.ssm)$/,'\1.sst') file="#{@env.processing_path.composite_file}/#{@opt.fnb}.ssm.sst" - if FileTest.file?(file); cp(file,"#{@file.output_path.src}/#{req}") + if FileTest.file?(file); cp(file,"#{@file.output_path.src.dir}/#{req}") else print "did not find #{file} to copy" end end else - SiSU_Screen::Ansi.new(@opt.cmd,"Output directory does not exist","#{@opt.fns} -> #{@file.output_path.src}").warn if @opt.cmd =~/[MVv]/ + SiSU_Screen::Ansi.new(@opt.cmd,"Output directory does not exist","#{@opt.fns} -> #{@file.output_path.src.dir}").warn if @opt.cmd =~/[MVv]/ exit end end diff --git a/lib/sisu/v3/sisupod_make.rb b/lib/sisu/v3/sisupod_make.rb index 21255bb7..f54f43d9 100644 --- a/lib/sisu/v3/sisupod_make.rb +++ b/lib/sisu/v3/sisupod_make.rb @@ -77,7 +77,7 @@ module SiSU_Doc end @particulars=SiSU_Particulars::Combined_singleton.instance.get_all(opt) @file=@particulars.file - @local_path="#{@file.output_path.sisupod}" #@local_path="#{@env.path.output}/#{@env.fnb}" + @local_path="#{@file.output_path.sisupod.dir}" #@local_path="#{@env.path.output}/#{@env.fnb}" @zipfile=if @opt.fns =~/\.ssm\.sst$/; @opt.fns.gsub(/(?:\~\S{2,3})?\.ssm\.sst$/,'.ssm') else @opt.fns.gsub(/(?:\~\S{2,3})?(\.sst)$/,'\1') end @@ -92,7 +92,7 @@ module SiSU_Doc end unless @opt.fns.empty? unless @opt.cmd =~/q/ - SiSU_Screen::Ansi.new(@opt.cmd,'Make sisu document (zip) and place in output directory',"#{@opt.fns} -> file://#{@file.output_path.sisupod}/#{@zipfile}.zip").warn if @opt.cmd =~/[MVv]/ + SiSU_Screen::Ansi.new(@opt.cmd,'Make sisu document (zip) and place in output directory',"#{@opt.fns} -> file://#{@file.output_path.sisupod.dir}/#{@zipfile}.zip").warn if @opt.cmd =~/[MVv]/ end directories sisupod_build @@ -266,7 +266,7 @@ module SiSU_Doc end #NB not all possibilies met, revisit, also in case of composite file may wish to add README end def sisupod_7zip #look at later - mkdir_p(@file.output_path.sisupod) unless FileTest.directory?(@file.output_path.sisupod) + mkdir_p(@file.output_path.sisupod.dir) unless FileTest.directory?(@file.output_path.sisupod.dir) system(%{ cd #{@env.processing_path.processing} echo "SiSU sisupod #{@ver[:version]}" > sisu_zip.txt @@ -274,19 +274,19 @@ module SiSU_Doc 7zr a -t7z -m0=lzma -mx=9 -ms=on #{@zipfile}.7z sisu_zip.txt 7zr a -t7z -m0=lzma -mx=9 -ms=on #{@zipfile}.7z sisupod #7zip -qr #{@zipfile}.7z sisupod - mv #{@zipfile}.7z #{@file.place_file.sisupod} & + mv #{@zipfile}.7z #{@file.place_file.sisupod.dir} & rm -r sisupod/* && cd #{@env.path.pwd} }) SiSU_Screen::Ansi.new('',"#{@opt.fns}.7z").blue_tab unless @opt.cmd =~/q/ end def sisupod_zip - mkdir_p(@file.output_path.sisupod) unless FileTest.directory?(@file.output_path.sisupod) + mkdir_p(@file.output_path.sisupod.dir) unless FileTest.directory?(@file.output_path.sisupod.dir) system(%{ cd #{@env.processing_path.processing} echo "SiSU sisupod #{@ver[:version]}" > sisu_zip.txt zip -qz #{@zipfile}.zip sisu_zip.txt < sisu_zip.txt zip -qr #{@zipfile}.zip sisupod - mv #{@zipfile}.zip #{@file.place_file.sisupod} & + mv #{@zipfile}.zip #{@file.place_file.sisupod.dir} & rm -r sisupod/* && cd #{@env.path.pwd} }) SiSU_Screen::Ansi.new('',"#{@zipfile}.zip").blue_tab if @opt.cmd =~/[MVv]/ diff --git a/lib/sisu/v3/sitemaps.rb b/lib/sisu/v3/sitemaps.rb index c306ee99..1b7847da 100644 --- a/lib/sisu/v3/sitemaps.rb +++ b/lib/sisu/v3/sitemaps.rb @@ -103,9 +103,9 @@ module SiSU_Sitemaps end end def output_map(sitemap) - path=@md.file.output_path.sitemaps + path=@md.file.output_path.sitemaps.dir filename=@fn[:sitemap] - touch_path=@md.file.output_path.sitemaps + touch_path=@md.file.output_path.sitemaps.dir touch_filename=@fn[:sitemap_touch] SiSU_Env::SiSU_file.new(@md).make_path(path) file=SiSU_Env::SiSU_file.new(@md).make_file(path,filename) diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb index 6d010c76..29bfa8af 100644 --- a/lib/sisu/v3/sysenv.rb +++ b/lib/sisu/v3/sysenv.rb @@ -769,11 +769,12 @@ module SiSU_Env def scp program='scp' puts "scp -Cr #{@input} #{@output}" if @cmd =~/[vVM]/ - (program_found?(program)) \ - ? system("scp -Cr #{@input} #{@output}") \ - : (puts "\tWARN: #{program} not found" ) + puts "scp disabled" + #(program_found?(program)) \ + #? system("scp -Cr #{@input} #{@output}") \ + #: (puts "\tWARN: #{program} not found" ) end - def rsync(action='') + def rsync(action='',chdir='.') program='rsync' if program_found?(program) vb=if @cmd =~/q/; 'q' @@ -782,8 +783,12 @@ module SiSU_Env end msg='' msg=" && echo 'OK: #{@input} -> #{@output}'" unless @cmd =~/q/ - puts "rsync -az#{vb} #{action} #{@input} #{@output}" if @cmd =~/[vVM]/ - system("rsync -az#{vb} #{action} #{@input} #{@output} #{msg}") + puts "rsync -az#{vb} #{action} #{@input} #{@output}" if @cmd =~/[vVM]/ + system(" + cd #{chdir} + rsync -az#{vb} #{action} #{@input} #{@output} #{msg} + cd - + ") else puts "\tWARN: #{program} not found" end end @@ -2707,7 +2712,71 @@ WOK and @@flag_remote==true \ and @opt.cmd !~/U/ delete_extra_files='--delete' # '--delete-after' - System_call.new(local_gen,remote_gen,@opt.cmd).rsync(delete_extra_files) + inp=[] + begin + local_dirs=%{-f"+ */" -f"- *" #{@md.file.output_path.base.dir}/*} + System_call.new(local_dirs,remote_gen,@opt.cmd).rsync + rescue + local_dirs=%{--include='*/' --exclude='*' @md.file.output_path.base.dir} + System_call.new(local_dirs,remote_gen,@opt.cmd).rsync + end + if @opt.cmd =~/h/ \ + && FileTest.file?(@md.file.place_file.html_scroll.dir) + inp << @md.file.output_path.html_seg.rel << @md.file.place_file.html_scroll.rel + end + if @opt.cmd =~/w/ \ + && FileTest.file?(@md.file.place_file.html_concordance.dir) + inp << @md.file.place_file.html_concordance.rel + end + if @opt.cmd =~/e/ \ + && FileTest.file?(@md.file.place_file.epub.dir) + inp << @md.file.place_file.epub.rel + end + if @opt.cmd =~/o/ \ + && FileTest.file?(@md.file.place_file.odt.dir) + inp << @md.file.place_file.odt.rel + end + if @opt.cmd =~/b/ \ + && FileTest.file?(@md.file.place_file.xhtml.dir) + inp << @md.file.place_file.xhtml.rel + end + if @opt.cmd =~/x/ \ + && FileTest.file?(@md.file.place_file.xml_sax.dir) + inp << @md.file.place_file.xml_sax.rel + end + if @opt.cmd =~/X/ \ + && FileTest.file?(@md.file.place_file.xml_dom.dir) + inp << @md.file.place_file.xml_dom.rel + end + if @opt.cmd =~/[at]/ \ + && FileTest.file?(@md.file.place_file.txt.dir) + inp << @md.file.place_file.txt.rel + end + if @opt.cmd =~/N/ \ + && FileTest.file?(@md.file.place_file.hash_digest.dir) + inp << @md.file.place_file.hash_digest.rel + end + if @opt.cmd =~/s/ \ + && FileTest.file?(@md.file.place_file.src.dir) + inp << @md.file.place_file.src.rel + end + if @opt.cmd =~/S/ \ + && FileTest.file?(@md.file.place_file.sisupod.dir) + inp << @md.file.place_file.sisupod.rel + end + if @opt.cmd =~/p/ + inp << @md.file.output_path.pdf.rel + '/' + @opt.fnb + '*' + end + if @opt.cmd =~/y/ \ + && FileTest.file?(@md.file.place_file.manifest.dir) + inp << @md.file.place_file.manifest.rel + end + if inp.length > 0 + local_gen=inp.join(' ') + remote_rel=remote_conn[:name] + '/' + @md.file.output_path.stub.rcp + remote_rel='/home/ralph/tst' + System_call.new(local_gen,remote_rel,@opt.cmd).rsync('--relative',@md.file.output_path.base.dir) + end if FileTest.file?("#{local_src}/#{src_txt}") System_call.new("#{local_src}/#{src_txt}",remote_src,@opt.cmd).rsync if defined? @md.ec[:image] and not @md.ec[:image].empty? @@ -3072,23 +3141,23 @@ WOK self end def mkdir_initialize # not used but consider using - mkdir_p(output_path.base) unless FileTest.directory?(output_path.base) - mkdir_p("#{output_path.base}/#{@md.fnb}") unless FileTest.directory?("#{output_path.base}/#{@md.fnb}") - mkdir_p("#{output_path.base}/#{@env.path.style}") unless FileTest.directory?("#{output_path.base}/#{@env.path.style}") + mkdir_p(output_path.base.dir) unless FileTest.directory?(output_path.base.dir) + mkdir_p("#{output_path.base.dir}/#{@md.fnb}") unless FileTest.directory?("#{output_path.base.dir}/#{@md.fnb}") + mkdir_p("#{output_path.base.dir}/#{@env.path.style}") unless FileTest.directory?("#{output_path.base.dir}/#{@env.path.style}") mkdir_p(@env.processing_path.dal) unless FileTest.directory?(@env.processing_path.dal) mkdir_p(@env.processing_path.tune) unless FileTest.directory?(@env.processing_path.tune) end def mkdir - txt_path="#{output_path.base}/#{@md.fnb}" + txt_path="#{output_path.base.dir}/#{@md.fnb}" def output def base - mkdir_p(output_path.base) unless FileTest.directory?(output_path.base) + mkdir_p(output_path.base.dir) unless FileTest.directory?(output_path.base.dir) end def css - mkdir_p("#{output_path.base}/#{@env.path.style}") unless FileTest.directory?("#{output_path.base}/#{@env.path.style}") + mkdir_p("#{output_path.base.dir}/#{@env.path.style}") unless FileTest.directory?("#{output_path.base.dir}/#{@env.path.style}") end def epub - path=output_path.epub + path=output_path.epub.dir make_path(path) end self @@ -3096,7 +3165,7 @@ WOK self end def mkfile #consider using more - path="#{output_path.base}/#{@md.fnb}" + path="#{output_path.base.dir}/#{@md.fnb}" make_path(path) filename=@fno file=make_file(path,filename) @@ -3108,73 +3177,73 @@ WOK end def write_file def txt - path=output_path.txt + path=output_path.txt.dir make_path(path) fn=base_filename.txt make_file(path,fn) end def html_scroll - pth=output_path.html + pth=output_path.html.dir make_path(pth) - p_fn=place_file.html_scroll + p_fn=place_file.html_scroll.dir @@filename_html_scroll=File.new(p_fn,'w+') end def html_seg_index - pth,fn="#{output_path.html}/#{@md.fnb}",base_filename.html_seg_index + pth,fn="#{output_path.html.dir}/#{@md.fnb}",base_filename.html_seg_index make_path(pth) - p_fn=place_file.html_seg_index + p_fn=place_file.html_seg_index.dir @@filename_html_index=File.new(p_fn,'w+') end def html_segtoc - pth,fn="#{output_path.html}/#{@md.fnb}",base_filename.html_segtoc + pth,fn="#{output_path.html.dir}/#{@md.fnb}",base_filename.html_segtoc make_path(pth) - p_fn=place_file.html_segtoc + p_fn=place_file.html_segtoc.dir @@filename_html_index=File.new(p_fn,'w+') end def xhtml - path=output_path.xhtml + path=output_path.xhtml.dir make_path(path) fn=base_filename.xhtml file=make_file(path,fn) end def xml_sax - path=output_path.xml + path=output_path.xml.dir make_path(path) fn=base_filename.xml_sax file=make_file(path,fn) end def xml_dom - path=output_path.xml + path=output_path.xml.dir make_path(path) fn=base_filename.xml_dom file=make_file(path,fn) end def manpage - path=output_path.manpage + path=output_path.manpage.dir make_path(path) fn=base_filename.manpage file=make_file(path,fn) end def hash_digest - path=output_path.hash_digest + path=output_path.hash_digest.dir make_path(path) fn=base_filename.hash_digest file=make_file(path,fn) end def manifest - path=output_path.manifest + path=output_path.manifest.dir make_path(path) fn=base_filename.manifest make_file(path,fn) end def pot - path=output_path.pot + path=output_path.pot.dir make_path(path) fn=base_filename.pot make_file(path,fn) end def po - path=output_path.po + path=output_path.po.dir make_path(path) fn=base_filename.po make_file(path,fn) @@ -3183,28 +3252,76 @@ WOK end def place_file def txt - output_path.txt + '/' + base_filename.txt + def dir + output_path.txt.dir + '/' + base_filename.txt + end + def rel + output_path.txt.rel + '/' + base_filename.txt + end + self end def html_scroll - output_path.html_scroll + '/' + base_filename.html_scroll + def dir + output_path.html_scroll.dir + '/' + base_filename.html_scroll + end + def rel + output_path.html_scroll.rel + '/' + base_filename.html_scroll + end + self end def html_seg_index - output_path.html_seg + '/' + base_filename.html_seg_index + def dir + output_path.html_seg.dir + '/' + base_filename.html_seg_index + end + def rel + output_path.html_seg.rel + '/' + base_filename.html_seg_index + end + self end def html_segtoc - output_path.html_seg + '/' + base_filename.html_segtoc + def dir + output_path.html_seg.dir + '/' + base_filename.html_segtoc + end + def rel + output_path.html_seg.rel + '/' + base_filename.html_segtoc + end + self end def html_book_index - output_path.html_seg + '/' + base_filename.html_book_index + def dir + output_path.html_seg.dir + '/' + base_filename.html_book_index + end + def rel + output_path.html_seg.rel + '/' + base_filename.html_book_index + end + self end def html_concordance - output_path.html_seg + '/' + base_filename.html_concordance + def dir + output_path.html_seg.dir + '/' + base_filename.html_concordance + end + def rel + output_path.html_seg.rel + '/' + base_filename.html_concordance + end + self end def odt - output_path.odt + '/' + base_filename.odt + def dir + output_path.odt.dir + '/' + base_filename.odt + end + def rel + output_path.odt.rel + '/' + base_filename.odt + end + self end def epub - output_path.epub + '/' + base_filename.epub + def dir + output_path.epub.dir + '/' + base_filename.epub + end + def rel + output_path.epub.rel + '/' + base_filename.epub + end + self end def pdf_p puts 'ERROR not available due to multiple page format sizes' @@ -3213,37 +3330,103 @@ WOK puts 'ERROR not available due to multiple page format sizes' end def xhtml - output_path.xhtml + '/' + base_filename.xhtml + def dir + output_path.xhtml.dir + '/' + base_filename.xhtml + end + def rel + output_path.xhtml.rel + '/' + base_filename.xhtml + end + self end def xml_sax - output_path.xml + '/' + base_filename.xml_sax + def dir + output_path.xml.dir + '/' + base_filename.xml_sax + end + def rel + output_path.xml.rel + '/' + base_filename.xml_sax + end + self end def xml_dom - output_path.xml + '/' + base_filename.xml_dom + def dir + output_path.xml.dir + '/' + base_filename.xml_dom + end + def rel + output_path.xml.rel + '/' + base_filename.xml_dom + end + self end def hash_digest - output_path.hash_digest + '/' + base_filename.hash_digest + def dir + output_path.hash_digest.dir + '/' + base_filename.hash_digest + end + def rel + output_path.hash_digest.rel + '/' + base_filename.hash_digest + end + self end def src - output_path.src + '/' + base_filename.src + def dir + output_path.src.dir + '/' + base_filename.src + end + def rel + output_path.src.rel + '/' + base_filename.src + end + self end def sisupod - output_path.sisupod + '/' + base_filename.sisupod + def dir + output_path.sisupod.dir + '/' + base_filename.sisupod + end + def rel + output_path.sisupod.rel + '/' + base_filename.sisupod + end + self end def po - output_path.po + '/' + base_filename.po + def dir + output_path.po.dir + '/' + base_filename.po + end + def rel + output_path.po.rel + '/' + base_filename.po + end + self end def pot - output_path.pot + '/' + base_filename.pot + def dir + output_path.pot.dir + '/' + base_filename.pot + end + def rel + output_path.pot.rel + '/' + base_filename.pot + end + self end def po_git - output_path.po_git + '/' + base_filename.po + def dir + output_path.po_git + '/' + base_filename.po + end + def rel + #output_path.po_git + '/' + base_filename.po + end + self end def pot_git - output_path.pot_git + '/' + base_filename.pot + def dir + output_path.pot_git + '/' + base_filename.pot + end + def rel + #output_path.pot_git + '/' + base_filename.pot + end + self end def manifest - output_path.manifest + '/' + base_filename.manifest + def dir + output_path.manifest.dir + '/' + base_filename.manifest + end + def rel + output_path.manifest.rel + '/' + base_filename.manifest + end + self end self end @@ -3433,140 +3616,520 @@ WOK : (@fno + '.pot') end def sisupod - #@md.fn[:sisupod] if @md.fns =~/\.ssm\.sst$/; @md.fns.gsub(/(?:\~\S{2,3})?\.ssm\.sst$/,'.ssm.zip') else @md.fns.gsub(/(?:\~\S{2,3})?(\.sst)$/,'\1.zip') end end self end - def set_path_abc(ft) - if @env.output_dir_structure.by_language_code? - "#{output_path.base}/#{@md.opt.lng}/#{ft}" - elsif @env.output_dir_structure.by_filetype? - "#{output_path.base}/#{ft}" - else - "#{output_path.base}/#{@md.fnb}" + def set_path(ft) + @ft=ft + def dir + def abc + if @env.output_dir_structure.by_language_code? + "#{output_path.base.dir}/#{@md.opt.lng}/#{@ft}" + elsif @env.output_dir_structure.by_filetype? + "#{output_path.base.dir}/#{@ft}" + else + "#{output_path.base.dir}/#{@md.fnb}" + end + end + def ab + if @env.output_dir_structure.by_language_code? + "#{output_path.base.dir}/#{@md.opt.lng}/#{@ft}" + else + "#{output_path.base.dir}/#{@ft}" + end + end + def ab_src + if @env.output_dir_structure.by_language_code? + "#{output_path.base.url}/#{@ft}/#{@md.opt.lng}" + else + "#{output_path.base.url}/#{@ft}" + end + end + self end - end - def set_path_ab(ft) - if @env.output_dir_structure.by_language_code? - "#{output_path.base}/#{@md.opt.lng}/#{ft}" - else - "#{output_path.base}/#{ft}" + def url + def abc + if @env.output_dir_structure.by_language_code? + "#{output_path.base.url}/#{@md.opt.lng}/#{@ft}" + elsif @env.output_dir_structure.by_filetype? + "#{output_path.base.url}/#{@ft}" + else + "#{output_path.base.url}/#{@md.fnb}" + end + end + def ab + if @env.output_dir_structure.by_language_code? + "#{output_path.base.url}/#{@md.opt.lng}/#{@ft}" + else + "#{output_path.base.url}/#{@ft}" + end + end + def ab_src + if @env.output_dir_structure.by_language_code? + "#{output_path.base.dir}/#{@ft}/#{@md.opt.lng}" + else + "#{output_path.base.dir}/#{@ft}" + end + end + self end - end - def set_path_ab_src(ft) - if @env.output_dir_structure.by_language_code? - "#{output_path.base}/#{ft}/#{@md.opt.lng}" - else - "#{output_path.base}/#{ft}" + def rel + def abc + if @env.output_dir_structure.by_language_code? + "#{@md.opt.lng}/#{@ft}" + elsif @env.output_dir_structure.by_filetype? + "#{@ft}" + else + "#{@md.fnb}" + end + end + def ab + if @env.output_dir_structure.by_language_code? + "#{@md.opt.lng}/#{@ft}" + else + "#{@ft}" + end + end + def ab_src + if @env.output_dir_structure.by_language_code? + "#{@ft}/#{@md.opt.lng}" + else + "#{@ft}" + end + end + self + end + def rcp + def abc + if @env.output_dir_structure.by_language_code? + "#{output_path.stub.rcp}/#{@md.opt.lng}/#{ft}" + elsif @env.output_dir_structure.by_filetype? + "#{output_path.stub.rcp}/#{ft}" + else + "#{output_path.stub.rcp}/#{@md.fnb}" + end + end + def ab + if @env.output_dir_structure.by_language_code? + "#{output_path.stub.rcp}/#{@md.opt.lng}/#{ft}" + else + "#{output_path.stub.rcp}/#{ft}" + end + end + self end + self end def output_path + def stub + def dir + "#{@md.opt.f_pth[:pth_stub]}" + end + #def url + # "#{@env.url.root}" + #end + def rel + "./#{@md.opt.f_pth[:pth_stub]}" + end + def rcp + "#{@md.opt.f_pth[:pth_stub]}" + end + self + end def base - "#{@env.path.webserv}/#{@md.opt.f_pth[:pth_stub]}" + def dir + "#{@env.path.webserv}/#{@md.opt.f_pth[:pth_stub]}" + end + def url + "#{@env.url.root}" + #url: "#{@env.url.root}/#{@md.opt.f_pth[:pth_stub]}" + end + def rel + "./#{@md.opt.f_pth[:pth_stub]}" + end + def rcp + "./#{@md.opt.f_pth[:pth_stub]}" + end + self end def sisupod - "#{output_path.base}/pod" + 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 + self end def sisugit - "#{output_path.base}/git" + def dir + "#{output_path.base.dir}/git" + end + def url + "#{output_path.base.url}/git" + end + def rel + "#{output_path.base.rel}/git" + end + def rcp + "#{output_path.base.rcp}/git" + end + self end #def pod # ft='pod' - # path=set_path_ab(ft) + # path=set_path(ft).dir.ab #end def src - ft=Gt[:src] - path=set_path_ab_src(ft) + def ft + Gt[:src] + 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 + self end def po - "#{output_path.base}/po4a/#{@md.fnb}/po/#{@md.opt.lng}" + def dir + "#{output_path.base.dir}/po4a/#{@md.fnb}/po/#{@md.opt.lng}" + end + def url + "#{output_path.base.url}/po4a/#{@md.fnb}/po/#{@md.opt.lng}" + end + self end def pot - "#{output_path.base}/po4a/#{@md.fnb}/pot" + def dir + "#{output_path.base.dir}/po4a/#{@md.fnb}/pot" + end + def url + "#{output_path.base.url}/po4a/#{@md.fnb}/pot" + end + def rcp + p "#{output_path.base.dir}/po4a/#{@md.fnb}/pot" + end + self end - def po_git - ft=Gt[:po] - pth=@env.processing_path.git + '/' + @md.fnb + '/' + ft + '/' + @md.opt.lng - mkdir_p(pth) unless FileTest.directory?(pth) - pth + def po_git # consider !!! + def ft + Gt[:po] + end + def dir + pth=@env.processing_path.git + '/' + @md.fnb + '/' + ft + '/' + @md.opt.lng + mkdir_p(pth) unless FileTest.directory?(pth) + pth + end + self end - def pot_git - ft=Gt[:pot] - @env.processing_path.git + '/' + @md.fnb + '/' + ft + def pot_git # consider !!! + def ft + Gt[:pot] + end + def dir + @env.processing_path.git + '/' + @md.fnb + '/' + ft + end + self end def md_harvest manifest + self end def txt - ft='txt' - path=set_path_abc(ft) + def ft + 'txt' + end + def dir + set_path(ft).dir.abc + end + def url + set_path(ft).url.abc + end + def rel + set_path(ft).rel.abc + end + def rcp + set_path(ft).rcp.abc + end + self end def html_scroll - ft='html' - path=set_path_abc(ft) + def ft + 'html' + end + def dir + set_path(ft).dir.abc + end + def url + set_path(ft).url.abc + end + def rel + set_path(ft).rel.abc + end + def rcp + set_path(ft).rcp.abc + end + self end def html_seg - ft="html/#{@md.fnb}" - path=set_path_abc(ft) + def ft + "html/#{@md.fnb}" + end + def dir + set_path(ft).dir.abc + end + def url + set_path(ft).url.abc + end + def rel + set_path(ft).rel.abc + end + def rcp + set_path(ft).rcp.abc + end + self end def html_concordance html_seg + self end def html - ft='html' - path=set_path_abc(ft) + def ft + 'html' + end + def dir + set_path(ft).dir.abc + end + def url + set_path(ft).url.abc + end + def rel + set_path(ft).url.abc + end + def rcp + set_path(ft).rcp.abc + end + self end def xhtml - ft='xhtml' - path=set_path_abc(ft) + def ft + 'xhtml' + end + def dir + set_path(ft).dir.abc + end + def url + set_path(ft).url.abc + end + def rel + set_path(ft).rel.abc + end + def rcp + set_path(ft).rcp.abc + end + self end def epub - ft='epub' - path=set_path_ab(ft) + def ft + 'epub' + 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 + self end def odt - ft='odt' - path=set_path_abc(ft) + def ft + 'odt' + end + def dir + set_path(ft).dir.abc + end + def url + set_path(ft).url.abc + end + def rel + set_path(ft).rel.abc + end + def rcp + set_path(ft).rcp.abc + end + self end def xml - ft='xml' - path=set_path_abc(ft) + def ft + 'xml' + end + def dir + set_path(ft).dir.abc + end + def url + set_path(ft).url.abc + end + def rel + set_path(ft).rel.abc + end + def rcp + set_path(ft).rcp.abc + end + self end def xml_sax xml + self end def xml_dom xml + self end def pdf - ft='pdf' - path=set_path_abc(ft) + def ft + 'pdf' + end + def dir + set_path(ft).dir.abc + end + def url + set_path(ft).url.abc + end + def rel + set_path(ft).rel.abc + end + def rcp + set_path(ft).rcp.abc + end + self end def hash_digest - ft='hashes' - path=set_path_abc(ft) + def ft + 'hashes' + end + def dir + set_path(ft).dir.abc + end + def url + set_path(ft).url.abc + end + def rel + set_path(ft).rel.abc + end + def rcp + set_path(ft).rcp.abc + end + self end def manifest - ft='manifest' - path=set_path_abc(ft) + def ft + 'manifest' + end + def dir + set_path(ft).dir.abc + end + def url + set_path(ft).url.abc + end + def rel + set_path(ft).rel.abc + end + def rcp + set_path(ft).rcp.abc + end + self end def harvest - ft='site_metadata' - path=set_path_ab(ft) + def ft + 'site_metadata' + 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 + self end def manpage - ft='man' - path=set_path_ab(ft) + def ft + 'man' + 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 + self end def sitemaps - ft='sitemaps' - path=set_path_ab(ft) + def ft + 'sitemaps' + 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 + self end - def sqlite - path=output_path.base + def sqlite #check url + def dir + output_path.base.dir + end + def url + output_path.base.url + end + def rel + output_path.base.rel + end + def rcp + output_path.base.rcp + end + self end self end diff --git a/lib/sisu/v3/texpdf.rb b/lib/sisu/v3/texpdf.rb index 42c565b7..ebd68d6d 100644 --- a/lib/sisu/v3/texpdf.rb +++ b/lib/sisu/v3/texpdf.rb @@ -106,8 +106,8 @@ module SiSU_TeX SiSU_Screen::Ansi.new(@opt.cmd,'LaTeX/PDF',@md.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}/#{@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}/#{@md.file.base_filename.pdf_p}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_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 end @md=@particulars.md $flag=@md.opt.cmd #introduced to pass 0 for no object citation numbers... to texpdf_format @@ -182,14 +182,14 @@ module SiSU_TeX when /legal/; pdf_p=@md.file.base_filename.pdf_p_legal; pdf_l=@md.file.base_filename.pdf_l_legal else pdf_p=@md.file.base_filename.pdf_p_a4; pdf_l=@md.file.base_filename.pdf_l_a4 end - Dir.mkdir(@md.file.output_path.pdf) unless FileTest.directory?(@md.file.output_path.pdf) + Dir.mkdir(@md.file.output_path.pdf.dir) unless FileTest.directory?(@md.file.output_path.pdf.dir) if FileTest.file?(portrait_pdf) - cp(portrait_pdf,"#{@md.file.output_path.pdf}/#{pdf_p}") + cp(portrait_pdf,"#{@md.file.output_path.pdf.dir}/#{pdf_p}") rm(portrait_pdf) else p "#{__FILE__}:#{__LINE__} NOT FOUND: #{portrait_pdf}" if @md.opt.cmd.inspect =~/M/ end if FileTest.file?(landscape_pdf) - cp(landscape_pdf,"#{@md.file.output_path.pdf}/#{pdf_l}") + cp(landscape_pdf,"#{@md.file.output_path.pdf.dir}/#{pdf_l}") rm(landscape_pdf) else p "#{__FILE__}:#{__LINE__} NOT FOUND: #{landscape_pdf}" if @md.opt.cmd.inspect =~/M/ end @@ -230,26 +230,26 @@ module SiSU_TeX when /legal/; pdf_p=@md.file.base_filename.pdf_p_legal; pdf_l=@md.file.base_filename.pdf_l_legal else pdf_p=@md.file.base_filename.pdf_p_a4; pdf_l=@md.file.base_filename.pdf_l_a4 end - if FileTest.file?("#{@md.file.output_path.pdf}/#{pdf_p}") + if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{pdf_p}") mklnk=if @md.file.output_dir_structure.by_language_code? \ or @md.file.output_dir_structure.by_filetype? "#{@md.fnb}.portrait.pdf" else 'portrait.pdf' end system(" - cd #{@md.file.output_path.pdf} + cd #{@md.file.output_path.pdf.dir} rm #{mklnk} ln -s #{pdf_p} #{mklnk} ") end - if FileTest.file?("#{@md.file.output_path.pdf}/#{pdf_l}") + if FileTest.file?("#{@md.file.output_path.pdf.dir}/#{pdf_l}") mklnk=if @md.file.output_dir_structure.by_language_code? \ or @md.file.output_dir_structure.by_filetype? "#{@md.fnb}.landscape.pdf" else 'landscape.pdf' end system(" - cd #{@md.file.output_path.pdf} + cd #{@md.file.output_path.pdf.dir} rm #{mklnk} ln -s #{pdf_l} #{mklnk} ") diff --git a/lib/sisu/v3/urls.rb b/lib/sisu/v3/urls.rb index c963c97e..ee81786c 100644 --- a/lib/sisu/v3/urls.rb +++ b/lib/sisu/v3/urls.rb @@ -131,7 +131,7 @@ 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}/#{y}").result + SiSU_Screen::Ansi.new(@opt.cmd,"-#{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 @@ -145,70 +145,70 @@ module SiSU_urls SiSU_Screen::Ansi.new(@opt.cmd,"-#{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}/#{@md.file.base_filename.txt}").result + SiSU_Screen::Ansi.new(@opt.cmd,"-#{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}/#{@md.file.base_filename.epub}").result + SiSU_Screen::Ansi.new(@opt.cmd,"-#{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}/#{@md.file.base_filename.html_scroll}").result + 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 end def toc(x) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} file://#{@md.file.output_path.html_seg}/#{@md.file.base_filename.html_segtoc}").result + 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 end def concordance(x) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} file://#{@md.file.output_path.html_concordance}/#{@md.file.base_filename.html_concordance}").result + 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 end def manifest(x) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} file://#{@md.file.output_path.manifest}/#{@md.file.base_filename.manifest}").result + SiSU_Screen::Ansi.new(@opt.cmd,"-#{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}/#{@md.file.base_filename.odt}").result + SiSU_Screen::Ansi.new(@opt.cmd,"-#{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}/#{@md.file.base_filename.pdf_p}pdf").result + SiSU_Screen::Ansi.new(@opt.cmd,"-#{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}/#{@md.file.base_filename.pdf_l}pdf").result + SiSU_Screen::Ansi.new(@opt.cmd,"-#{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}/#{@md.file.base_filename.manpage}").result + SiSU_Screen::Ansi.new(@opt.cmd,"-#{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 end def po4a def po(x,y) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@md.file.output_path.po}/#{y}").result + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@md.file.output_path.po.dir}/#{y}").result end def pot(x,y) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@md.file.output_path.pot}/#{y}").result + SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.text_editor} #{@md.file.output_path.pot.dir}/#{y}").result end self end def xhtml(x) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} file://#{@md.file.output_path.xhtml}/#{@md.file.base_filename.xhtml}").result + SiSU_Screen::Ansi.new(@opt.cmd,"-#{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}/#{@md.file.base_filename.xml_sax}").result + 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 end def dom(x) - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} file://#{@md.file.output_path.xml_dom}/#{@md.file.base_filename.xml_dom}").result + 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 end def sitemap(x) #BROKEN - SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} file://#{@md.file.output_path.sitemap}/#{@md.file.base_filename.sitemap}").result + SiSU_Screen::Ansi.new(@opt.cmd,"-#{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}/#{@md.file.base_filename.hash_digest}").result + 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 end def db def psql(x,y) @@ -272,11 +272,11 @@ module SiSU_urls end def urls_select unless @opt.cmd =~/q/ - i="(output manifest) #{@md.file.output_path.manifest}/#{@md.file.base_filename.manifest}" + i="(output manifest) #{@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 - SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@md.file.output_path.manifest}/#{@md.file.base_filename.manifest}").flow if @opt.cmd =~/[MVv]/ + SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@md.file.output_path.manifest.dir}/#{@md.file.base_filename.manifest}").flow if @opt.cmd =~/[MVv]/ end m=/.+\/(?:src\/)?(\S+)/im # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m @pwd_stub="#{@env.url.output_tell}"[m,1] diff --git a/lib/sisu/v3/xhtml.rb b/lib/sisu/v3/xhtml.rb index 0871170a..a1b393f2 100644 --- a/lib/sisu/v3/xhtml.rb +++ b/lib/sisu/v3/xhtml.rb @@ -84,14 +84,14 @@ module SiSU_XHTML path=@env.path.output_tell loc=@env.url.output_tell - tool=if @opt.cmd =~/[MV]/; "#{@env.program.web_browser} file://#{@md.file.output_path.xhtml}/#{@md.file.base_filename.xhtml}#{path}/#{@md.fnb}/#{@md.fn[:xhtml]}\n\t#{@env.program.xml_viewer} file://#{@md.file.output_path.xhtml}/#{@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}/#{@md.file.base_filename.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 end @opt.cmd=~/[MVvz]/ \ ? SiSU_Screen::Ansi.new(@opt.cmd,'invert','XHTML',tool).colorize \ : SiSU_Screen::Ansi.new(@opt.cmd,'XHTML',tool).green_title_hi - SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"/#{@md.file.output_path.xhtml}/#{@md.file.base_filename.xhtml}").flow if @opt.cmd =~/[MV]/ + SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"/#{@md.file.output_path.xhtml.dir}/#{@md.file.base_filename.xhtml}").flow if @opt.cmd =~/[MV]/ end SiSU_XHTML::Source::Songsheet.new(@particulars).song rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error @@ -108,7 +108,7 @@ module SiSU_XHTML begin SiSU_XHTML::Source::Scroll.new(@particulars).songsheet SiSU_XHTML::Source::Tidy.new(@md,@env).xml if @md.opt.cmd =~/[vVM]/ # test wellformedness, comment out when not in use - SiSU_Rexml::Rexml.new(@md,@file.place_file.xhtml).xml if @md.opt.cmd =~/M/ # test rexml parsing, comment out when not in use #debug + SiSU_Rexml::Rexml.new(@md,@file.place_file.xhtml.dir).xml if @md.opt.cmd =~/M/ # test rexml parsing, comment out when not in use #debug rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error ensure end diff --git a/lib/sisu/v3/xml.rb b/lib/sisu/v3/xml.rb index 1e68000b..e821cfd4 100644 --- a/lib/sisu/v3/xml.rb +++ b/lib/sisu/v3/xml.rb @@ -83,14 +83,14 @@ module SiSU_XML_SAX unless @opt.cmd =~/q/ path=@env.path.output_tell loc=@env.url.output_tell - tool=if @opt.cmd =~/[MV]/; "#{@env.program.web_browser} file://#{@md.file.output_path.xml_sax}/#{@md.file.base_filename.xml_sax}\n\t#{@env.program.xml_viewer} file://#{@md.file.output_path.xml_sax}/#{@md.file.base_filename.xml_sax}" - elsif @opt.cmd =~/v/; "#{@env.program.web_browser} file://#{@md.file.output_path.xml_sax}/#{@md.file.base_filename.xml_sax}" + 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 end @opt.cmd=~/[MVvz]/ \ ? SiSU_Screen::Ansi.new(@opt.cmd,'invert','XML SAX',tool).colorize \ : SiSU_Screen::Ansi.new(@opt.cmd,'XML SAX',tool).green_title_hi - SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"file://#{@md.file.output_path.xml_sax}/#{@md.file.base_filename.xml_sax}").flow if @opt.cmd =~/[MV]/ + SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"file://#{@md.file.output_path.xml_sax.dir}/#{@md.file.base_filename.xml_sax}").flow if @opt.cmd =~/[MV]/ end SiSU_XML_SAX::Source::Songsheet.new(@particulars).song rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error @@ -108,7 +108,7 @@ module SiSU_XML_SAX begin SiSU_XML_SAX::Source::Scroll.new(@particulars).songsheet SiSU_XML_SAX::Source::Tidy.new(@md,@env).xml if @md.opt.cmd =~/[vVM]/ # test wellformedness, comment out when not in use - SiSU_Rexml::Rexml.new(@md,@file.place_file.xml_sax).xml if @md.opt.cmd =~/M/ # test rexml parsing, comment out when not in use #debug + SiSU_Rexml::Rexml.new(@md,@file.place_file.xml_sax.dir).xml if @md.opt.cmd =~/M/ # test rexml parsing, comment out when not in use #debug rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error ensure end diff --git a/lib/sisu/v3/xml_dom.rb b/lib/sisu/v3/xml_dom.rb index 3f18a1b8..db6a8786 100644 --- a/lib/sisu/v3/xml_dom.rb +++ b/lib/sisu/v3/xml_dom.rb @@ -81,14 +81,14 @@ module SiSU_XML_DOM unless @opt.cmd =~/q/ path=@env.path.output_tell loc=@env.url.output_tell - tool=if @opt.cmd =~/[MV]/; "#{@env.program.web_browser} file://#{@md.file.output_path.xml_dom}/#{@md.file.base_filename.xml_dom}\n\t#{@env.program.xml_viewer} file://#{@md.file.output_path.xml_dom}/#{@md.file.base_filename.xml_dom}" - elsif @opt.cmd =~/v/; "#{@env.program.web_browser} file://#{@md.file.output_path.xml_dom}/#{@md.file.base_filename.xml_dom}" + 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 end @opt.cmd=~/[MVvz]/ \ ? SiSU_Screen::Ansi.new(@opt.cmd,'invert','XML DOM',tool).colorize \ : SiSU_Screen::Ansi.new(@opt.cmd,'XML DOM',tool).green_title_hi - SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"file://#{@md.file.output_path.xml_dom}/#{@md.file.base_filename.xml_dom}").flow if @opt.cmd =~/[MV]/ + SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"file://#{@md.file.output_path.xml_dom.dir}/#{@md.file.base_filename.xml_dom}").flow if @opt.cmd =~/[MV]/ end SiSU_XML_DOM::Source::Songsheet.new(@particulars).songsheet rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error @@ -105,7 +105,7 @@ module SiSU_XML_DOM begin SiSU_XML_DOM::Source::Scroll.new(@particulars).songsheet SiSU_XML_DOM::Source::Tidy.new(@md,@env).xml if @md.opt.cmd =~/[vVM]/ # test wellformedness, comment out when not in use - SiSU_Rexml::Rexml.new(@md,@file.place_file.xml_dom).xml if @md.opt.cmd =~/M/ # test rexml parsing, comment out when not in use #debug + SiSU_Rexml::Rexml.new(@md,@file.place_file.xml_dom.dir).xml if @md.opt.cmd =~/M/ # test rexml parsing, comment out when not in use #debug rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error ensure end -- cgit v1.2.3