aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3dv/html.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2012-02-14 21:10:19 -0500
committerRalph Amissah <ralph@amissah.com>2012-02-14 21:17:32 -0500
commit2b884fb73428186df29bf22ff38d77e5d2f823cf (patch)
tree117330ff01c641b19c3963d3e91ce7f19056ca66 /lib/sisu/v3dv/html.rb
parentv3dv: sysenv, output_dir_structure, rewritten, affected code modified (diff)
v3dv: --redirect (--redirect=dir_path) & --dump (--dump=dir_path) + consequences
* --dump places output in directory specified, if none specified in the current directory (pwd). * --redirect places output in subdirectory under specified directory, subdirectory uses the filename (without the suffix). If no output directory is specified places the subdirectory under the current directory (pwd). * html, css incorporated into each file (concordance & manifest included) * html, xhtml & xmls, css copied into css subdirectory (not used by html as embedded) * html xmls, images copied to output directory * no links to manifest * manifest with relative links only * longer html filenames given to avoid names clashing (e.g. for toc, manifest, concordance) * html, epub, remove manifest toc links * -j copy images associated with file (images used by html & xmls) * automatically invoked by --dump & redirect * v3 v3dv: document --redirect, --dump, -j update sisu_commands.sst [documents not generated until v3.2.0 (when v3dv branch is merged into v3)]
Diffstat (limited to 'lib/sisu/v3dv/html.rb')
-rw-r--r--lib/sisu/v3dv/html.rb27
1 files changed, 13 insertions, 14 deletions
diff --git a/lib/sisu/v3dv/html.rb b/lib/sisu/v3dv/html.rb
index ec7b0573..75d89382 100644
--- a/lib/sisu/v3dv/html.rb
+++ b/lib/sisu/v3dv/html.rb
@@ -138,14 +138,10 @@ module SiSU_HTML
def link_images
@symlnk.images
end
- def directories
- title=File.basename(@md.fns,'.rb')
- end
def tuned_file_instructions
@tell=SiSU_Screen::Ansi.new(@md.opt.cmd)
@md.opt.cmd=@md.opt.cmd.gsub(/H/,'h')
- @md.file_type='html' if @md.opt.cmd =~/[hon]/
- directories
+ @md.file_type='html' if @md.opt.cmd =~/[hw]/
newfilename=%{#{@md.file.output_path.html_scroll.dir}/#{@md.file.base_filename.html_segtoc}} if @md.file_type =~/html/
dal_array=@particulars.dal_array # dal file drawn here
@tuned_file_array=SiSU_HTML_Tune::Tune.new(dal_array,@md).songsheet
@@ -611,7 +607,8 @@ WOK
class Output
def initialize(data='',md='')
@data,@md=data,md
- @file=SiSU_Env::FileOp.new(@md)
+ @file=SiSU_Env::FileOp.new(md)
+ @o_str ||=SiSU_Env::OutputStructure.new(md).output_dir_structure
end
def scroll
begin
@@ -646,15 +643,17 @@ WOK
rescue; SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error
ensure
@filename_html_segtoc.close
- unless FileTest.file?("#{@file.output_path.html_seg.dir}/#{@md.file.base_filename.html_seg_index}")
- pwd_set=Dir.pwd
- idx_lnk=@file.base_filename.html_segtoc
- mlnk=@file.base_filename.html_seg_index
- Dir.chdir(@file.output_path.html_seg.dir)
- FileUtils::rm_f(mlnk)
- FileUtils::ln_s(idx_lnk, mlnk)
- Dir.chdir(pwd_set)
+ pwd_set=Dir.pwd
+ idx_lnk=if @o_str.dump_or_redirect?
+ @file.base_filename.manifest
+ else
+ @file.base_filename.html_segtoc
end
+ mlnk=@file.base_filename.html_seg_index
+ Dir.chdir(@file.output_path.html_seg.dir)
+ FileUtils::rm_f(mlnk)
+ FileUtils::ln_s(idx_lnk,mlnk)
+ Dir.chdir(pwd_set)
end
end
end