aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v4
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2013-03-13 22:12:26 -0400
committerRalph Amissah <ralph@amissah.com>2013-03-13 22:12:26 -0400
commit7e0877dcbff51b68752286516f045b8abdb47443 (patch)
tree41905d73ed77be6e7231ddc646e26bb2b36f5c88 /lib/sisu/v4
parentdebian/changelog (4.0.12-1) (diff)
parentv4: version & changelog, dates touched (diff)
Merge tag 'sisu_4.0.13' into debian/sid
SiSU 4.0.13
Diffstat (limited to 'lib/sisu/v4')
-rw-r--r--lib/sisu/v4/concordance.rb2
-rw-r--r--lib/sisu/v4/db_create.rb6
-rw-r--r--lib/sisu/v4/html_format.rb15
-rw-r--r--lib/sisu/v4/hub.rb122
-rw-r--r--lib/sisu/v4/manifest.rb28
-rw-r--r--lib/sisu/v4/param.rb8
-rw-r--r--lib/sisu/v4/remote.rb6
-rw-r--r--lib/sisu/v4/sysenv.rb295
-rw-r--r--lib/sisu/v4/xhtml.rb2
-rw-r--r--lib/sisu/v4/xml.rb2
-rw-r--r--lib/sisu/v4/xml_dom.rb2
11 files changed, 261 insertions, 227 deletions
diff --git a/lib/sisu/v4/concordance.rb b/lib/sisu/v4/concordance.rb
index db8059a0..c7a77a36 100644
--- a/lib/sisu/v4/concordance.rb
+++ b/lib/sisu/v4/concordance.rb
@@ -84,7 +84,7 @@ module SiSU_Concordance
? "#{@env.program.web_browser} #{@md.file.output_path.html_concordance.dir}/#{@md.file.base_filename.html_concordance}"
: "[#{@opt.f_pth[:lng_is]}] #{@opt.fno}"
@md.opt.cmd=~/[MVvz]/ \
- ? SiSU_Screen::Ansi.new(@opt.cmd,"Concordance",tool).grey_title_hi
+ ? SiSU_Screen::Ansi.new(@opt.cmd,"Concordance",tool).green_hi_blue
: SiSU_Screen::Ansi.new(@opt.cmd,'Concordance',tool).green_title_hi
end
wordmax=@env.concord_max
diff --git a/lib/sisu/v4/db_create.rb b/lib/sisu/v4/db_create.rb
index a7e6c774..e5b8dc78 100644
--- a/lib/sisu/v4/db_create.rb
+++ b/lib/sisu/v4/db_create.rb
@@ -84,9 +84,9 @@ module SiSU_DbCreate
def create_db
@env=SiSU_Env::InfoEnv.new(@opt.fns)
tell=(@sql_type=='sqlite') \
- ? SiSU_Screen::Ansi.new(@opt.cmd,'invert','Create Sqlite db tables in:',%{"#{@file}"})
- : SiSU_Screen::Ansi.new(@opt.cmd,'invert','Create PG db tables in:',%{"#{Db[:name_prefix]}#{@env.path.stub_pwd}"})
- tell.colorize if @opt.cmd =~/[vVM]/
+ ? SiSU_Screen::Ansi.new(@opt.cmd,'Create SQLite db tables in:',%{"#{@file}"})
+ : SiSU_Screen::Ansi.new(@opt.cmd,'Create pgSQL db tables in:',%{"#{Db[:name_prefix]}#{@env.path.stub_pwd}"})
+ tell.dark_grey_title_hi if @opt.cmd =~/[vVM]/
SiSU_Env::SystemCall.new.create_pg_db(@env.path.stub_pwd) if @sql_type=='pg' #watch use of path.stub_pwd instead of stub
end
def output_dir?
diff --git a/lib/sisu/v4/html_format.rb b/lib/sisu/v4/html_format.rb
index d2c12154..1bdd7182 100644
--- a/lib/sisu/v4/html_format.rb
+++ b/lib/sisu/v4/html_format.rb
@@ -297,6 +297,7 @@ module SiSU_HTML_Format
@md=md
@o_str ||=SiSU_Env::ProcessingSettings.new(md).output_dir_structure
@make=SiSU_Env::ProcessingSettings.new(@md)
+ @file=SiSU_Env::FileOp.new(@md)
end
def scroll_head_navigation_band
if @make.build.html_top_band?
@@ -338,9 +339,17 @@ WOK
end
end
def seg_head_navigation_band(page=:seg)
- firstseg=%{<a href="#{@md.firstseg}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top" alt="-&gt;">
- #{png_nav.nxt}
- </a>} if @md.firstseg =~/\S+/
+ if page==:manifest
+ nxt=(@file.output_dir_structure.by_language_code? \
+ || @file.output_dir_structure.by_filetype?) \
+ ? "../html/#{@md.fnb}/toc#{@md.lang_code_insert}#{Sfx[:html]}"
+ : "toc#{@md.lang_code_insert}#{Sfx[:html]}"
+ firstseg=%{<a href="#{nxt}" target="_top" alt="-&gt;">
+ #{png_nav.nxt}</a>}
+ elsif @md.firstseg =~/\S+/
+ firstseg=%{<a href="#{@md.firstseg}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top" alt="-&gt;">
+ #{png_nav.nxt}</a>}
+ end
%{<table summary="table of contents segment navigation band" id="toc" width="100%" bgcolor=#{@vz.color_band1}>
<tr><td width="20%">
#{button_home(page)}
diff --git a/lib/sisu/v4/hub.rb b/lib/sisu/v4/hub.rb
index dee13bc1..f7cdb1e2 100644
--- a/lib/sisu/v4/hub.rb
+++ b/lib/sisu/v4/hub.rb
@@ -191,22 +191,22 @@ module SiSU
@@n_do=0
end
def remote_put_base_site_rsync # -CR
-p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on
+ puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:cyan) if @opt.act[:maintenance][:set] ==:on
require_relative 'remote' # remote.rb
SiSU_Remote::Put.new(@opt).rsync_base
end
def remote_put_base_site_rsync_match # -CCRZ
-p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on
+ puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:cyan) if @opt.act[:maintenance][:set] ==:on
require_relative 'remote' # remote.rb
SiSU_Remote::Put.new(@opt).rsync_base_sync
end
def remote_put_base_site # -Cr
-p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on
+ puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:cyan) if @opt.act[:maintenance][:set] ==:on
require_relative 'remote' # remote.rb
SiSU_Remote::Put.new(@opt).scp_base
end
def remote_put_base_site_all # -CCr
-p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on
+ puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:cyan) if @opt.act[:maintenance][:set] ==:on
require_relative 'remote' # remote.rb
SiSU_Remote::Put.new(@opt).scp_base_all
end
@@ -457,42 +457,22 @@ p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on
end
if @opt.act[:psql][:set]==:on #% --pg, -D DB postgresql
require_relative 'dbi'
- if @opt.files.length > 0 #switch test to actual commands
- OptionLoopFiles.new(@opt).loop_files_on_given_option do
- SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb
- end
- else
- SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb
+ OptionLoopFiles.new(@opt).loop_files_on_given_option do
+ SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb
end
end
if @opt.act[:sqlite][:set]==:on #% --sqlite, -d DB sqlite
require_relative 'dbi'
- if @opt.files.length > 0 #switch test to actual commands
- OptionLoopFiles.new(@opt).loop_files_on_given_option do
- SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb
- end
- else
- SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb
+ OptionLoopFiles.new(@opt).loop_files_on_given_option do
+ SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb
end
end
- if @opt.act[:dal][:set]==:on #% --dal, -m embedded content
- # OptionLoopFiles.new(@opt).loop_files_on_given_option do
- # require_relative 'embedded'
- # SiSU_Embedded::Source.new(@opt).read # -m embedded.rb (image and other content) #check
- # end
- end
if @opt.act[:zap][:set]==:on #% --zap, -Z
# OptionLoopFiles.new(@opt).loop_files_on_given_option do
# require_relative 'zap'
# SiSU_Zap::Source.new(@opt).read # -Z zap.rb
# end
end
- if @opt.act[:sisupod][:set]==:on #% --sisupod, -S make sisupod
- # OptionLoopFiles.new(@opt).loop_files_on_given_option do
- # require_relative 'sisupod_make'
- # SiSU_Doc::Source.new(@opt).read # -S sisupod_make.rb
- # end
- end
if @opt.act[:manifest][:set]==:on #% --manifest, -y
require_relative 'manifest'
OptionLoopFiles.new(@opt).manifest_on_files_translated do
@@ -629,50 +609,68 @@ p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on
ensure
end
end
- if @opt.act[:site_init][:set]==:on #% -C
- require_relative 'conf' # -s conf.rb
- SiSU_Initialize::Source.new(@opt).read
- end
end
def actions
if @opt.act[:profile][:set]==:on
require 'profile'
end
- action_on_file_ =(@opt.act[:dal][:set]==:on \
- || @opt.act[:manpage][:set]==:on \
- || @opt.act[:texinfo][:set]==:on \
- || @opt.act[:txt][:set]==:on \
- || @opt.act[:html][:set]==:on \
- || @opt.act[:html_scroll][:set]==:on \
- || @opt.act[:html_seg][:set]==:on \
- || @opt.act[:concordance][:set]==:on \
- || @opt.act[:xhtml][:set]==:on \
- || @opt.act[:epub][:set]==:on \
- || @opt.act[:odt][:set]==:on \
- || @opt.act[:xml_sax][:set]==:on \
- || @opt.act[:xml_dom][:set]==:on \
- || @opt.act[:pdf][:set]==:on \
- || @opt.act[:pdf_p][:set]==:on \
- || @opt.act[:pdf_l][:set]==:on \
- || @opt.act[:psql][:set]==:on \
- || @opt.act[:sqlite][:set]==:on \
- || @opt.act[:sqlite_discrete][:set]==:on \
- || @opt.act[:share_source][:set]==:on \
- || @opt.act[:sisupod][:set]==:on \
- || @opt.act[:qrcode][:set]==:on \
- || @opt.act[:hash_digests][:set]==:on \
- || @opt.act[:manifest][:set]==:on \
- || @opt.act[:rsync][:set]==:on \
- || @opt.act[:scp][:set]==:on \
- || @opt.act[:webrick][:set]==:on \
- || @opt.act[:zap][:set]==:on) \
- ? (:true)
- : (:false)
+ action_on_file_ =if @opt.act[:rsync][:set]==:on \
+ && @opt.act[:site_init][:set]==:on
+ :false
+ elsif @opt.act[:rsync][:set]==:on \
+ && @opt.act[:site_init][:set] !=:on
+ :true
+ elsif ((@opt.act[:psql][:set]==:on \
+ or @opt.act[:sqlite][:set]==:on) \
+ and @opt.mod.join(';') =~/--(?:createdb|init(?:ialize)?|create(?:all)?|createtables|recreate|drop(?:all))/)
+ :false
+ else
+ (@opt.act[:dal][:set]==:on \
+ || @opt.act[:manpage][:set]==:on \
+ || @opt.act[:texinfo][:set]==:on \
+ || @opt.act[:txt][:set]==:on \
+ || @opt.act[:html][:set]==:on \
+ || @opt.act[:html_scroll][:set]==:on \
+ || @opt.act[:html_seg][:set]==:on \
+ || @opt.act[:concordance][:set]==:on \
+ || @opt.act[:xhtml][:set]==:on \
+ || @opt.act[:epub][:set]==:on \
+ || @opt.act[:odt][:set]==:on \
+ || @opt.act[:xml_sax][:set]==:on \
+ || @opt.act[:xml_dom][:set]==:on \
+ || @opt.act[:pdf][:set]==:on \
+ || @opt.act[:pdf_p][:set]==:on \
+ || @opt.act[:pdf_l][:set]==:on \
+ || @opt.act[:psql][:set]==:on \
+ || @opt.act[:sqlite][:set]==:on \
+ || @opt.act[:sqlite_discrete][:set]==:on \
+ || @opt.act[:share_source][:set]==:on \
+ || @opt.act[:sisupod][:set]==:on \
+ || @opt.act[:qrcode][:set]==:on \
+ || @opt.act[:hash_digests][:set]==:on \
+ || @opt.act[:manifest][:set]==:on \
+ || @opt.act[:scp][:set]==:on \
+ || @opt.act[:webrick][:set]==:on \
+ || @opt.act[:zap][:set]==:on) \
+ ? (:true)
+ : (:false)
+ end
if @opt.act[:harvest][:set]==:on
require_relative 'harvest' # harvest.rb
SiSU_Harvest::Source.new(@opt).read # -h -H html.rb
elsif @opt.mod.inspect =~/--convert|--to|--from/
require_relative 'sst_convert_markup' # sst_convert_markup.rb
+ elsif action_on_file_ == :false \
+ and (@opt.act[:psql][:set]==:on \
+ or @opt.act[:sqlite][:set]==:on)
+ if @opt.act[:psql][:set]==:on
+ require_relative 'dbi'
+ SiSU_DBI::SQL.new(@opt).connect
+ end
+ if @opt.act[:sqlite][:set]==:on
+ require_relative 'dbi'
+ SiSU_DBI::SQL.new(@opt).connect
+ end
elsif action_on_file_ == :true \
or (
@opt.cmd =~/^-/ \
diff --git a/lib/sisu/v4/manifest.rb b/lib/sisu/v4/manifest.rb
index cb34a3d3..c8103a0a 100644
--- a/lib/sisu/v4/manifest.rb
+++ b/lib/sisu/v4/manifest.rb
@@ -113,11 +113,9 @@ module SiSU_Manifest
@fnb=md.fnb
@base_url="#{@env.url.root}/#{@fnb}"
@o_str=SiSU_Env::FileOp.new(md).output_dir_structure
- @image_path=if @o_str.dump_or_redirect?
- './image'
- else
- %{#{@f.path_rel_links.html_scroll_2}_sisu/image_sys}
- end
+ @image_path=(@o_str.dump_or_redirect?) \
+ ? './image'
+ : %{#{@f.path_rel_links.html_scroll_2}_sisu/image_sys}
@base_path=@f.output_path.manifest.dir
@@dg ||=SiSU_Env::InfoEnv.new.digest.type
@dg=@@dg
@@ -785,10 +783,9 @@ WOK
minitoc=SiSU_HTML_MiniToc::TocMini.new(@md,data).songsheet.join("\n")
id,file='',''
vz=SiSU_Viz::Defaults.new
- search_form=if make.build.search_form?
- "<td>#{@env.widget_static.search_form}</td>"
- else ''
- end
+ search_form=(make.build.search_form?) \
+ ? "<td>#{@env.widget_static.search_form}</td>"
+ : ''
format_head_toc=SiSU_HTML_Format::HeadToc.new(@md)
@manifest[:html] <<<<WOK
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
@@ -826,10 +823,18 @@ WOK
<div>
WOK
end
+ harvest=(FileTest.file?("#{@f.output_path.manifest.dir}/authors.html") \
+ && FileTest.file?("#{@f.output_path.manifest.dir}/topics.html")) \
+ ? %{<p class="small">other document manifests: [<a href="authors.html">authors</a>] [<a href="topics.html">topics</a>]</p>}
+ : ''
+ manifest_title=%{<p class="bold">#{@translate.manifest_description}</p>#{harvest}}
@manifest[:html] <<<<WOK
-<h1 class="small">#{@translate.manifest_description}</h1>
-<h2 class="small">#{@md.title.full}</h2>
+<div id="horizontal_links">
+#{manifest_title}
+</div>
+<h1 class="small">#{@md.title.full}</h1>
<p class="bold">#{@md.author}</p>
+<div id="horizontal_links"><p class="bold">
<p class="small">
&nbsp;&nbsp;<a href="#output">Document, Available Filetypes</a>
</p>
@@ -839,6 +844,7 @@ WOK
<p class="tiny">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#links">metadata suggested links (if any)</a>
</p>
+</div>
<table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">
WOK
published_versions
diff --git a/lib/sisu/v4/param.rb b/lib/sisu/v4/param.rb
index 375e2af8..360625e4 100644
--- a/lib/sisu/v4/param.rb
+++ b/lib/sisu/v4/param.rb
@@ -1154,8 +1154,12 @@ module SiSU_Param
tf="@title: #{tf}"
@title=SiSU_Param::Parameters::Md.new(tf.strip,@opt,@env).title
end
- @html_title=@title.full.gsub(/(<p>|<p \/>|<br>|<br \/>)/,'')
- SiSU_Screen::Ansi.new(@opt.cmd,'Parameters',@html_title).txt_grey if @opt.cmd =~/v/
+ creator=(defined? @creator.author \
+ && @creator.author.is_a?(String)) \
+ ? " #{@creator.author}"
+ : ''
+ title=%{"#{@title.full.gsub(/(<p>|<p \/>|<br>|<br \/>)/,'')}",}
+ SiSU_Screen::Ansi.new(@opt.cmd,'Parameters',%{#{title}#{creator}}).txt_grey if @opt.cmd =~/v/
end
if not @book_idx \
and para =~/^=\{(.+?)\}\s*$/
diff --git a/lib/sisu/v4/remote.rb b/lib/sisu/v4/remote.rb
index 0da44697..1ef40898 100644
--- a/lib/sisu/v4/remote.rb
+++ b/lib/sisu/v4/remote.rb
@@ -68,9 +68,9 @@ module SiSU_Remote
@opt=opt
@dir=SiSU_Env::InfoEnv.new(@opt.fns)
@put=(@opt.fns =~/\.ssm\.sst$/) \
- ? @opt.fns.gsub(/(.+)?\.ssm\.sst$/,'\1.ssm')
- : @opt.fns
- @remote=SiSU_Env::InfoRemote.new(@opt)
+ ? opt.fns.gsub(/(.+)?\.ssm\.sst$/,'\1.ssm')
+ : opt.fns
+ @remote=SiSU_Env::InfoRemote.new(opt)
end
def rsync
SiSU_Screen::Ansi.new(@opt.cmd,'Remote placement ->',@put).dark_grey_title_hi unless @opt.cmd =~/q/
diff --git a/lib/sisu/v4/sysenv.rb b/lib/sisu/v4/sysenv.rb
index 5647efd7..7fc11eb6 100644
--- a/lib/sisu/v4/sysenv.rb
+++ b/lib/sisu/v4/sysenv.rb
@@ -873,19 +873,20 @@ module SiSU_Env
elsif @cmd =~/v/; 'v'
else ''
end
- msg=''
- msg=" && echo 'OK: #{@input} -> #{@output}'" unless @cmd =~/q/
+ cX=SiSU_Screen::Ansi.new(@cmd).cX
+ msg=(@cmd =~/q/) ? '' : %{ && echo " #{cX.grey}OK: #{@input} -> #{@output}#{cX.off}"}
+ amp=(@cmd =~/[vVM]/) ? '' : '&'
rsync_cmd="rsync -az#{vb} #{action} #{@input} #{@output}"
puts rsync_cmd if @cmd =~/[vVM]/
dir_change,dir_return='',''
- if chdir \
+ if not chdir.nil? \
&& chdir != Dir.pwd
dir_change=Dir.chdir(chdir)
dir_return=Dir.pwd
end
dir_change
system("
- #{rsync_cmd} #{msg}
+ #{rsync_cmd} #{msg} #{amp}
")
dir_return
else STDERR.puts "\t*WARN* #{program} not found"
@@ -2900,121 +2901,124 @@ WOK
@env=(@opt.fns && !(@opt.fns.empty?) \
? (SiSU_Env::InfoEnv.new(@opt.fns))
: (SiSU_Env::InfoEnv.new('dummy.sst')))
- if @opt.cmd =~/m/; @md=SiSU_Param::Parameters.new(@opt).get
- end
ft=[]
- if @md \
- and defined? @md.fn \
- and @md.fn # used for by_language_code?
- if @md.opt.cmd =~ /[hH]/
- ft << @md.fn[:html]
- end
- if @md.opt.cmd =~ /w/ \
- and @md.opt.cmd !~ /[hH]/
- ft << @md.fn[:concordance]
- end
- if @md.opt.cmd =~ /y/ \
- and @md.opt.cmd !~ /[hH]/
- ft << @md.fn[:manifest]
- end
- if @md.opt.cmd =~ /[at]/; ft << @md.fn[:plain]
- end
- if @md.opt.cmd =~ /b/; ft << @md.fn[:xhtml]
- end
- if @md.opt.cmd =~ /e/; ft << @md.fn[:epub]
- end
- if @md.opt.cmd =~ /g/; ft << @md.fn[:wiki]
- end
- if @md.opt.cmd =~ /i/; ft << @md.fn[:manpage]
- end
- if @md.opt.cmd =~ /N/; ft << @md.fn[:digest]
- end
- if @md.opt.cmd =~ /o/; ft << @md.fn[:odf]
- end
- if @md.opt.cmd =~ /O/; ft << @md.fn[:oai_pmh]
- end
- if @md.opt.cmd =~ /p/; ft << @md.fn[:pdf_l] << @md.fn[:pdf_p]
- end
- if @md.opt.cmd =~ /s/; ft << @md.fns
- end
- if @md.opt.cmd =~ /S/; ft << @md.fn[:sisupod] << '.kdi'
- end
- if @md.opt.cmd =~ /x/; ft << @md.fn[:sax]
- end
- if @md.opt.cmd =~ /X/; ft << @md.fn[:dom]
- end
- if @md.opt.cmd =~ /G/; ft << @md.fn[:pot]
- end
- @fnb=@md.fnb
- else # still needed where/when param is not parsed
- if @opt.cmd =~ /[hH]/; ft << '.html' << '.html.??'
- end
- if @opt.cmd =~ /w/ \
- and @opt.cmd !~ /[hH]/
- ft << 'concordance.html' << '??.concordance.html' << 'concordance.??.html'
- end
- if @opt.cmd =~ /y/ \
- and @opt.cmd !~ /[hH]/
- ft << 'sisu_manifest.html' << '??.sisu_manifest.html' << 'sisu_manifest.??.html'
- end
- if @opt.cmd =~ /a/; ft << 'plain.txt' << '??.plain.txt' << 'plain.??.txt'
- end
- if @opt.cmd =~ /b/; ft << 'scroll.xhtml' << '??.scroll.xhtml' << 'scroll.??.xhtml'
- end
- if @opt.cmd =~ /e/; ft << @fnb << '.epub'
- end
- if @opt.cmd =~ /g/; ft << 'wiki.txt' << '??.wiki.txt' << 'wiki.??.txt'
- end
- if @opt.cmd =~ /i/; ft << '.1' << '??.man.1' << 'man.??.1'
- end
- if @opt.cmd =~ /N/; ft << 'digest.txt' << '??.digest.txt' << 'digest.??.txt'
- end
- if @opt.cmd =~ /o/; ft << 'opendocument.odt' << '??.opendocument.odt' << 'opendocument.??.odt'
- end
- if @opt.cmd =~ /O/; ft << 'oai_pmh.xml'
- end
- if @opt.cmd =~ /p/; ft << 'landscape.pdf' << 'portrait.pdf' << '.pdf'
- end
- if @opt.cmd =~ /s/; ft << '.sst' << '.ssi' << '.ssm'
- end
- if @opt.cmd =~ /S/; ft << '.zip' << '.kdi'
- end
- if @opt.cmd =~ /x/; ft << 'sax.xml' << '??.sax.xml' << 'sax.??.xml'
- end
- if @opt.cmd =~ /X/; ft << 'dom.xml' << '??.dom.xml' << 'dom.??.xml'
- end
- if @opt.mod.inspect =~ /sxm|sxs|xml/; ft << @fnb << '.sxs.xml'
- end
- if @opt.mod.inspect =~ /sxd/; ft << @fnb << '.sxd.xml'
- end
- if @opt.mod.inspect =~ /sxn/; ft << @fnb << '.sxn.xml'
+ if @opt.act[:dal][:set]==:on
+ @md=SiSU_Param::Parameters.new(@opt).get
+ if @md \
+ and defined? @md.fn \
+ and @md.fn # used for by_language_code?
+ if @md.opt.cmd =~ /[hH]/
+ ft << @md.fn[:html]
+ end
+ if @md.opt.cmd =~ /w/ \
+ and @md.opt.cmd !~ /[hH]/
+ ft << @md.fn[:concordance]
+ end
+ if @md.opt.cmd =~ /y/ \
+ and @md.opt.cmd !~ /[hH]/
+ ft << @md.fn[:manifest]
+ end
+ if @md.opt.cmd =~ /[at]/; ft << @md.fn[:plain]
+ end
+ if @md.opt.cmd =~ /b/; ft << @md.fn[:xhtml]
+ end
+ if @md.opt.cmd =~ /e/; ft << @md.fn[:epub]
+ end
+ if @md.opt.cmd =~ /g/; ft << @md.fn[:wiki]
+ end
+ if @md.opt.cmd =~ /i/; ft << @md.fn[:manpage]
+ end
+ if @md.opt.cmd =~ /N/; ft << @md.fn[:digest]
+ end
+ if @md.opt.cmd =~ /o/; ft << @md.fn[:odf]
+ end
+ if @md.opt.cmd =~ /O/; ft << @md.fn[:oai_pmh]
+ end
+ if @md.opt.cmd =~ /p/; ft << @md.fn[:pdf_l] << @md.fn[:pdf_p]
+ end
+ if @md.opt.cmd =~ /s/; ft << @md.fns
+ end
+ if @md.opt.cmd =~ /S/; ft << @md.fn[:sisupod] << '.kdi'
+ end
+ if @md.opt.cmd =~ /x/; ft << @md.fn[:sax]
+ end
+ if @md.opt.cmd =~ /X/; ft << @md.fn[:dom]
+ end
+ if @md.opt.cmd =~ /G/; ft << @md.fn[:pot]
+ end
+ @fnb=@md.fnb
+ else # still needed where/when param is not parsed
+ if @opt.cmd =~ /[hH]/; ft << '.html' << '.html.??'
+ end
+ if @opt.cmd =~ /w/ \
+ and @opt.cmd !~ /[hH]/
+ ft << 'concordance.html' << '??.concordance.html' << 'concordance.??.html'
+ end
+ if @opt.cmd =~ /y/ \
+ and @opt.cmd !~ /[hH]/
+ ft << 'sisu_manifest.html' << '??.sisu_manifest.html' << 'sisu_manifest.??.html'
+ end
+ if @opt.cmd =~ /a/; ft << 'plain.txt' << '??.plain.txt' << 'plain.??.txt'
+ end
+ if @opt.cmd =~ /b/; ft << 'scroll.xhtml' << '??.scroll.xhtml' << 'scroll.??.xhtml'
+ end
+ if @opt.cmd =~ /e/; ft << @fnb << '.epub'
+ end
+ if @opt.cmd =~ /g/; ft << 'wiki.txt' << '??.wiki.txt' << 'wiki.??.txt'
+ end
+ if @opt.cmd =~ /i/; ft << '.1' << '??.man.1' << 'man.??.1'
+ end
+ if @opt.cmd =~ /N/; ft << 'digest.txt' << '??.digest.txt' << 'digest.??.txt'
+ end
+ if @opt.cmd =~ /o/; ft << 'opendocument.odt' << '??.opendocument.odt' << 'opendocument.??.odt'
+ end
+ if @opt.cmd =~ /O/; ft << 'oai_pmh.xml'
+ end
+ if @opt.cmd =~ /p/; ft << 'landscape.pdf' << 'portrait.pdf' << '.pdf'
+ end
+ if @opt.cmd =~ /s/; ft << '.sst' << '.ssi' << '.ssm'
+ end
+ if @opt.cmd =~ /S/; ft << '.zip' << '.kdi'
+ end
+ if @opt.cmd =~ /x/; ft << 'sax.xml' << '??.sax.xml' << 'sax.??.xml'
+ end
+ if @opt.cmd =~ /X/; ft << 'dom.xml' << '??.dom.xml' << 'dom.??.xml'
+ end
+ if @opt.mod.inspect =~ /sxm|sxs|xml/; ft << @fnb << '.sxs.xml'
+ end
+ if @opt.mod.inspect =~ /sxd/; ft << @fnb << '.sxd.xml'
+ end
+ if @opt.mod.inspect =~ /sxn/; ft << @fnb << '.sxn.xml'
+ end
end
+ ft=ft.uniq
+ filetypes=ft.join(',')
+ @filetypes=if filetypes !~/..+/; '' # -r called alone, copy all
+ elsif @opt.cmd =~/u/; '' # -u added, copy all, (used to create remote directory tree see output path), not the usual function of -u
+ elsif filetypes =~/\S+?,\S+/; '*{' + filetypes + '}' # more than one relevant file type
+ else '*' + filetypes # one relevant file type
+ end
+ @source_path=(@fnb && !(@fnb.empty?) \
+ ? "#{@env.path.output}/#{@fnb}"
+ : @env.path.output)
+ @source_path_epub=(@fnb && !(@fnb.empty?) \
+ ? "#{@env.path.output}/epub"
+ : @env.path.output_epub)
+ @source_path_src=(@fnb && !(@fnb.empty?) \
+ ? "#{@env.path.output}/src"
+ : @env.path.output_src)
+ @source_path_pod=(@fnb && !(@fnb.empty?) \
+ ? "#{@env.path.output}/pod"
+ : @env.path.output_pod)
+ @source_path_harvest=(@fnb && !(@fnb.empty?) \
+ ? "#{@env.path.output}/manifest"
+ : @env.path.output_harvest)
+ @local_sisu_source=(@filetypes =~/\S/) \
+ ? "#{@source_path}/#{@filetypes}"
+ : @source_path
+ end
+ if @opt.act[:rsync][:set]==:on
end
- ft=ft.uniq
- filetypes=ft.join(',')
- @filetypes=if filetypes !~/..+/; '' # -r called alone, copy all
- elsif @opt.cmd =~/u/; '' # -u added, copy all, (used to create remote directory tree see output path), not the usual function of -u
- elsif filetypes =~/\S+?,\S+/; '*{' + filetypes + '}' # more than one relevant file type
- else '*' + filetypes # one relevant file type
- end
- @source_path=(@fnb && !(@fnb.empty?) \
- ? "#{@env.path.output}/#{@fnb}"
- : @env.path.output)
- @source_path_epub=(@fnb && !(@fnb.empty?) \
- ? "#{@env.path.output}/epub"
- : @env.path.output_epub)
- @source_path_src=(@fnb && !(@fnb.empty?) \
- ? "#{@env.path.output}/src"
- : @env.path.output_src)
- @source_path_pod=(@fnb && !(@fnb.empty?) \
- ? "#{@env.path.output}/pod"
- : @env.path.output_pod)
- @source_path_harvest=(@fnb && !(@fnb.empty?) \
- ? "#{@env.path.output}/manifest"
- : @env.path.output_harvest)
- @local_sisu_source=(@filetypes =~/\S/) \
- ? "#{@source_path}/#{@filetypes}"
- : @source_path
end
end
class CleanOutput
@@ -3254,7 +3258,9 @@ WOK
self
end
def rsync
- @f=SiSU_Env::FileOp.new(@md)
+ @f=(@opt.act[:dal][:set]==:on) \
+ ? SiSU_Env::FileOp.new(@md)
+ : nil
def document
self.remote_host_base.each do |remote_conn|
local_gen=@source_path
@@ -3372,10 +3378,6 @@ WOK
&& (@md.ec[:image].length > 0)
local_css=@f.output_path.css.rel
images_system='_sisu/image_sys'
- if @f.output_path.images.rel.length > 0 \
- && images_from_skin.length > 0
- images_skin=@f.place_file.images.rel + '/' + images_from_skin.join(" #{@f.output_path.images.rel}/")
- end
end
begin
##create file structure without copying files?:
@@ -3404,27 +3406,25 @@ WOK
end
end
def site_base #base site
+ ldest='_sisu/*'
+ l_rel="#{@env.path.webserv}/#{@env.path.stub_pwd}"
+ image_sys="#{@env.path.webserv}/_sisu/image_sys"
+ images="#{@env.path.webserv}/_sisu/image"
+ self.remote_host_base.each do |remote_conn|
+ remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}"
+ remote_conf="#{remote_conn[:name]}/_sisu"
+ SiSU_Env::SystemCall.new(image_sys,remote_conf).rsync
+ SiSU_Env::SystemCall.new(ldest,remote).rsync('--relative',l_rel)
+ end
+ end
+ def site_harvest
ldest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu"
image_sys="#{@env.path.webserv}/_sisu/image_sys"
images="#{@env.path.webserv}/_sisu/image"
self.remote_host_base.each do |remote_conn|
remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}/."
remote_conf="#{remote_conn[:name]}/_sisu"
- if defined? @rc['permission_set']['remote_base_site'] \
- and @rc['permission_set']['remote_base_site'] \
- and @@flag_remote==true \
- and @opt.cmd !~/U/
- SiSU_Env::SystemCall.new("#{image_sys}","#{remote_conf}").rsync
- SiSU_Env::SystemCall.new("#{images}","#{remote_conf}").rsync
- SiSU_Env::SystemCall.new("#{ldest}","#{remote}").rsync
- elsif @opt.cmd =~/U/
- puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
- puts "rsync_base: #{local} -> #{remote}"
- puts "#{local}/_sisu/image -> #{remote}"
- puts "#{local}/_sisu/image_sys/ -> #{remote}"
- puts "#{local}/#{@env.path.style}/ -> #{remote}"
- else puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
- end
+ SiSU_Env::SystemCall.new("#{harvest}","#{remote_manifest}").rsync
end
end
def site_base_sync
@@ -3469,10 +3469,27 @@ WOK
def rsync_harvest
self.remote_host_base.each do |remote_conn|
local=@source_path_harvest
- remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}/."
- if @@flag_remote
+ @env=SiSU_Env::InfoEnv.new
+ harvest_pth,file='',''
+ lng='en'
+ if @env.output_dir_structure.by? == :language
+ harvest_out_pth="#{@env.path.webserv}/#{@opt.base_stub}/#{lng}/manifest"
+ harvest_pth="#{@opt.base_stub}/#{lng}/manifest"
+ files="#{harvest_out_pth}/authors.html #{harvest_out_pth}/topics.html"
+ elsif @env.output_dir_structure.by? == :filetype
+ harvest_out_pth="#{@env.path.webserv}/#{@opt.base_stub}/manifest"
+ harvest_pth="#{@opt.base_stub}/manifest"
+ files="#{harvest_out_pth}/authors.#{lng}.html #{harvest_out_pth}/topics.#{lng}.html"
+ elsif @env.output_dir_structure.by? == :filename
+ harvest_out_pth="#{@env.path.webserv}/#{@opt.base_stub}"
+ harvest_pth="#{@opt.base_stub}"
+ files="#{harvest_out_pth}/authors.#{lng}.html #{harvest_out_pth}/topics.#{lng}.html"
+ end
+ remote="#{remote_conn[:name]}/#{harvest_pth}/."
+ if @opt.act[:harvest][:set] \
+ && @opt.act[:rsync][:set]
delete_extra_files='--delete' # '--delete-after'
- SiSU_Env::SystemCall.new(local,remote).rsync(delete_extra_files)
+ SiSU_Env::SystemCall.new(files,remote).rsync(delete_extra_files)
elsif @opt.cmd =~/U/
puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
puts "rsync_sitemaps: #{local} -> #{remote}"
diff --git a/lib/sisu/v4/xhtml.rb b/lib/sisu/v4/xhtml.rb
index bd04b3f4..c6dca8fb 100644
--- a/lib/sisu/v4/xhtml.rb
+++ b/lib/sisu/v4/xhtml.rb
@@ -93,7 +93,7 @@ module SiSU_XHTML
else "[#{@opt.f_pth[:lng_is]}] #{@opt.fno}"
end
@opt.cmd=~/[MVvz]/ \
- ? SiSU_Screen::Ansi.new(@opt.cmd,'invert','XHTML',tool).colorize
+ ? SiSU_Screen::Ansi.new(@opt.cmd,'XHTML',tool).green_hi_blue
: SiSU_Screen::Ansi.new(@opt.cmd,'XHTML',tool).green_title_hi
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
diff --git a/lib/sisu/v4/xml.rb b/lib/sisu/v4/xml.rb
index 7a788257..e82fe58c 100644
--- a/lib/sisu/v4/xml.rb
+++ b/lib/sisu/v4/xml.rb
@@ -91,7 +91,7 @@ module SiSU_XML_SAX
else "[#{@opt.f_pth[:lng_is]}] #{@opt.fno}"
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_hi_blue
: 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.dir}/#{@md.file.base_filename.xml_sax}").flow if @opt.cmd =~/[MV]/
end
diff --git a/lib/sisu/v4/xml_dom.rb b/lib/sisu/v4/xml_dom.rb
index 822566db..a5aafd03 100644
--- a/lib/sisu/v4/xml_dom.rb
+++ b/lib/sisu/v4/xml_dom.rb
@@ -92,7 +92,7 @@ module SiSU_XML_DOM
else "[#{@opt.f_pth[:lng_is]}] #{@opt.fno}"
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_hi_blue
: 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.dir}/#{@md.file.base_filename.xml_dom}").flow if @opt.cmd =~/[MV]/
end