From 90ad666b942b965394f3dcb461177a52a25f90cd Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 18 Aug 2011 23:14:00 -0400 Subject: v3: epub, param, (defaults) epub tuning * include levels A - C as individual sections (xhtml file with consistent opf & ncx) * sync ncx with sisu internal structural logic (correct depth, include level A, place sisu toc) --- lib/sisu/v3/epub_format.rb | 63 +++++++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 23 deletions(-) (limited to 'lib/sisu/v3/epub_format.rb') diff --git a/lib/sisu/v3/epub_format.rb b/lib/sisu/v3/epub_format.rb index 6afae58b..1de067e4 100644 --- a/lib/sisu/v3/epub_format.rb +++ b/lib/sisu/v3/epub_format.rb @@ -1321,6 +1321,32 @@ WOK WOK + end + def sections(dob,name) + filename="#{name}#{Sfx[:epub_xhtml]}" + dir_epub_cont="#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}" + segfilename="#{dir_epub_cont}/#{filename}" + output_epub_cont_seg=File.new(segfilename,'w') + output_epub_cont_seg << %{#{doc_type} + + + #{dob.obj} - + #{@md.html_title} + + +#{@css.xhtml_epub} + +#{@vz.color_body} +
+
+ +

+ #{dob.obj} +

+
+ +} +output_epub_cont_seg.close end def toc_ncx #list of navigation points (like chapters), table of contents, listing each navigation point (chapters and such) under the navigation map def structure @@ -1354,7 +1380,7 @@ WOK WOK end def head - depth=@md.lvs[2] + @md.lvs[3] + @md.lvs[4] + depth=@md.lvs[1] + @md.lvs[2] + @md.lvs[3] + @md.lvs[4] < @@ -1404,19 +1430,8 @@ WOK WOK end - def navpoint(dob,no) - id_u=DISABLE[:epub][:ncx_navpoint_unique_id] \ - ? '' \ - : "-#{no}" - < - - #{dob.obj} - - -WOK - end - def navpoint_top3(dob,no,name) + def navpoint(dob,no,name=nil) + name=name ? name : dob.name id_u=DISABLE[:epub][:ncx_navpoint_unique_id] \ ? '' \ : "-#{no}" @@ -1609,11 +1624,12 @@ WOK WOK end - def manifest_content(dob) + def manifest_content(dob,name=nil) + name=name ? name : dob.name < + WOK - end + end def manifest_images(imgs) imgs=imgs + ['arrow_next_red.png','arrow_prev_red.png','arrow_up_red.png','bullet_09.png'] images=[" \n"] @@ -1642,9 +1658,10 @@ WOK WOK end - def spine(dob) + def spine(dob,name=nil) + name=name ? name : dob.name < + WOK end def spine_close @@ -1663,9 +1680,10 @@ WOK WOK end - def guide(dob) + def guide(dob,name=nil) + name=name ? name : dob.name < + WOK end def guide_close @@ -2091,8 +2109,7 @@ WOK #{@css.xhtml_epub} -#{@vz.color_body} -#{@vz.js_top}} +#{@vz.color_body}} end def toc_metadata @metalink=%{./#{@md.fn[:metadata]}} -- cgit v1.2.3