From 05a3fd233ec1ac4475bd797449d1284f6824c005 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 1 Mar 2011 20:41:28 -0500 Subject: v3: ruby 1.9 hash symbol syntax adopted --- lib/sisu/v3/html.rb | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'lib/sisu/v3/html.rb') diff --git a/lib/sisu/v3/html.rb b/lib/sisu/v3/html.rb index 7a1c90cb..2ee031a5 100644 --- a/lib/sisu/v3/html.rb +++ b/lib/sisu/v3/html.rb @@ -172,7 +172,7 @@ module SiSU_HTML else '_top' end s_lnk_url,s_lnk_lnk=l[:url],l[:say] - txt_obj={:lnk_url =>s_lnk_url,:lnk_txt =>s_lnk_lnk,:target =>target} + txt_obj={ lnk_url: s_lnk_url, lnk_txt: s_lnk_lnk, target: target } lev_dob_ocn=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) @links_guide_toc << lev_dob_ocn.links_guide if s_lnk_lnk end @@ -208,7 +208,7 @@ module SiSU_HTML 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_HTML_Format::Format_scroll.new(@md,txt_obj) @scr_endnotes << format_scroll.endnote_body end @@ -219,7 +219,7 @@ module SiSU_HTML end end class Toc [],:seg_mini=>[],:scr=>[] } + @@toc={ seg: [], seg_mini: [], scr: [] } @@seg_url='' @@firstseg=nil def initialize(md=nil,data='') @@ -231,7 +231,7 @@ module SiSU_HTML SiSU_Screen::Ansi.new(@md.cmd,'Toc').txt_grey if @md.cmd =~/[MVv]/ toc=nil @@firstseg=nil - @@toc={ :seg=>[],:seg_mini=>[],:scr=>[] } + @@toc={ seg: [], seg_mini: [], scr: [] } @data.each do |dob| if dob.is=='heading' \ or dob.is=='heading_insert' @@ -325,7 +325,7 @@ WOK %{#{linkname}} end toc={} - txt_obj={:txt =>title} + txt_obj={ txt: title } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc[:seg]=if dob.name =~/^meta/ \ and dob.obj =~/Document Information/ @@ -353,7 +353,7 @@ WOK end %{#{linkname}} end - txt_obj={:txt =>title} + txt_obj={ txt: title } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc[:scr]=if dob.name =~/^meta/ \ and dob.obj =~/Document Information/ @@ -370,14 +370,14 @@ WOK SiSU_HTML_Format::Paragraph_number.new(@md,ocn) else nil end - txt_obj={:txt =>linkname} + txt_obj={ txt: linkname } format_toc=SiSU_HTML_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}} - txt_obj={:txt =>title} + txt_obj={ txt: title } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc[:scr]=format_toc.lev2 end @@ -391,14 +391,14 @@ WOK SiSU_HTML_Format::Paragraph_number.new(@md,ocn) else nil end - txt_obj={:txt =>linkname} + txt_obj={ txt: linkname } format_toc=SiSU_HTML_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}} - txt_obj={:txt =>title} + txt_obj={ txt: title } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc[:scr]=format_toc.lev3 end @@ -426,8 +426,8 @@ WOK seg_link.gsub(/sisu_manifest\.html/,"../../manifest/#{@file.base_filename.manifest}") else seg_link end - {:txt =>man_link} - else {:txt =>seg_link} + { txt: man_link } + else { txt: seg_link } end format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc={} @@ -436,8 +436,8 @@ WOK title=%{#{p_num.goto}#{linkname}} if p_num txt_obj=if title=~/sisu_manifest.html/ man_link=title.gsub(/sisu_manifest.html/,"../manifest/#{@file.base_filename.manifest}") - {:txt =>man_link} - else {:txt =>title} + { txt: man_link } + else { txt: title } end format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc[:scr]=format_toc.lev4 @@ -454,12 +454,12 @@ WOK lnk_n_txt=%{ #{linkname} } - txt_obj={:txt =>lnk_n_txt} + txt_obj={ txt: lnk_n_txt } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc[:seg]=format_toc.lev5 toc[:seg_mini]=format_toc.mini_lev5 title=%{#{p_num.goto}#{linkname}} - txt_obj={:txt =>title} + txt_obj={ txt: title } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc[:scr]=format_toc.lev5 end @@ -475,12 +475,12 @@ WOK lnk_n_txt=%{ #{linkname} } - txt_obj={:txt =>lnk_n_txt} + txt_obj={ txt: lnk_n_txt } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc[:seg]=format_toc.lev6 toc[:seg_mini]=format_toc.mini_lev6 title=%{#{p_num.goto}#{linkname}} - txt_obj={:txt =>title} + txt_obj={ txt: title } format_toc=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) toc[:scr]=format_toc.lev6 end @@ -542,14 +542,14 @@ WOK tmp_head=nil doc_title_endnote=@md.title.full.gsub(/(\*+)/,'\1') tmp_head=doc_title_endnote + "\n" - txt_obj={:txt =>tmp_head} + txt_obj={ txt: tmp_head } format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,txt_obj) toc_shared << format_txt_obj.center_bold @segtoc << format_txt_obj.center_bold if defined? @md.creator.author creator_endnote=@md.creator.author.gsub(/(\*+)/,%{ \\1}) tmp_head=creator_endnote + "\n" - txt_obj={:txt =>tmp_head} + txt_obj={ txt: tmp_head } format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,txt_obj) toc_shared << format_txt_obj.center_bold @segtoc << format_txt_obj.center_bold -- cgit v1.2.3