From 8c67d466ead2096d713515c88fcee17c473ecde5 Mon Sep 17 00:00:00 2001
From: Ralph Amissah <ralph@amissah.com>
Date: Fri, 19 Oct 2007 20:28:48 +0100
Subject: mostly paths for shared markup source (txt and pod), also...

also current Debian/Sid ruby1.9 upgrade removes a bug, so a related
test/warning in options.rb removed
---
 lib/sisu/v0/dal.rb           | 16 +++++++------
 lib/sisu/v0/embedded.rb      | 45 ------------------------------------
 lib/sisu/v0/help.rb          |  2 +-
 lib/sisu/v0/manifest.rb      | 26 ++++++++++++++-------
 lib/sisu/v0/options.rb       |  9 +-------
 lib/sisu/v0/sisupod_make.rb  |  6 ++---
 lib/sisu/v0/sysenv.rb        | 55 +++++++++++++++++++++++++++++++-------------
 lib/sisu/v0/texpdf_format.rb |  6 ++---
 lib/sisu/v0/urls.rb          | 12 +++++++---
 9 files changed, 83 insertions(+), 94 deletions(-)

(limited to 'lib')

diff --git a/lib/sisu/v0/dal.rb b/lib/sisu/v0/dal.rb
index 0b445832..47d3750d 100644
--- a/lib/sisu/v0/dal.rb
+++ b/lib/sisu/v0/dal.rb
@@ -364,15 +364,14 @@ module SiSU_DAL
         if para !~/^%+\s/ and
            para =~/\{(?:~\^\s+)?(.+?)\s\[(?:\d(?:[sS]*))\]\}(?:\.\.\/\S+?\/|\S+?\.ss[tm]\b)/
           txt,cmd,source,url_dir,note,manifest=nil,nil,nil,nil,nil,nil
-          url_and_stub=SiSU_Env::Info_env.new.url
-          if defined? url_and_stub.remote
-            @output_url="#{url_and_stub.remote}"
+          @u=SiSU_Env::Info_env.new.url
+          if defined? @u.remote
             if para =~/(.+?)\{(.+?)\s\[(\d[sS]*)\]\}((\S+?)\.ss[tm]\b)(.*)/m
               pre,txt,cmd,source,url_dir,note="#{$1.strip} ",$2,$3,$4,$5,$6
             elsif para =~/\{(.+?)\s\[(\d[sS]*)\]\}((\S+?)\.ss[tm]\b)(.*)/
               pre,txt,cmd,source,url_dir,note='',$1,$2,$3,$4,$5
             end
-            manifest="#{pre}{#{txt} }#@output_url/#{url_dir}/toc.html#{note}\n\n"
+            manifest="#{pre}{#{txt} }#{@u.remote}/#{url_dir}/toc.html#{note}\n\n"
           else
             puts "error, does currently support relative paths (reltive paths were removed, as had problems for citation, and was not suited to all output types should possibly reconsider) #{__FILE__} #{__LINE__}"
             if para =~/\{(?:~\^\s+)?(.+?)\s\[(\d[sS]*)\]\}\.\.\/(\S+?)\/(\s+~\{.+?\}~)?/
@@ -402,20 +401,23 @@ module SiSU_DAL
             end
             if describe
               tuned_file_tmp << if @output_url #to double space <:br> at beginning of entry
-                "&nbsp;&nbsp;&nbsp;&nbsp; {#{describe} }#@output_url/#{url_dir}/#{o_f}" if describe
+                "&nbsp;&nbsp;&nbsp;&nbsp; {#{describe} }#{@u.remote}/#{url_dir}/#{o_f}"
               else "&nbsp;&nbsp;&nbsp;&nbsp; { #{describe} }../#{url_dir}/#{o_f}"
               end
             end
           end
           output_filetypes[:src].each do |o_f|
-            describe = case o_f
+            describe=case o_f
             when /#{source}\.zip/;     ' markup source (zipped) pod'
             when /#{source}/;          ' markup source text'
             else nil
             end
             if describe
               tuned_file_tmp << if @output_url
-                "&nbsp;&nbsp;&nbsp;&nbsp; {#{describe} }#@output_url/src/#{o_f}" if describe
+                x=if describe =~/\.zip/
+                  "&nbsp;&nbsp;&nbsp;&nbsp; {#{describe} }#{@u.src_pod}/#{o_f}"
+                else "&nbsp;&nbsp;&nbsp;&nbsp; {#{describe} }#{@u.src_txt}/#{o_f}"
+                end
               else "&nbsp;&nbsp;&nbsp;&nbsp; { #{describe} }../#{url_dir}/#{o_f}"
               end
             end
