aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/epub.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2011-03-01 20:41:28 -0500
committerRalph Amissah <ralph@amissah.com>2011-03-01 20:41:28 -0500
commit05a3fd233ec1ac4475bd797449d1284f6824c005 (patch)
treefdd93c057196640ec4907f58f66cf5bc00dfbdf6 /lib/sisu/v3/epub.rb
parentv3: use rb1.9.2 "require_relative" syntax (diff)
v3: ruby 1.9 hash symbol syntax adopted
Diffstat (limited to 'lib/sisu/v3/epub.rb')
-rw-r--r--lib/sisu/v3/epub.rb34
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/sisu/v3/epub.rb b/lib/sisu/v3/epub.rb
index 0465ff86..c39b7800 100644
--- a/lib/sisu/v3/epub.rb
+++ b/lib/sisu/v3/epub.rb
@@ -173,7 +173,7 @@ module SiSU_EPUB
endnote_array = pg.obj.scan(/#{Mx[:en_b_o]}[\d+]+(.+?)#{Mx[:en_b_c]}/m)
end
endnote_array.flatten.each do |note|
- txt_obj={:txt =>note}
+ txt_obj={ txt: note }
format_scroll=SiSU_EPUB_Format::Format_scroll.new(@md,txt_obj)
@scr_endnotes << format_scroll.endnote_body
end
@@ -184,7 +184,7 @@ module SiSU_EPUB
end
end
class Toc
- @@toc={ :seg=>[],:seg_mini=>[],:scr=>[],:ncx=>[],:opf=>[] }
+ @@toc={ seg: [], seg_mini: [], scr: [], ncx: [], opf: [] }
@@seg_url=''
@@firstseg=nil
def initialize(md=nil,data='')
@@ -197,7 +197,7 @@ module SiSU_EPUB
SiSU_Screen::Ansi.new(@md.cmd,'Toc').txt_grey if @md.cmd =~/[MVv]/
toc=nil
@@firstseg=nil
- @@toc={ :seg=>[],:seg_mini=>[],:scr=>[],:ncx=>[],:opf=>[] }
+ @@toc={ seg: [], seg_mini: [], scr: [], ncx: [], opf: [] }
md_opf_a_content,md_opf_a_spine=[],[]
@nav_no=1
@@toc[:ncx] << @epub.toc_ncx.open #epub ncx navmap
@@ -313,7 +313,7 @@ module SiSU_EPUB
%{<b><a href="#{@md.fnl[:pre]}#{link}#{@md.fnl[:mid]}#{Sfx[:epub_xhtml]}#{@md.fnl[:post]}">#{linkname}</a></b>}
end
toc={}
- txt_obj={:txt =>title}
+ txt_obj={ txt: title }
format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj)
toc[:seg]=if dob.name =~/^meta/ \
and dob.obj =~/Document Information/ #check
@@ -341,7 +341,7 @@ module SiSU_EPUB
end
%{<b><a href="##{link}">#{linkname}</a></b>}
end
- txt_obj={:txt =>title}
+ txt_obj={ txt: title }
format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj)
toc[:scr]=if dob.name =~/^meta/ \
and dob.obj =~/Document Information/
@@ -357,14 +357,14 @@ module SiSU_EPUB
and ocn !~/#/
p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,ocn)
end
- txt_obj={:txt =>linkname}
+ txt_obj={ txt: linkname }
format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj)
toc={}
toc[:seg]=format_toc.lev2
toc[:seg_mini]=format_toc.mini_lev2
if p_num
title=%{#{p_num.goto}#{linkname}</a>}
- txt_obj={:txt =>title}
+ txt_obj={ txt: title }
format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj)
toc[:scr]=format_toc.lev2
end
@@ -377,14 +377,14 @@ module SiSU_EPUB
and ocn !~/#/
p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,ocn)
end
- txt_obj={:txt =>linkname}
+ txt_obj={ txt: linkname }
format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj)
toc={}
toc[:seg]=format_toc.lev3
toc[:seg_mini]=format_toc.mini_lev3
if p_num
title=%{#{p_num.goto}#{linkname}</a>}
- txt_obj={:txt =>title}
+ txt_obj={ txt: title }
format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj)
toc[:scr]=format_toc.lev3
end
@@ -405,13 +405,13 @@ module SiSU_EPUB
%{\\1 \\2</a> })
end
p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,ocn) if ocn
- txt_obj={:txt =>seg_link}
+ txt_obj={ txt: seg_link }
format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj)
toc={}
toc[:seg]=format_toc.lev4
toc[:seg_mini]=format_toc.mini_lev4
title=%{#{p_num.goto}#{linkname}</a>} if p_num
- txt_obj={:txt =>title}
+ txt_obj={ txt: title }
format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj)
toc[:scr]=format_toc.lev4
toc
@@ -426,12 +426,12 @@ module SiSU_EPUB
lnk_n_txt=%{ <a href="#{@md.fnl[:pre]}#{@@seg_url}#{@md.fnl[:mid]}#{Sfx[:epub_xhtml]}#{@md.fnl[:post]}#o#{ocn}">
#{linkname}
</a>}
- txt_obj={:txt =>lnk_n_txt}
+ txt_obj={ txt: lnk_n_txt }
format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj)
toc[:seg]=format_toc.lev5
toc[:seg_mini]=format_toc.mini_lev5
title=%{#{p_num.goto}#{linkname}</a>}
- txt_obj={:txt =>title}
+ txt_obj={ txt: title }
format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj)
toc[:scr]=format_toc.lev5
end
@@ -447,12 +447,12 @@ module SiSU_EPUB
lnk_n_txt=%{ <a href="#{@md.fnl[:pre]}#{@@seg_url}#{@md.fnl[:mid]}#{Sfx[:epub_xhtml]}#{@md.fnl[:post]}#o#{ocn}">
#{linkname}
</a>}
- txt_obj={:txt =>lnk_n_txt}
+ txt_obj={ txt: lnk_n_txt }
format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj)
toc[:seg]=format_toc.lev6
toc[:seg_mini]=format_toc.mini_lev6
title=%{#{p_num.goto}#{linkname}</a>}
- txt_obj={:txt =>title}
+ txt_obj={ txt: title }
format_toc=SiSU_EPUB_Format::Format_toc.new(@md,txt_obj)
toc[:scr]=format_toc.lev6
end
@@ -513,7 +513,7 @@ module SiSU_EPUB
tmp_head=nil
doc_title_endnote=@md.title.full.gsub(/(\*+)/,'<sup><a href="#endnotes">\1</a></sup>')
tmp_head=doc_title_endnote + "\n"
- txt_obj={:txt =>tmp_head}
+ txt_obj={ txt: tmp_head }
format_txt_obj=SiSU_EPUB_Format::Format_text_object.new(@md,txt_obj)
toc_shared << format_txt_obj.center_bold
segtoc << format_txt_obj.center_bold
@@ -521,7 +521,7 @@ module SiSU_EPUB
and @md.creator.author
creator_endnote=@md.creator.author.gsub(/(\*+)/,%{&nbsp;<sup><a href="#notes">\\1</a></sup>})
tmp_head=creator_endnote + "\n"
- txt_obj={:txt =>tmp_head}
+ txt_obj={ txt: tmp_head }
format_txt_obj=SiSU_EPUB_Format::Format_text_object.new(@md,txt_obj)
toc_shared << format_txt_obj.center_bold
segtoc << format_txt_obj.center_bold