From 7456ed5b0a4c85c3ea6ab808342689e38e222730 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 3 Oct 2012 00:22:04 -0400 Subject: v4: param (header make), epub, pdf, book cover images --- lib/sisu/v4/epub.rb | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) (limited to 'lib/sisu/v4/epub.rb') diff --git a/lib/sisu/v4/epub.rb b/lib/sisu/v4/epub.rb index e8430aa5..9ac4b610 100644 --- a/lib/sisu/v4/epub.rb +++ b/lib/sisu/v4/epub.rb @@ -208,6 +208,13 @@ module SiSU_EPUB @@toc[:opf] << @epub.metadata_opf.manifest_open @@toc[:seg] << %{
\n
} @@toc[:scr] << %{
\n
} + if defined? @md.make.cover_image \ + and @md.make.cover_image.is_a?(Hash) \ + and @md.make.cover_image[:cover] =~/\S+/ + md_opf_a_content << @epub.metadata_opf.manifest_cover_image_information(@md) + md_opf_a_spine << @epub.metadata_opf.spine_cover_image + md_opf_a_guide << @epub.metadata_opf.guide_cover_image + end md_opf_a_content << @epub.metadata_opf.manifest_content_sisu_toc if @make.build.toc? md_opf_a_spine << @epub.metadata_opf.spine_sisu_toc @@ -546,7 +553,8 @@ module SiSU_EPUB #Segtoc tail added here segtoc << format_head_toc.xhtml_close segtoc=segtoc.flatten.compact #watch - SiSU_EPUB::Source::Output.new(@md,segtoc).segtoc + SiSU_EPUB::Source::Output.new(@md).make_cover_image + SiSU_EPUB::Source::Output.new(@md,segtoc).make_segtoc segtoc=[] @toc[:scr],@toc[:seg]=[],[] toc_shared @@ -654,7 +662,44 @@ module SiSU_EPUB end end end - def segtoc + def make_cover_image + begin + if @md.make.cover_image? \ + and @md.make.cover_image.is_a?(Hash) \ + and @md.make.cover_image[:cover] =~/\S+/ + filename_xhtml=@make_file.epub.xhtml_cover_image + cover_image=< + + + + Cover + + + + + +
+
+ + + +
+
+ + +WOK + filename_xhtml.puts cover_image,"\n" + filename_xhtml.close + end + rescue + SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + __LINE__.to_s + ':' + __FILE__ + end + end + end + def make_segtoc begin if @make.build.toc? filename_xhtml=@make_file.epub.xhtml_index -- cgit v1.2.3