diff --git a/lib/sisu/v0/embedded.rb b/lib/sisu/v0/embedded.rb
index b5d33ac2..f03f0aab 100644
--- a/lib/sisu/v0/embedded.rb
+++ b/lib/sisu/v0/embedded.rb
@@ -133,48 +133,3 @@ module SiSU_Embedded
   end
 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"
-  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|
-      SiSU_Env::System_call.new("#{src}/#{i}","#{ldest}/.",'q').rsync
-      #cp("#{src}/#{i}","#{ldest}/.") #use rysnc
-      if @md.cmd.inspect =~/R/ #rsync to remote image directory #ldest used as source, if not in local repo, don't share
-        SiSU_Env::System_call.new("#{ldest}/#{i}","#{rdest}/.",'q').rsync
-      end
-    end
-  end
-end
-def audio
-  #p @md.ec[:audio]
-  src="#{Dir.pwd}/_sisu/mm/audio"
-  ldest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/mm/audio"
-  if @md.cmd.inspect =~/[vVMR]/ and FileTest.directory?(src)
-    File.mkpath(ldest) unless FileTest.directory?(ldest)
-    @md.ec[:audio].each do |i|
-      SiSU_Env::System_call.new("#{src}/#{i}","#{ldest}/.",'q').rsync
-      #cp("#{src}/#{i}","#{ldest}/.") #use rysnc
-      if @md.cmd.inspect =~/R/
-        #rsync to remote audio directory
-      end
-    end
-  end
-end
-def multimedia
-  #p @md.ec[:multimedia]
-  src="#{Dir.pwd}/_sisu/mm/video"
-  ldest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/mm/video"
-  if @md.cmd.inspect =~/[vVMR]/ and FileTest.directory?(src)
-    File.mkpath(ldest) unless FileTest.directory?(ldest)
-    @md.ec[:multimedia].each do |i|
-      SiSU_Env::System_call.new("#{src}/#{i}","#{ldest}/.",'q').rsync
-      #cp("#{src}/#{i}","#{ldest}/.") #use rysnc
-      if @md.cmd.inspect =~/R/
-        #rsync to remote multimedia directory
-      end
-    end
-  end
-end
diff --git a/lib/sisu/v0/help.rb b/lib/sisu/v0/help.rb
index b5077fa1..84a7391d 100644
--- a/lib/sisu/v0/help.rb
+++ b/lib/sisu/v0/help.rb
@@ -67,7 +67,7 @@ module SiSU_Help
       fns='help_example_dummy_file_name.sst'
       @env=SiSU_Env::Info_env.new(fns)
       @db=SiSU_Env::Info_db.new
-      m=/.+\/(\S+)/m
+      m=/.+\/(?:src\/)?(\S+)/im # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m
       @output_stub=Dir.pwd[m,1]
     end
     def help_request
diff --git a/lib/sisu/v0/manifest.rb b/lib/sisu/v0/manifest.rb
index e0617fec..891d6f41 100644
--- a/lib/sisu/v0/manifest.rb
+++ b/lib/sisu/v0/manifest.rb
@@ -91,11 +91,8 @@ module SiSU_Manifest
         @md,@fns=md
         @env=SiSU_Env::Info_env.new(@md.fns)
         @fnb=@md.fnb
-        out=@env.path.output
-        @base_url="#{@env.url.root}/#@fnb"
-        @base_url_src="#{@env.url.root}/src"
-        @base_path="#{out}/#@fnb"
-        @base_path_src="#{out}/src"
+        @base_url,@base_url_src,@base_url_pod="#{@env.url.root}/#@fnb","#{@env.url.src_txt}","#{@env.url.src_pod}"
+        @base_path,@base_path_src,@base_path_pod="#{@env.path.output}/#@fnb","#{@env.path.output_src}","#{@env.path.output_pod}"
         @@dg ||=SiSU_Env::Info_env.new.digest.type
         @dg=@@dg
         l=SiSU_Env::Standardise_language.new.file_to_language(@md.fns)
