aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/html.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/html.rb
parentv3: use rb1.9.2 "require_relative" syntax (diff)
v3: ruby 1.9 hash symbol syntax adopted
Diffstat (limited to 'lib/sisu/v3/html.rb')
-rw-r--r--lib/sisu/v3/html.rb40
1 files changed, 20 insertions, 20 deletions
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 <Links_guide
- @@toc={ :seg=>[],: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
%{<b><a href="#{@md.fnl[:pre]}#{link}#{@md.fnl[:mid]}#{Sfx[:html]}#{@md.fnl[:post]}">#{linkname}</a></b>}
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
%{<b><a href="##{link}">#{linkname}</a></b>}
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}</a>}
- 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}</a>}
- 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}</a>} 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=%{ <a href="#{@md.fnl[:pre]}#{@@seg_url}#{@md.fnl[:mid]}#{Sfx[:html]}#{@md.fnl[:post]}##{ocn}">
#{linkname}
</a>}
- 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}</a>}
- 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=%{ <a href="#{@md.fnl[:pre]}#{@@seg_url}#{@md.fnl[:mid]}#{Sfx[:html]}#{@md.fnl[:post]}##{ocn}">
#{linkname}
</a>}
- 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}</a>}
- 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(/(\*+)/,'<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_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(/(\*+)/,%{&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_HTML_Format::Format_text_object.new(@md,txt_obj)
toc_shared << format_txt_obj.center_bold
@segtoc << format_txt_obj.center_bold