From 532c0301d456758990609bdf65b718ce2f1f32ca Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 9 Aug 2011 00:06:18 -0400 Subject: v3: epub, constants, experiment with presentation * disable some internal "features" * make file and directory naming more flexible, now using 'OEBPS', 'toc.ncx', 'content.opf', * adjustment of some headers and general tuning * add opf guide * clean processing directory between each build * constants, added constants Ep (for epub) * constants, added DISABLE (used here with epub) --- lib/sisu/v3/epub.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/sisu/v3/epub.rb') diff --git a/lib/sisu/v3/epub.rb b/lib/sisu/v3/epub.rb index 2522b68a..83a0a795 100644 --- a/lib/sisu/v3/epub.rb +++ b/lib/sisu/v3/epub.rb @@ -198,7 +198,7 @@ module SiSU_EPUB toc=nil @@firstseg=nil @@toc={ seg: [], seg_mini: [], scr: [], ncx: [], opf: [] } - md_opf_a_content,md_opf_a_spine=[],[] + md_opf_a_content,md_opf_a_spine,md_opf_a_guide=[],[],[] @nav_no=1 @@toc[:ncx] << @epub.toc_ncx.open #epub ncx navmap @@toc[:ncx] << @epub.toc_ncx.head_open << @epub.toc_ncx.head << @epub.toc_ncx.head_close @@ -212,6 +212,7 @@ module SiSU_EPUB @@toc[:scr] << %{
\n
} md_opf_a_content << @epub.metadata_opf.manifest_content_sisu_toc md_opf_a_spine << @epub.metadata_opf.spine_sisu_toc + md_opf_a_guide << @epub.metadata_opf.guide_sisu_toc @ncxo=[nil,false,false,false,false,false,false] @dob_toc2,@dob_toc3=nil,nil @ncx_cls=[] @@ -254,6 +255,7 @@ module SiSU_EPUB @ncxo[4]=true md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc) md_opf_a_spine << @epub.metadata_opf.spine(dob_toc) + md_opf_a_guide << @epub.metadata_opf.guide(dob_toc) Toc.new(@md,dob_toc).level_4 when 5; Toc.new(@md,dob_toc).level_5 when 6; Toc.new(@md,dob_toc).level_6 @@ -288,6 +290,7 @@ module SiSU_EPUB @@toc[:ncx] << @epub.toc_ncx.close @@toc[:opf] << md_opf_a_content << @epub.metadata_opf.manifest_close @@toc[:opf] << @epub.metadata_opf.spine_open << md_opf_a_spine << @epub.metadata_opf.spine_close + @@toc[:opf] << @epub.metadata_opf.guide_open << md_opf_a_guide << @epub.metadata_opf.guide_close @@toc[:opf] << @epub.metadata_opf.package_close @@toc[:opf]=@@toc[:opf].flatten Epub_output.new(@md,@@toc[:opf]).epub_metadata_opf @@ -629,9 +632,9 @@ module SiSU_EPUB def images img_pth=@md.env.path.image_source_include @md.ec[:image].each do |x| - if FileTest.directory?("#{@md.env.processing_path.epub}/OPS/image") \ + if FileTest.directory?("#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image") \ and FileTest.file?("#{img_pth}/#{x}") - cp("#{img_pth}/#{x}","#{@md.env.processing_path.epub}/OPS/image") + cp("#{img_pth}/#{x}","#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image") end end end -- cgit v1.2.3