@@ -129,6 +126,19 @@ module SiSU_Manifest
         @manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="../src/#{file}">#{id}</a></p></th><td class="right"><p class="tiny"><a href="../src/#{file}">#{file}</a> &nbsp;&nbsp;#{dgst[1]}<br />#{@url_brace.xml_open}<a href="#@base_url_src/#{file}">#@base_url_src/#{file}</a>#{@url_brace.xml_close}</p></td><td class="right"><p class="right">#{kb}</p>
         </td></tr>\n} if kb and kb =~/\d+/
       end
+      def summarize_pod(id,file)
+        sys=SiSU_Env::System_call.new
+        dgst =if @dg =~/^sha(?:2|256)$/; sys.sha256("#{@base_path_pod}/#{file}")
+        else                             sys.md5("#{@base_path_pod}/#{file}")
+        end
+        tell=SiSU_Screen::Ansi.new(@md.cmd,"#{dgst[1]} #{file}")
+        tell.warn if @md.cmd =~/[vVM]/
+        size=(File.size("#{@base_path_pod}/#{file}")/1024.00).to_s
+        kb=/([0-9]+\.[0-9]{0,1})/m.match(size)[1]
+        @manifest[:txt] << "#{file} #{id} #{kb}\n"
+        @manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="../pod/#{file}">#{id}</a></p></th><td class="right"><p class="tiny"><a href="../pod/#{file}">#{file}</a> &nbsp;&nbsp;#{dgst[1]}<br />#{@url_brace.xml_open}<a href="#@base_url_pod/#{file}">#@base_url_pod/#{file}</a>#{@url_brace.xml_close}</p></td><td class="right"><p class="right">#{kb}</p>
+        </td></tr>\n} if kb and kb =~/\d+/
+      end
       def languages(id,file)
         flv=@env.published_manifests?(@base_path)
         @manifest[:html] << %{<tr><th class="left"><div id="horizontal_links"><ul id="horizontal">\n}
@@ -246,14 +256,14 @@ module SiSU_Manifest
             summarize_source(id,file)
           end
         end
-        if FileTest.file?("#@base_path_src/#{@md.fn[:sisupod]}")==true
+        if FileTest.file?("#@base_path_pod/#{@md.fn[:sisupod]}")==true
           id,file='SiSU doc (zip)',@md.fn[:sisupod]
-          summarize_source(id,file)
+          summarize_pod(id,file)
         end
         if FileTest.file?("#@base_path/#{@md.fnb}")==true \
         and @md.fnb =~/\.kdi$/
           id,file='Kdissert (.kdi source)',@md.fnb
-          summarize_source(id,file)
+          summarize_pod(id,file)
         end
       end
       def metadata_tests
diff --git a/lib/sisu/v0/options.rb b/lib/sisu/v0/options.rb
index 4c8afb58..273d4d4a 100644
--- a/lib/sisu/v0/options.rb
+++ b/lib/sisu/v0/options.rb
@@ -94,14 +94,7 @@ module SiSU_commandline
         end
         s << " #{y}" unless y.empty?
       end
-if RUBY_VERSION > '1.9'
-#debug strip
-p 'problem with ruby 1.9.0 (2007-09-10 patchlevel 0) [i486-linux] on Debian Sid'
-p 'p content.class  == String                    == String           == ' + s.class.to_s
-p 'p s              ==  -mv gpl.fsf.sst          ==  -mv gpl.fsf.sst == ' + s
-p 'p s.strip        == -mv gpl.fsf.sst #expected == -mv #i get       == ' + s.strip + ' #actual, you get'
-end
-      s.strip!  # String.strip is broken in ruby 1.9.0 (2007-09-10 patchlevel 0) [i486-linux], 2007-09-18:38/2
+      s.strip!
       a=s.split(/\s+/)
       a.each do |x|
         if x =~/^-[a-z0-5]+/i \
diff --git a/lib/sisu/v0/sisupod_make.rb b/lib/sisu/v0/sisupod_make.rb
index af60cf4e..81645883 100644
--- a/lib/sisu/v0/sisupod_make.rb
+++ b/lib/sisu/v0/sisupod_make.rb
@@ -63,7 +63,7 @@ module SiSU_Doc
     require "#{SiSU_lib}/response"
     def initialize(opt)
       @opt=opt
-      m=/.+\/(\S+)/m
+      m=/.+\/(?:src\/)?(\S+)/im # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m
       @date=SiSU_Env::Info_date.new.dt
       @env=SiSU_Env::Info_env.new(@opt.fns)
       @ver=SiSU_Env::Info_version.new.get_version
