From 75d9ef8375b0b67d2c9d2783975d8f06d4bebcc7 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 14 Oct 2007 21:35:56 +0100 Subject: default image directories moved, more convenient/logical [test] --- lib/sisu/v0/defaults.rb | 61 +++++++++++++++++++++++++---------------------- lib/sisu/v0/embedded.rb | 8 +++---- lib/sisu/v0/help.rb | 4 ++-- lib/sisu/v0/html_promo.rb | 2 +- lib/sisu/v0/remote.rb | 2 +- lib/sisu/v0/sysenv.rb | 20 ++++++++-------- 6 files changed, 50 insertions(+), 47 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v0/defaults.rb b/lib/sisu/v0/defaults.rb index 47fbeec8..46a55775 100644 --- a/lib/sisu/v0/defaults.rb +++ b/lib/sisu/v0/defaults.rb @@ -205,6 +205,9 @@ module SiSU_Viz def url_path_image #used for html image display '../_sisu/image' end + def url_path_image_sys #used for html image display + '../_sisu/image_sys' + end def url_path_ebook_dir './ebook' end @@ -767,61 +770,61 @@ module SiSU_Viz png_site end def png_nav - %{Contents} + %{Contents} end def png_manifest - %{Document Manifest} + %{Document Manifest} end def png_doc - %{Full Text} + %{Full Text} end def png_toc - %{TOC linked} + %{TOC linked} end def png_odf - %{ODF/ODT} + %{ODF/ODT} end def png_pdf - %{PDF} + %{PDF} end def png_pdf_portrait - %{PDF portrait} + %{PDF portrait} end def png_pdf_landscape - %{PDF landscape} + %{PDF landscape} end def png_wmp - %{Concordance} + %{Concordance} end def png_para - %{Segment} + %{Segment} end def png_status - %{Membership status} + %{Membership status} end def png_mark - %{*} + %{*} end def png_doc_tiny - %{Doc} + %{Doc} end def png_toc_tiny - %{TOC} + %{TOC} end def png_status_tiny - %{Status, Member States} + %{Status, Member States} end def png_ftp - %{FTP} + %{FTP} end def png_gopher - %{Gopher} + %{Gopher} end def png_crosslink - %{lateral hop} + %{lateral hop} end def png_crosslink_ext - %{lateral hop} + %{lateral hop} end def png_home dir=SiSU_Env::Info_env.new #(@fns) @@ -832,21 +835,21 @@ module SiSU_Viz %{#{txt_home} -->} end def png_book - %{Cameron May Books} + %{Cameron May Books} end #% png_nav def png_nav_home end def png_nav_toc - %{TOC} + %{TOC} end def png_nav_doc end def png_nav_previous - %{<< previous} + %{<< previous} end def png_nav_next - %{next >>} + %{next >>} end def png_nav_pre png_nav_previous @@ -855,22 +858,22 @@ module SiSU_Viz png_nav_next end def png_nav_pdf - %{PDF} + %{PDF} end def png_nav_pdf_portrait - %{pdf portrait} + %{pdf portrait} end def png_nav_pdf_landscape - %{pdf landscape} + %{pdf landscape} end def png_nav_dot_toc - %{^} + %{^} end def png_nav_dot_previous - %{<} + %{<} end def png_nav_dot_next - %{>} + %{>} end def png_nav_dot_pre png_nav_dot_previous diff --git a/lib/sisu/v0/embedded.rb b/lib/sisu/v0/embedded.rb index 11a5aa24..22835e8f 100644 --- a/lib/sisu/v0/embedded.rb +++ b/lib/sisu/v0/embedded.rb @@ -82,8 +82,8 @@ module SiSU_Embedded end def images src="#{Dir.pwd}/_sisu/image" - ldest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_local" - rdest="#@rhost/#{@env.path.stub_pwd}/_sisu/image_local" + ldest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image" + rdest="#@rhost/#{@env.path.stub_pwd}/_sisu/image" if @md.cmd.inspect =~/[vVMR]/ and FileTest.directory?(src) File.mkpath(ldest) unless FileTest.directory?(ldest) src_ec="#{src}/" + @md.ec[:image].join(" #{src}/") @@ -126,8 +126,8 @@ end __END__ def images # alternative may be preferable as source taken from local destination, and not sent remotely unless found there src="#{Dir.pwd}/_sisu/image" - ldest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_local" - rdest="#@rhost/#{@env.path.stub_pwd}/_sisu/image_local" + ldest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image" + rdest="#@rhost/#{@env.path.stub_pwd}/_sisu/image" if @md.cmd.inspect =~/[vVMR]/ and FileTest.directory?(src) File.mkpath(ldest) unless FileTest.directory?(ldest) @md.ec[:image].each do |i| diff --git a/lib/sisu/v0/help.rb b/lib/sisu/v0/help.rb index 5c568074..7c09da3c 100644 --- a/lib/sisu/v0/help.rb +++ b/lib/sisu/v0/help.rb @@ -867,7 +867,7 @@ If you have problems check permissions (and if in home directory ownership). images: source: #{@cX.blue}#{@env.path.image_source}#{@cX.off} latex source: #{@cX.blue}#{@env.path.image_source_tex}#{@cX.off} - note images are also sourced from within your pwd - #{@cX.blue}#{Dir.pwd}/_sisu/sisu/image_local#{@cX.off} if it exists + note images are also sourced from within your pwd - #{@cX.blue}#{Dir.pwd}/_sisu/image#{@cX.off} if it exists #{@cX.grey}[ texinfo: #{@env.path.texinfo} - check duplication ]#{@cX.off} #{@cX.green}resource configuraton files#{@cX.off} to change the paths specified above, are searched for in the following order: @@ -967,7 +967,7 @@ WOK images that the author wishes to include within documents, these should be placed in a sub-directory - within the current document markup directory called #{@cX.green}_sisu/sisu/image_local#{@cX.off} + within the current document markup directory called #{@cX.green}_sisu/image#{@cX.off} if an instruction is given to process a remote document which contains downloadable images, they are included in a sub-directory of the current diff --git a/lib/sisu/v0/html_promo.rb b/lib/sisu/v0/html_promo.rb index c4e18184..1fc8fb4d 100644 --- a/lib/sisu/v0/html_promo.rb +++ b/lib/sisu/v0/html_promo.rb @@ -188,7 +188,7 @@ module SiSU_HTML_promo end end def image - @prod['image'] ? %{
} : '' + @prod['image'] ? %{
} : '' end def url_link @url_=if @prod['url'] =~/http:/ diff --git a/lib/sisu/v0/remote.rb b/lib/sisu/v0/remote.rb index b35f2396..7e0205b1 100644 --- a/lib/sisu/v0/remote.rb +++ b/lib/sisu/v0/remote.rb @@ -122,7 +122,7 @@ module SiSU_Remote raise "#{url} not found" unless f re_fnb=/((?:https?|file):\/\/[^\/ ]+?\/[^\/ ]+?)\/\S+?\/([^\/]+?)\.ss(t)/ #revisit and remove DO base_uri,fnb,instr=re_fnb.match(url)[1..3] if re_fnb - imagedir= base_uri + '/_sisu/image_local' #check on + imagedir= base_uri + '/_sisu/image' #check on doc_skin_dir = /((?:https?|file):\/\/\S+?)\/[^\/]+?\.sst$/.match(url).captures.join + '/_sisu/skin/doc' #"Got file, and ready to process: #{fnb}.t#{instr}" downloaded_file=File.new("#{fnb}.-sst",'w+') diff --git a/lib/sisu/v0/sysenv.rb b/lib/sisu/v0/sysenv.rb index 1c684052..4252529d 100644 --- a/lib/sisu/v0/sysenv.rb +++ b/lib/sisu/v0/sysenv.rb @@ -1543,11 +1543,11 @@ WOK require 'ftools' images=Dir.glob("#{defaults[:image_local]}/*.{png,jpg,gif}") pth="#{path.webserv}/#@stub_pwd" - File.mkpath("#{pth}/_sisu/image_local") unless FileTest.directory?("#{pth}/_sisu/image_local") + File.mkpath("#{pth}/_sisu/image") unless FileTest.directory?("#{pth}/_sisu/image") images.each { |i| File.install(i,"#{pth}/#{i}") } unless images.length > 0 @@image_flag=false end - '../_sisu/image_local' + '../_sisu/image' else if @@local_image==true cmd=if @cmd; @cmd @@ -2112,14 +2112,14 @@ WOK remote="#{remote_host_base}/#{@env.path.stub_pwd}/." if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] and @@flag_remote==true and @opt.cmd !~/U/ puts "begin scp_base_all: #{local} -> #{remote}" + System_call.new("#{local}/_sisu/image_sys/",remote).scp System_call.new("#{local}/_sisu/image/",remote).scp - System_call.new("#{local}/_sisu/image_local/",remote).scp System_call.new("#{local}/#{@env.path.style}/",remote).scp elsif @opt.cmd =~/U/ puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ puts "scp_base_all: #{local} -> #{remote}" + puts "#{local}/_sisu/image_sys/ -> #{remote}" puts "#{local}/_sisu/image/ -> #{remote}" - puts "#{local}/_sisu/image_local/ -> #{remote}" puts "#{local}/#{@env.path.style}/ -> #{remote}" else puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ end @@ -2135,8 +2135,8 @@ WOK elsif @opt.cmd =~/U/ puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ puts "rsync_base: #{local} -> #{remote}" + puts "#{local}/_sisu/image_sys/ -> #{remote}" puts "#{local}/_sisu/image/ -> #{remote}" - puts "#{local}/_sisu/image_local/ -> #{remote}" puts "#{local}/#{@env.path.style}/ -> #{remote}" else puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ end @@ -2146,14 +2146,14 @@ WOK remote="#{remote_host_base}/#{@env.path.stub_pwd}/." if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] and @@flag_remote==true and @opt.cmd !~/U/ puts "begin rsync_base_sync: #{local} -> #{remote}" + System_call.new("#{local}/_sisu/image_sys/",remote).rsync('--delete-after') System_call.new("#{local}/_sisu/image/",remote).rsync('--delete-after') - System_call.new("#{local}/_sisu/image_local/",remote).rsync('--delete-after') System_call.new("#{local}/#{@env.path.style}/",remote).rsync('--delete-after') elsif @opt.cmd =~/U/ puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ puts "rsync_base_sync: #{local} -> #{remote}" + puts "#{local}/_sisu/image_sys/ -> #{remote}" puts "#{local}/_sisu/image/ -> #{remote}" - puts "#{local}/_sisu/image_local/ -> #{remote}" puts "#{local}/#{@env.path.style}/ -> #{remote}" else puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/ end @@ -2194,7 +2194,7 @@ WOK end def images File.mkpath("#{@env.path.output}/_sisu") unless FileTest.directory?("#{@env.path.output}/_sisu") - File.symlink("../../_sisu/image", "#{@env.path.output}/_sisu/image") unless File.exist?("#{@env.path.output}/_sisu/image") or File.symlink?("#{@env.path.output}/_sisu/image") + File.symlink("../../_sisu/image_sys", "#{@env.path.output}/_sisu/image_sys") unless File.exist?("#{@env.path.output}/_sisu/image_sys") or File.symlink?("#{@env.path.output}/_sisu/image_sys") end def man_forms #File.symlink("../../man/form", "#{@env.path.output}/man/form") unless File.symlink?("#{@env.path.output}/man/form") == true @@ -2633,7 +2633,7 @@ WOK end def cp_local_images src="#@pwd/_sisu/image" - dest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_local" + dest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image" cp_images(src,dest) end def cp_external_images @@ -2648,7 +2648,7 @@ WOK end def cp_base_images #fix images src="#{@env.path.share}/image" - dest="#{@env.path.webserv}/_sisu/image" + dest="#{@env.path.webserv}/_sisu/image_sys" cp_images(src,dest) end def cp_css -- cgit v1.2.3