From e70f6340ee6c3e294468f15ed72ff69508b8f679 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 13 Sep 2011 19:21:46 -0400 Subject: v3: epub * fix for different output structures, language codes not used internally (within epub) * adjustment to image paths for image copy --- lib/sisu/v3/epub.rb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'lib/sisu/v3/epub.rb') diff --git a/lib/sisu/v3/epub.rb b/lib/sisu/v3/epub.rb index 12ec1ce0..c1dcacec 100644 --- a/lib/sisu/v3/epub.rb +++ b/lib/sisu/v3/epub.rb @@ -338,7 +338,7 @@ module SiSU_EPUB title=if dob.obj !~/Document Information/; linkname else link='metadata' - %{#{linkname}} + %{#{linkname}} end toc={} txt_obj={ txt: title } @@ -423,13 +423,13 @@ module SiSU_EPUB linkname,ocn=dob.obj.strip,dob.ocn p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,ocn) if ocn if dob.ln==4 - seg_link=%{ + seg_link=%{ #{dob.obj} } @@seg_url=dob.name elsif dob.obj =~/\d+.\d+.\d+.\d+|\d+.\d+.\d+|\d+.\d+|\d+/ seg_link=dob.obj.gsub(/^(\d+.\d+.\d+.\d+|\d+.\d+.\d+|\d+.\d+|\d+)(.*)/, - %{} + + %{} + %{\\1 \\2 }) end p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,ocn) if ocn @@ -451,7 +451,7 @@ module SiSU_EPUB if ocn \ and ocn !~/#/ p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,ocn) - lnk_n_txt=%{ + lnk_n_txt=%{ #{linkname} } txt_obj={ txt: lnk_n_txt } @@ -472,7 +472,7 @@ module SiSU_EPUB if ocn \ and ocn !~/#/ p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,ocn) - lnk_n_txt=%{ + lnk_n_txt=%{ #{linkname} } txt_obj={ txt: lnk_n_txt } @@ -660,7 +660,10 @@ module SiSU_EPUB img_pth=@md.env.path.image_source_include @md.ec[:image].each do |x| if FileTest.directory?("#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image") \ - and FileTest.file?("#{img_pth}/#{x}") + && FileTest.file?("#{@md.file.output_path.epub.rel_image}/#{x}") + cp("#{@md.file.output_path.epub.rel_image}/#{x}","#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image") + elsif FileTest.directory?("#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image") \ + && FileTest.file?("#{img_pth}/#{x}") cp("#{img_pth}/#{x}","#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image") end end -- cgit v1.2.3