@@ -72,7 +72,7 @@ module SiSU_Doc
       @v=if @opt.cmd =~/[VM]/; 'v'
       else                    ''
       end
-      @local_path="#{@env.path.output}/src" #@local_path="#{@env.path.output}/#{@env.fnb}"
+      @local_path="#{@env.path.output_pod}" #@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
@@ -83,7 +83,7 @@ module SiSU_Doc
       tell=SiSU_Screen::Ansi.new(@opt.cmd,'Share SiSU Document (zip)',@opt.fns)
       tell.green_hi_blue unless @opt.cmd =~/q/
       unless @opt.fns.empty?
-        tell=SiSU_Screen::Ansi.new(@opt.cmd,'Make sisu document (zip) and place in output directory',"#{@opt.fns} -> file://#{@env.path.output}/src/#{@zipfile}.zip")
+        tell=SiSU_Screen::Ansi.new(@opt.cmd,'Make sisu document (zip) and place in output directory',"#{@opt.fns} -> file://#{@env.path.output_pod}/#{@zipfile}.zip")
         tell.warn unless @opt.cmd =~/q/
         directories
         sisupod_build
diff --git a/lib/sisu/v0/sysenv.rb b/lib/sisu/v0/sysenv.rb
index 5d7dc7d8..7e94d8a3 100644
--- a/lib/sisu/v0/sysenv.rb
+++ b/lib/sisu/v0/sysenv.rb
@@ -96,7 +96,7 @@ module SiSU_Env
     etc=Config::CONFIG['sysconfdir'] + '/sisu'
     share=Config::CONFIG['datadir'] + '/sisu'
     data=Config::CONFIG['datadir'] + '/doc/sisu'
-    m=/.+\/(\S+)/m
+    m=/.+\/(?:src\/)?(\S+)/m # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m
     @stub_pwd ||=@@pwd[m,1]
     prcss_dir='_sisu_processing'
     prcss_dir_tmp_root="/tmp/#{prcss_dir}"
@@ -205,7 +205,7 @@ module SiSU_Env
       SQLITE_PORT =>           '**',
     }
     @@default_dir=DEFAULT_DIR
-    m=/.+\/(\S+)/m
+    m=/.+\/(?:src\/)?(\S+)/m # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m
     stub_pwd=@@pwd[m,1]
     @@rc_path=["#@@pwd/_sisu","#@@home/.sisu",@@sisu_etc]
     @@yamlrc_path=unless stub_pwd =~/^sisupod$/
@@ -610,7 +610,7 @@ module SiSU_Env
     def create_pg_db(dbname_stub=nil)                                          #createdb
       unless dbname_stub
         @pwd ||=Dir.pwd
-        m=/.+\/(\S+)/im
+        m=/.+\/(?:src\/)?(\S+)/im # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m
         dbname_stub=@pwd[m,1]
       end
       program='createdb'
@@ -803,9 +803,10 @@ module SiSU_Env
       @fnb ||=@@fb #clean up this... used primarily for zap which is not passed normal parameters
       @fixed_websev_root='' # @home
       @pwd=@@pwd||=Dir.pwd
-      m=/.+\/(\S+)/m
+      m=/.+\/(?:src\/)?(\S+)/m # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m
       @stub_pwd=@@pwd[m,1]
       @stub_src=@stub_pwd + '/src'
+      @stub_pod=@stub_pwd + '/pod'
     end
     def user
       @sys.user
@@ -842,6 +843,9 @@ module SiSU_Env
     def stub_src
       @stub_src
     end
+    def stub_pod
+      @stub_pod
+    end
     def sisupod
       #path.processing
       #  sisupod
@@ -1210,6 +1214,9 @@ WOK
       def stub_src
         @stub_src
       end
+      def stub_pod
+        @stub_pod
+      end
       def etc
         defaults[:sisu_etc]                                                      #live/dynamic
         # @sys.sisu_etc                                                           #broken: live/dynamic
@@ -1304,7 +1311,10 @@ WOK
         "#{path.webserv}/#@stub_pwd"
       end
       def output_src                                                                 #web/webserv output directory... subdirectory into which further subdirectories are made based on file names
-        "#{path.webserv}/src"
+        "#{path.output}/src"
+      end
+      def output_pod
+        "#{path.output}/pod"
       end
       def manpage
         "#{path.output}/man"
