aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--data/doc/sisu/CHANGELOG_v31
-rw-r--r--data/doc/sisu/CHANGELOG_v41
-rw-r--r--lib/sisu/v3/epub.rb48
-rw-r--r--lib/sisu/v3/epub_format.rb9
-rw-r--r--lib/sisu/v4/epub.rb95
-rw-r--r--lib/sisu/v4/epub_format.rb38
6 files changed, 135 insertions, 57 deletions
diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3
index 63731b1f..e3b717b8 100644
--- a/data/doc/sisu/CHANGELOG_v3
+++ b/data/doc/sisu/CHANGELOG_v3
@@ -40,6 +40,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.3.5.orig.tar.xz
* remove unnecessary conversion of some utf-8 characters to xhtml
representation; fix as messed up table of contents, toc.ncx
(e.g. in calibre) [bug reported by Mikael Böök]
+ * provide full depth epub table of contents [request Mikael Böök]
* cosmetic arrangement of code <<-WOK
* xhtml structure error, fix missing </div>
[bug reported by Mikael Böök] (fix of additional detail)
diff --git a/data/doc/sisu/CHANGELOG_v4 b/data/doc/sisu/CHANGELOG_v4
index 1e253373..f5d9f44a 100644
--- a/data/doc/sisu/CHANGELOG_v4
+++ b/data/doc/sisu/CHANGELOG_v4
@@ -29,6 +29,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_4.0.2.orig.tar.xz
* remove unnecessary conversion of some utf-8 characters to xhtml
representation; fix as messed up table of contents, toc.ncx
(e.g. in calibre) [bug reported by Mikael Böök]
+ * provide full depth epub table of contents [request Mikael Böök]
* cosmetic arrangement of code <<-WOK
* xhtml structure error, fix missing </div>
[bug reported by Mikael Böök] (fix of additional detail)
diff --git a/lib/sisu/v3/epub.rb b/lib/sisu/v3/epub.rb
index c51a7656..fdb1398f 100644
--- a/lib/sisu/v3/epub.rb
+++ b/lib/sisu/v3/epub.rb
@@ -199,7 +199,7 @@ module SiSU_EPUB
@@toc={ seg: [], seg_mini: [], scr: [], ncx: [], opf: [] }
md_opf_a_content,md_opf_a_spine,md_opf_a_guide=[],[],[]
@nav_no=0
- @s_a_no,@s_b_no,@s_c_no=0,0,0
+ @s_a_no,@s_b_no,@s_c_no,@lv5_no,@lv6_no=0,0,0,0,0
@@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
@@toc[:ncx] << @epub.toc_ncx.doc_title << @epub.toc_ncx.doc_author
@@ -228,11 +228,13 @@ module SiSU_EPUB
name_s_a='section_a' + @s_a_no.to_s
@nav_no+=1
@nav_no2=@nav_no
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[3]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[2]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[1]
- @ncxo[1],@ncxo[2],@ncxo[3],@ncxo[4]=true,false,false,false
+ @ncxo[1],@ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=true,false,false,false,false,false
@epub.sections(dob_toc,name_s_a)
@@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,name_s_a) if dob_toc
if @level_a_first_occurrence \
@@ -250,10 +252,12 @@ module SiSU_EPUB
name_s_b='section_b' + @s_b_no.to_s
@nav_no+=1
@nav_no2=@nav_no
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[3]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[2]
- @ncxo[2],@ncxo[3],@ncxo[4]=true,false,false
+ @ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=true,false,false,false,false
@epub.sections(dob_toc,name_s_b)
@@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,name_s_b) if dob_toc
md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,name_s_b)
@@ -265,9 +269,11 @@ module SiSU_EPUB
name_s_c='section_c' + @s_c_no.to_s
@nav_no+=1
@nav_no3=@nav_no
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[3]
- @ncxo[3],@ncxo[4]=true,false
+ @ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=true,false,false,false
@epub.sections(dob_toc,name_s_c)
@@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,name_s_c) if dob_toc
md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,name_s_c)
@@ -277,15 +283,39 @@ module SiSU_EPUB
when 4
@ncx_cls=[]
@nav_no+=1
+ @dob_name=dob.name
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4]
- @ncxo[4]=true
+ @ncxo[4],@ncxo[5],@ncxo[6]=true,false,false
@@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no) if dob_toc
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)
SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_4
- when 5; SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_5
- when 6; SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_6
+ when 5
+ @ncx_cls=[]
+ name_lv5=@dob_name + '.xhtml' + '#o' + dob_toc.ocn.to_s
+ @nav_no+=1
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]
+ @ncxo[5],@ncxo[6]=true,false
+ @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,name_lv5) if dob_toc
+ md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,name_lv5)
+ md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,name_lv5)
+ md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,name_lv5)
+ SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_5
+ when 6
+ @ncx_cls=[]
+ name_lv6=@dob_name + '.xhtml' + '#o' + dob_toc.ocn.to_s
+ @nav_no+=1
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]
+ @ncxo[6]=true
+ @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,name_lv6) if dob_toc
+ md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,name_lv6)
+ md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,name_lv6)
+ md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,name_lv6)
+ SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_6
else nil
end
toc.each do |k,d|
@@ -308,10 +338,12 @@ module SiSU_EPUB
end
end
end
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[3]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[2]
- @ncxo[1],@ncxo[2],@ncxo[3],@ncxo[4]=false,false,false,false
+ @ncxo[1],@ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=false,false,false,false,false,false
md_opf_a_content << @epub.metadata_opf.manifest_images(@md.ec[:image])
@@toc[:seg] << "</div>\n</div>"
@@toc[:scr] << "</div>\n</div>"
diff --git a/lib/sisu/v3/epub_format.rb b/lib/sisu/v3/epub_format.rb
index ee5118e2..38717359 100644
--- a/lib/sisu/v3/epub_format.rb
+++ b/lib/sisu/v3/epub_format.rb
@@ -1398,6 +1398,7 @@ output_epub_cont_seg.close
end
def navpoint(dob,no,name=nil)
name=name ? name : dob.name
+ cont_name=(name =~/#{Sfx[:epub_xhtml]}/) ? name : (name + Sfx[:epub_xhtml])
id_u=DISABLE[:epub][:ncx_navpoint_unique_id] \
? ''
: "-#{no}"
@@ -1406,7 +1407,7 @@ output_epub_cont_seg.close
<navLabel>
<text>#{dob.obj}</text>
</navLabel>
- <content src="#{name}#{Sfx[:epub_xhtml]}" />
+ <content src="#{cont_name}" />
WOK
end
def navpoint_close
@@ -1592,8 +1593,9 @@ output_epub_cont_seg.close
end
def manifest_content(dob,name=nil)
name=name ? name : dob.name
+ href_name=(name =~/#{Sfx[:epub_xhtml]}/) ? name : (name + Sfx[:epub_xhtml])
<<-WOK
- <item id="#{name}" href="#{name}#{Sfx[:epub_xhtml]}" media-type="application/xhtml+xml" />
+ <item id="#{name}" href="#{href_name}" media-type="application/xhtml+xml" />
WOK
end
def manifest_images(imgs)
@@ -1648,8 +1650,9 @@ output_epub_cont_seg.close
end
def guide(dob,name=nil)
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
diff --git a/lib/sisu/v4/epub.rb b/lib/sisu/v4/epub.rb
index d2d5cc6c..1af5ec49 100644
--- a/lib/sisu/v4/epub.rb
+++ b/lib/sisu/v4/epub.rb
@@ -197,7 +197,7 @@ module SiSU_EPUB
@@toc={ seg: [], seg_mini: [], scr: [], ncx: [], opf: [] }
md_opf_a_content,md_opf_a_spine,md_opf_a_guide=[],[],[]
@nav_no=0
- @s_a_no,@s_b_no,@s_c_no=0,0,0
+ @s_a_no,@s_b_no,@s_c_no,@lv5_no,@lv6_no=0,0,0,0,0
@@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
@@toc[:ncx] << @epub.toc_ncx.doc_title << @epub.toc_ncx.doc_author
@@ -230,67 +230,100 @@ module SiSU_EPUB
toc=case dob_toc.ln
when 1
@s_a_no +=1
- name_s_a='section_a' + @s_a_no.to_s
+ lv_name='section_a' + @s_a_no.to_s
@nav_no+=1
@nav_no2=@nav_no
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[3]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[2]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[1]
- @ncxo[1],@ncxo[2],@ncxo[3],@ncxo[4]=true,false,false,false
- @epub.sections(dob_toc,name_s_a)
- @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,name_s_a) if dob_toc
+ @ncxo[1],@ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=true,false,false,false,false,false
+ @epub.sections(dob_toc,lv_name)
+ @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name) if dob_toc
if @level_a_first_occurrence \
&& @make.build.toc?
@nav_no+=1
@@toc[:ncx] << @epub.toc_ncx.navmap_sisu_toc(@nav_no) #epub ncx navmap, toc
@level_a_first_occurrence=false
end
- md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,name_s_a)
- md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,name_s_a)
- md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,name_s_a)
+ md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name)
+ md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,lv_name)
+ md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,lv_name)
SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_1
when 2
@s_b_no +=1
- name_s_b='section_b' + @s_b_no.to_s
+ lv_name='section_b' + @s_b_no.to_s
@nav_no+=1
@nav_no2=@nav_no
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[3]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[2]
- @ncxo[2],@ncxo[3],@ncxo[4]=true,false,false
- @epub.sections(dob_toc,name_s_b)
- @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,name_s_b) if dob_toc
- md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,name_s_b)
- md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,name_s_b)
- md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,name_s_b)
+ @ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=true,false,false,false,false
+ @epub.sections(dob_toc,lv_name)
+ @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name) if dob_toc
+ md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name)
+ md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,lv_name)
+ md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,lv_name)
SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_2
when 3
@s_c_no +=1
- name_s_c='section_c' + @s_c_no.to_s
+ lv_name='section_c' + @s_c_no.to_s
@nav_no+=1
@nav_no3=@nav_no
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[3]
- @ncxo[3],@ncxo[4]=true,false
- @epub.sections(dob_toc,name_s_c)
- @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,name_s_c) if dob_toc
- md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,name_s_c)
- md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,name_s_c)
- md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,name_s_c)
+ @ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=true,false,false,false
+ @epub.sections(dob_toc,lv_name)
+ @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name) if dob_toc
+ md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name)
+ md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,lv_name)
+ md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,lv_name)
SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_3
when 4
@ncx_cls=[]
+ lv_name=dob_toc.name
@nav_no+=1
+ @dob_name=dob.name
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4]
- @ncxo[4]=true
- @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no) if dob_toc
- 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)
+ @ncxo[4],@ncxo[5],@ncxo[6]=true,false,false
+ @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name) if dob_toc
+ md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name)
+ md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,lv_name)
+ md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,lv_name)
SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_4
- when 5; SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_5
- when 6; SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_6
+ when 5
+ @ncx_cls=[]
+ hashtag='#o' + dob_toc.ocn.to_s
+ lv_name=@dob_name
+ @nav_no+=1
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]
+ @ncxo[5],@ncxo[6]=true,false
+ @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name,hashtag) if dob_toc
+ md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name,hashtag)
+ md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,lv_name,hashtag)
+ md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,lv_name,hashtag)
+ SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_5
+ when 6
+ @ncx_cls=[]
+ hashtag='#o' + dob_toc.ocn.to_s
+ lv_name=@dob_name
+ @nav_no+=1
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]
+ @ncxo[6]=true
+ @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name,hashtag) if dob_toc
+ md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name,hashtag)
+ md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,lv_name,hashtag)
+ md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,lv_name,hashtag)
+ SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_6
else nil
end
toc.each do |k,d|
@@ -313,10 +346,12 @@ module SiSU_EPUB
end
end
end
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[3]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[2]
- @ncxo[1],@ncxo[2],@ncxo[3],@ncxo[4]=false,false,false,false
+ @ncxo[1],@ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=false,false,false,false,false,false
md_opf_a_content << @epub.metadata_opf.manifest_images(@md.ec[:image])
@@toc[:seg] << "</div>\n</div>"
@@toc[:scr] << "</div>\n</div>"
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