aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/epub_format.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3/epub_format.rb')
-rw-r--r--lib/sisu/v3/epub_format.rb63
1 files changed, 40 insertions, 23 deletions
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
@@ -1322,6 +1322,32 @@ WOK
</container>
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}
+<head>
+ <title>
+ #{dob.obj} -
+ #{@md.html_title}
+ </title>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+#{@css.xhtml_epub}
+</head>
+#{@vz.color_body}
+<div class="content">
+<div class="substance">
+ <label class="ocn"><a href="#o8" class="lnkocn">8</a></label>
+ <h1 class="norm" id="o8">
+ #{dob.obj}
+ </h1>
+</div>
+</body>
+</html>}
+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
open
@@ -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]
<<WOK
<!-- four required metadata items (for all NCX documents,
(including the relaxed constraints of OPS 2.0) -->
@@ -1404,19 +1430,8 @@ WOK
</navPoint>
WOK
end
- def navpoint(dob,no)
- id_u=DISABLE[:epub][:ncx_navpoint_unique_id] \
- ? '' \
- : "-#{no}"
- <<WOK
- <navPoint id="navpoint#{id_u}" playOrder="#{no}">
- <navLabel>
- <text>#{dob.obj}</text>
- </navLabel>
- <content src="#{dob.name}#{Sfx[:epub_xhtml]}" />
-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
<item id="index" href="index.xhtml" media-type="application/xhtml+xml" />
WOK
end
- def manifest_content(dob)
+ def manifest_content(dob,name=nil)
+ name=name ? name : dob.name
<<WOK
- <item id="#{dob.name}" href="#{dob.name}#{Sfx[:epub_xhtml]}" media-type="application/xhtml+xml" />
+ <item id="#{name}" href="#{name}#{Sfx[:epub_xhtml]}" media-type="application/xhtml+xml" />
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=[" <!-- Images -->\n"]
@@ -1642,9 +1658,10 @@ WOK
<itemref idref="index" linear="yes" />
WOK
end
- def spine(dob)
+ def spine(dob,name=nil)
+ name=name ? name : dob.name
<<WOK
- <itemref idref="#{dob.name}" linear="yes" />
+ <itemref idref="#{name}" linear="yes" />
WOK
end
def spine_close
@@ -1663,9 +1680,10 @@ WOK
<reference type="index" href="index#{Sfx[:epub_xhtml]}" />
WOK
end
- def guide(dob)
+ def guide(dob,name=nil)
+ name=name ? name : dob.name
<<WOK
- <reference type="text" href="#{dob.name}#{Sfx[:epub_xhtml]}" />
+ <reference type="text" href="#{name}#{Sfx[:epub_xhtml]}" />
WOK
end
def guide_close
@@ -2091,8 +2109,7 @@ WOK
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
#{@css.xhtml_epub}
</head>
-#{@vz.color_body}
-#{@vz.js_top}}
+#{@vz.color_body}}
end
def toc_metadata
@metalink=%{./#{@md.fn[:metadata]}}