aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v4/epub_format.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v4/epub_format.rb')
-rw-r--r--lib/sisu/v4/epub_format.rb38
1 files changed, 22 insertions, 16 deletions
diff --git a/lib/sisu/v4/epub_format.rb b/lib/sisu/v4/epub_format.rb
index 60c40dea..84d32000 100644
--- a/lib/sisu/v4/epub_format.rb
+++ b/lib/sisu/v4/epub_format.rb
@@ -1287,10 +1287,10 @@ application/epub+zip
</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}"
+ def sections(dob,fn_base)
+ name=fn_base + Sfx[:epub_xhtml]
+ dir_epub_cont=@md.env.processing_path.epub + '/' + Ep[:d_oebps]
+ segfilename=dir_epub_cont + '/' + name
output_epub_cont_seg=File.new(segfilename,'w')
output_epub_cont_seg << %{#{doc_type}
<head>
@@ -1396,8 +1396,9 @@ output_epub_cont_seg.close
</navPoint>
WOK
end
- def navpoint(dob,no,name=nil)
- name=name ? name : dob.name
+ def navpoint(dob,no,fn_base,hashtag=nil)
+ fn=fn_base + Sfx[:epub_xhtml]
+ name=hashtag ? fn + hashtag : fn
id_u=DISABLE[:epub][:ncx_navpoint_unique_id] \
? ''
: "-#{no}"
@@ -1593,7 +1594,7 @@ output_epub_cont_seg.close
end
def manifest_content_sisu_toc
<<-WOK
- <item id="index" href="index.xhtml" media-type="application/xhtml+xml" />
+ <item id="index#{Sfx[:epub_xhtml]}" href="index#{Sfx[:epub_xhtml]}" media-type="application/xhtml+xml" />
WOK
end
def manifest_cover_image_information(md)
@@ -1606,10 +1607,11 @@ output_epub_cont_seg.close
else ''
end
end
- def manifest_content(dob,name=nil)
- name=name ? name : dob.name
+ def manifest_content(dob,fn_base,hashtag=nil)
+ fn=fn_base + Sfx[:epub_xhtml]
+ name=hashtag ? fn + hashtag : fn
<<-WOK
- <item id="#{name}" href="#{name}#{Sfx[:epub_xhtml]}" media-type="application/xhtml+xml" />
+ <item id="#{name}" href="#{name}" media-type="application/xhtml+xml" />
WOK
end
def manifest_images(imgs)
@@ -1643,11 +1645,12 @@ output_epub_cont_seg.close
end
def spine_sisu_toc
<<-WOK
- <itemref idref="index" linear="yes" />
+ <itemref idref="index#{Sfx[:epub_xhtml]}" linear="yes" />
WOK
end
- def spine(dob,name=nil)
- name=name ? name : dob.name
+ def spine(dob,fn_base,hashtag=nil)
+ fn=fn_base + Sfx[:epub_xhtml]
+ name=hashtag ? fn + hashtag : fn
<<-WOK
<itemref idref="#{name}" linear="yes" />
WOK
@@ -1670,13 +1673,16 @@ output_epub_cont_seg.close
end
def guide_sisu_toc
<<-WOK
- <reference type="index" href="index#{Sfx[:epub_xhtml]}" />
+ <reference type="index#{Sfx[:epub_xhtml]}" href="index#{Sfx[:epub_xhtml]}" />
WOK
end
- def guide(dob,name=nil)
+ def guide(dob,fn_base,hashtag=nil)
+ fn=fn_base + Sfx[:epub_xhtml]
+ name=hashtag ? fn + hashtag : fn
name=name ? name : dob.name
+ guide_name=(name =~/#{Sfx[:epub_xhtml]}/) ? name : (name + Sfx[:epub_xhtml])
<<-WOK
- <reference type="text" href="#{name}#{Sfx[:epub_xhtml]}" />
+ <reference type="text" href="#{guide_name}" />
WOK
end
def guide_close