aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3dv/epub_segments.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3dv/epub_segments.rb')
-rw-r--r--lib/sisu/v3dv/epub_segments.rb34
1 files changed, 4 insertions, 30 deletions
diff --git a/lib/sisu/v3dv/epub_segments.rb b/lib/sisu/v3dv/epub_segments.rb
index 1119d8c8..a9747cd5 100644
--- a/lib/sisu/v3dv/epub_segments.rb
+++ b/lib/sisu/v3dv/epub_segments.rb
@@ -69,26 +69,19 @@ module SiSU_EPUB_Seg
filename_seg=[]
filename_seg << @seg[:title] << @seg[:nav]
if @type=='endnotes'
- @seg[:headings]=[]
- format_head_seg=SiSU_EPUB_Format::HeadSeg.new(@md)
- @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author)
+ @seg[:headings]=[] #watch
txt_obj={ txt: 'Endnotes', ocn_display: ''}
format_seg=SiSU_EPUB_Format::FormatSeg.new(@md,txt_obj)
@seg[:headings] << format_seg.title_heading1
filename_seg << @seg[:heading_endnotes] << @seg[:headings] << %{\n<div class="content">\n} << @seg[:endnote_all] << '</div>'
elsif @type=='idx'
@seg[:headings]=[]
- format_head_seg=SiSU_EPUB_Format::HeadSeg.new(@md)
- @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author)
- txt_obj={ txt: 'Index', ocn_display: ''}
format_seg=SiSU_EPUB_Format::FormatSeg.new(@md,txt_obj)
@seg[:headings] << format_seg.title_heading1
filename_seg << @seg[:heading_idx] << @seg[:headings] << %{\n<div class="content">\n} << @seg[:idx] << '</div>'
elsif @type=='metadata'
metadata=SiSU_Metadata::Summary.new(@md).xhtml_display.metadata
@seg[:headings]=[]
- format_head_seg=SiSU_EPUB_Format::HeadSeg.new(@md)
- @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author)
txt_obj={ txt: 'Metadata', ocn_display: ''}
format_seg=SiSU_EPUB_Format::FormatSeg.new(@md,txt_obj)
@seg[:headings] << format_seg.title_heading1
@@ -104,8 +97,6 @@ WOK
else ''
end
@seg[:headings]=[]
- format_head_seg=SiSU_EPUB_Format::HeadSeg.new(@md)
- @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author)
txt_obj={ txt: 'Manifest', ocn_display: ''}
format_seg=SiSU_EPUB_Format::FormatSeg.new(@md,txt_obj)
@seg[:headings] << format_seg.title_heading1
@@ -131,10 +122,9 @@ WOK
@@loop_count=@@seg_total=@@tracker=0
@@is4=@@is3=@@is2=@@is1=0
@@heading1=@@heading2=@@heading3=@@heading4=0
- @@seg[:nav],@@seg[:title],@@seg[:headings],@@seg[:main],@@seg[:idx],@@seg[:tail],@@seg_subtoc_array,@@seg_endnotes_array,@@seg[:endnote_all]=Array.new(10){[]}
+ @@seg[:headings],@@seg[:main],@@seg[:idx],@@seg[:tail],@@seg_subtoc_array,@@seg_endnotes_array,@@seg[:endnote_all]=Array.new(7){[]}
@@seg[:heading_endnotes]=''
@@tablehead,@@number_of_cols=0,0
- @@segtocband=nil
@@fns_previous=''
attr_reader :seg_name_xhtml,:seg_name_xhtml_tracker
def initialize(md='',data='')
@@ -296,31 +286,16 @@ WOK
data
end
def heading_art(dob)
- format_head_seg=SiSU_EPUB_Format::HeadSeg.new(@md)
- if dob.is=='heading' \
- and dob.ln =~/^[1-6]/
- @@seg[:dot_nav]= (@@tracker < @@seg_total-1) \
- ? format_head_seg.dot_control_pre_next
- : format_head_seg.dot_control_pre
- end
- @@seg[:title]=format_head_seg.head
+ @@seg[:title]=SiSU_EPUB_Format::HeadSeg.new(@md).head
end
def head(dob)
clean=/<!.*?!>|<:.*?>$/
- format_head_seg=SiSU_EPUB_Format::HeadSeg.new(@md)
- if @@tracker < @@seg_total-1
- @@segtocband=(@@tracker==0) \
- ? format_head_seg.toc_next2
- : format_head_seg.toc_pre_next2
- else @@segtocband=format_head_seg.toc_pre2 #if format_head_seg.toc_pre2
- end
@p_num ||= ''
if @@is1==1
if defined? @md.creator.author \
and @md.creator.author
@author=%{<b>#{@md.creator.author}</b>\n}
end
- @@seg[:nav] << format_head_seg.navigation_band(@@segtocband)
ocn=if @@heading1[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#{@dp}:#{@dp}#{Mx[:id_c]}$/]; $1 #fix
else ''
end
@@ -451,8 +426,7 @@ WOK
@@seg[:close] << format_head_seg.xhtml_close
end
def reinitialise
- @@seg[:title],@@seg[:dot_nav],@@seg[:nav],@@seg[:headings],@@seg[:main],@@seg[:tail],@@seg[:credits]=Array.new(8){[]}
- @@segtocband=nil
+ @@seg[:headings],@@seg[:main],@@seg[:tail],@@seg[:credits]=Array.new(4){[]}
end
def cleanup
reinitialise