@@ -1473,7 +1483,7 @@ WOK
       end
       def root
         if defined? @rc['webserv']['url_root'] \
-        and @rc['webserv']['url_root'] =~/https?:\/\// 
+        and @rc['webserv']['url_root'] =~/https?:\/\//
           "#{@rc['webserv']['url_root']}/#@stub_pwd"
         elsif defined? @rc['webserv']['url_root'] \
         and @rc['webserv']['url_root'] =~/localhost/
@@ -1484,6 +1494,12 @@ WOK
       def remote
         root
       end
+      def src_txt
+        "#{root}/src"
+      end
+      def src_pod
+        "#{root}/pod"
+      end
       def webserv_host_base
         if defined? @rc['webserv']['host']
           case  @rc['webserv']['host']
@@ -2155,6 +2171,7 @@ WOK
       @env=SiSU_Env::Info_env.new
     end
     def zap
+p @zap
       if @zap !~/\/\//; rm_rf(@zap) if FileTest.directory?(@zap)
       else puts 'suspect zap request, ignored'
       end
@@ -2285,6 +2302,7 @@ WOK
         #remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}/."
         local_src=@source_path_src
         remote_src="#{remote_conn[:name]}/#{@env.path.stub_src}/."
+        remote_pod="#{remote_conn[:name]}/#{@env.path.stub_pod}/."
         src_txt=@opt.fnc
         src_pod=@opt.fncb.gsub(/(\.ss[mt])(?:\.sst)?$/,'\1.zip')
         if (local_gen =~/\S/ \
@@ -2294,16 +2312,18 @@ WOK
         and @@flag_remote==true \
         and @opt.cmd !~/U/
           System_call.new(local_gen,remote_gen).scp
-          if FileTest.file?("#{local_src}/#{src_txt}") \
-          or FileTest.file?("#{local_src}/#{src_pod}")
-            System_call.new("#{local_src}/#{src_txt} #{local_src}/#{src_pod}",remote_src).scp
+          if FileTest.file?("#{local_src}/#{src_txt}")
+            System_call.new("#{local_src}/#{src_txt}",remote_src).scp
+          elsif FileTest.file?("#{local_pod}/#{src_pod}")
+            System_call.new("#{local_src}/#{src_pod}",remote_pod).scp
           end
         elsif  @opt.cmd =~/U/
           puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
           puts "#{local_gen} -> #{remote_gen}"
-          if FileTest.file?("#{local_src}/#{src_doc}") \
-          or FileTest.file?("#{local_src}/#{src_doc}.zip")
+          if FileTest.file?("#{local_src}/#{src_doc}")
             puts "#{local_src}/#{src_doc}* -> #{remote_src}"
+          elsif FileTest.file?("#{local_pod}/#{src_doc}.zip")
+            puts "#{local_pod}/#{src_doc}* -> #{remote_pod}"
           end
         else
           puts 'suspect scp request, ignored'
@@ -2319,7 +2339,9 @@ WOK
         remote_gen="#{remote_conn[:name]}/#{@env.path.stub_pwd}/."
         remote_images="#{remote_conn[:name]}/#{@env.path.stub_pwd}/_sisu/image/."
         local_src=@source_path_src
+        local_pod=@source_path_pod
         remote_src="#{remote_conn[:name]}/#{@env.path.stub_src}/."
+        remote_pod="#{remote_conn[:name]}/#{@env.path.stub_pod}/."
         src_txt=@opt.fnc
         src_pod=@opt.fncb.gsub(/(\.ss[mt])(?:\.sst)?$/,'\1.zip')
         if (local_gen =~/\S/ \
@@ -2329,13 +2351,14 @@ WOK
         and @@flag_remote==true \
         and @opt.cmd !~/U/
           System_call.new(local_gen,remote_gen,@opt.cmd).rsync('--delete-after')
-          if FileTest.file?("#{local_src}/#{src_txt}") \
-          or FileTest.file?("#{local_src}/#{src_pod}")
-            System_call.new("#{local_src}/#{src_txt} #{local_src}/#{src_pod}",remote_src,@opt.cmd).rsync
+          if FileTest.file?("#{local_src}/#{src_txt}")
+            System_call.new("#{local_src}/#{src_txt}",remote_src,@opt.cmd).rsync
             if defined? @md.ec[:image]
               images="#{local_gen_image}/" + @md.ec[:image].join(" #{local_gen_image}/")
               System_call.new(images,remote_images,@opt.cmd).rsync
             end
+          elsif FileTest.file?("#{local_pod}/#{src_pod}")
+            System_call.new("#{local_pod}/#{src_pod}",remote_src,@opt.cmd).rsync
           end
         elsif  @opt.cmd =~/U/
           puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
@@ -2521,7 +2544,7 @@ WOK
       @@pwd ||=Dir.pwd
       @pwd=Dir.pwd
       @env=SiSU_Env::Info_env.new
-      m=/.+\/(\S+)/m
+      m=/.+\/(?:src\/)?(\S+)/m # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m
       @pwd_stub=@pwd[m,1]
       @rc=@@rc ||=Get_init.instance.yamlrc
       @defaults=Info_env.new.defaults
@@ -2583,7 +2606,7 @@ WOK
       else nil
       end
       @home,@pwd=ENV['HOME'],ENV['PWD']
-      m=/.+\/(\S+)/m
+      m=/.+\/(?:src\/)?(\S+)/m # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m
       @pwd_stub=@pwd[m,1]
       @env=SiSU_Env::Info_env.new
     end
diff --git a/lib/sisu/v0/texpdf_format.rb b/lib/sisu/v0/texpdf_format.rb
index 3887600d..4f31311a 100644
--- a/lib/sisu/v0/texpdf_format.rb
+++ b/lib/sisu/v0/texpdf_format.rb
@@ -825,8 +825,7 @@ WOK
             when /a5/;     @tx.a5
             else           @tx.a4
             end
-            width=if \
-            orientation =~/portrait/ #value is not currently passed
+            width=if orientation =~/portrait/ #value is not currently passed
               width=if width.to_i > dm.portrait.img_px; dm.portrait.img_px
               else                                      width
               end
@@ -1208,7 +1207,8 @@ WOK
     end
     def para_num
       paranumber_display=if @md.markup.inspect =~/no_ocn/ \
-      or @md.mod.inspect =~/--no-ocn/; ''
+      or @md.mod.inspect =~/--no-ocn/
+        ''
       else "\\begin{tiny}~\\end{tiny}{\\marginpar{\\begin{tiny}#@string1\\end{tiny}}}" #ocn object citation numbering
       end
       if @string !~/^([1-6a-z-]#{@@tilde}\S*|<:.+?>|#{@md.lv1}|#{@md.lv2}|#{@md.lv3}|#{@md.lv4}|#{@md.lv5}|#{@md.lv6})/
diff --git a/lib/sisu/v0/urls.rb b/lib/sisu/v0/urls.rb
index b9b1e0ec..ca1b6928 100644
--- a/lib/sisu/v0/urls.rb
+++ b/lib/sisu/v0/urls.rb
@@ -192,7 +192,7 @@ module SiSU_urls
       tell.grey_title_hi unless @opt.cmd =~/q/
       tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.path.output}/#@fnb")
       tell.flow unless @opt.cmd =~/q/
-      m=/.+\/(\S+)/m
+      m=/.+\/(?:src\/)?(\S+)/im # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m
       @pwd_stub="#@webserv_url"[m,1]
       @u.each do |x,y|
         if @opt.fns =~ @m_regular
@@ -234,12 +234,18 @@ module SiSU_urls
             tell.result unless @opt.cmd =~/q/
             @opt.cmd.gsub!(/P[iu]/,'')
           end
-          if x=~/^[sS]/ \
+          if x=~/^s/ \
+          and @opt.cmd =~/s/
+            tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#@browser #@webserv_url/src/#{y}")
+            tell.result unless @opt.cmd =~/q/
+            @opt.cmd.gsub!(/I/,'')
+          end
+          if x=~/^S/ \
           and @opt.cmd =~/[sS]/
             zipfile=if @opt.fns =~/\.ssm\.sst$/; y.gsub(/(?:\~\S{2,3})?(\.ssm\.sst\.zip)$/,'.ssm.zip')
             else y.gsub(/(?:\~\S{2,3})?(\.sst\.zip)$/,'\1')
             end
-            tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#@browser #@webserv_url/src/#{y}")
+            tell=SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#@browser #@webserv_url/pod/#{y}")
             tell.result unless @opt.cmd =~/q/
             @opt.cmd.gsub!(/I/,'')
           end
-- 
cgit v1.2.3