From f8820c25acc82ee18bd53d8763a58365854414b3 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 14 Mar 2013 23:35:17 -0400 Subject: v4: manifest, links for output_by? alternatives, harvest & qrcode related --- lib/sisu/v4/manifest.rb | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v4/manifest.rb b/lib/sisu/v4/manifest.rb index c8103a0a..1f5724c5 100644 --- a/lib/sisu/v4/manifest.rb +++ b/lib/sisu/v4/manifest.rb @@ -124,6 +124,9 @@ module SiSU_Manifest @translate=SiSU_Translate::Source.new(md,@language) @brace_url=SiSU_Viz::Defaults.new.url_decoration @stylesheet=SiSU_Style::CSS_HeadInfo.new(md).stylesheet + @fn_lng=(@f.output_dir_structure.by_language_code?) \ + ? '' + : ('.' + md.opt.lng) end def output manifest=@f.write_file.manifest @@ -448,12 +451,15 @@ module SiSU_Manifest end end def qrc_image - fn=@md.fnb - pth=(@o_str.dump_or_redirect?) \ + fn=(@f.output_dir_structure.by_filename?) \ + ? 'sisu_manifest' + : @md.fnb + pth=((@o_str.dump_or_redirect?) \ + || (@f.output_dir_structure.by_filename?)) \ ? '.' : 'qrcode' - img_md="#{pth}/#{fn}.md.png" - img_title="#{pth}/#{fn}.title.png" + img_md="#{pth}/#{fn}#{@fn_lng}.md.png" + img_title="#{pth}/#{fn}#{@fn_lng}.title.png" if FileTest.file?(@f.place_file.qrcode_md.dir)==true @manifest[:html] <<< @@ -823,9 +829,18 @@ WOK
WOK end - harvest=(FileTest.file?("#{@f.output_path.manifest.dir}/authors.html") \ - && FileTest.file?("#{@f.output_path.manifest.dir}/topics.html")) \ - ? %{

other document manifests: [authors] [topics]

} + if @o_str.dump_or_redirect? + elsif @f.output_dir_structure.by_language_code? \ + or @f.output_dir_structure.by_filetype? + pth_local=@f.output_path.manifest.dir + pth_rel='./' + else + pth_local=@f.output_path.base.dir + pth_rel='../' + end + harvest=(FileTest.file?("#{pth_local}/authors#{@fn_lng}.html") \ + && FileTest.file?("#{pth_local}/topics#{@fn_lng}.html")) \ + ? %{

other document manifests: [authors] [topics]

} : '' manifest_title=%{

#{@translate.manifest_description}

#{harvest}} @manifest[:html] <<<