diff options
author | Ralph Amissah <ralph@amissah.com> | 2011-09-13 19:21:46 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2011-09-13 19:21:46 -0400 |
commit | e70f6340ee6c3e294468f15ed72ff69508b8f679 (patch) | |
tree | 6b7b3885ebe60377b73251a7b3c54e3cbd0378da /lib/sisu/v3/epub.rb | |
parent | v3: image (relative) paths for different sisu output structures (diff) |
v3: epubsisu_3.0.18sisu-3.0.18
* fix for different output structures, language codes not used
internally (within epub)
* adjustment to image paths for image copy
Diffstat (limited to 'lib/sisu/v3/epub.rb')
-rw-r--r-- | lib/sisu/v3/epub.rb | 15 |
1 files changed, 9 insertions, 6 deletions
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' - %{<b><a href="#{link}#{@md.lang_code_insert}#{Sfx[:epub_xhtml]}">#{linkname}</a></b>} + %{<b><a href="#{link}#{Sfx[:epub_xhtml]}">#{linkname}</a></b>} 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=%{ <a href="#{dob.name}#{@md.lang_code_insert}#{Sfx[:epub_xhtml]}"> + seg_link=%{ <a href="#{dob.name}#{Sfx[:epub_xhtml]}"> #{dob.obj} </a> } @@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+)(.*)/, - %{<a href="\\1#{@md.lang_code_insert}#{Sfx[:epub_xhtml]}">} + + %{<a href="\\1#{Sfx[:epub_xhtml]}">} + %{\\1 \\2</a> }) 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=%{ <a href="#{@@seg_url}#{@md.lang_code_insert}#{Sfx[:epub_xhtml]}#o#{ocn}"> + lnk_n_txt=%{ <a href="#{@@seg_url}#{Sfx[:epub_xhtml]}#o#{ocn}"> #{linkname} </a>} 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=%{ <a href="#{@@seg_url}#{@md.lang_code_insert}#{Sfx[:epub_xhtml]}#o#{ocn}"> + lnk_n_txt=%{ <a href="#{@@seg_url}#{Sfx[:epub_xhtml]}#o#{ocn}"> #{linkname} </a>} 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 |