diff options
author | Ralph Amissah <ralph@amissah.com> | 2011-09-13 19:29:10 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2011-09-13 19:29:10 -0400 |
commit | ce02177eb0a7a053e9eeebc965dbee9bbfda101e (patch) | |
tree | 0cb1f18b66f70706c2da8eade87bc8e394b76c06 /lib/sisu/v3/epub.rb | |
parent | debian/changelog (3.0.17-1) (diff) | |
parent | v3: epub (diff) |
Merge commit 'sisu-3.0.18' into debian/sid
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 |