diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-01-06 23:02:50 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-01-06 23:03:02 -0500 |
commit | 5fb49b575a548313b827fd66fd7ecce514fe0e45 (patch) | |
tree | e7541789806c1bc086c05d06f0af2b9d54abb1c1 /lib/sisu/v5/html.rb | |
parent | v5: vim syntax, v5.2 match heading level D~ (diff) |
v5: heading recalibration, code (downstream) changessisu_4.2.17
* here no doubt remains breakage (test, fix & test again)
Diffstat (limited to 'lib/sisu/v5/html.rb')
-rw-r--r-- | lib/sisu/v5/html.rb | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/lib/sisu/v5/html.rb b/lib/sisu/v5/html.rb index 4ff58c43..f473f1b7 100644 --- a/lib/sisu/v5/html.rb +++ b/lib/sisu/v5/html.rb @@ -259,6 +259,7 @@ module SiSU_HTML toc=if dob_toc.is ==:heading \ || dob.is==:heading_insert toc=case dob_toc.ln + when 0 then SiSU_HTML::Source::Toc.new(@md,dob_toc).level_0 when 1 then SiSU_HTML::Source::Toc.new(@md,dob_toc).level_1 when 2 then SiSU_HTML::Source::Toc.new(@md,dob_toc).level_2 when 3 then SiSU_HTML::Source::Toc.new(@md,dob_toc).level_3 @@ -335,6 +336,29 @@ WOK @@toc[:seg_mini] << format_head_toc.mini_concordance end # <-- not used + def level_0 + dob=@data + linkname,link=dob.obj.strip,dob.ocn + if link \ + and link !~/#/ #% keep eye on link + SiSU_HTML_Format::ParagraphNumber.new(@md,link) + end + title=linkname + toc={} + txt_obj={ txt: title } + format_toc=SiSU_HTML_Format::FormatToc.new(@md,txt_obj) + toc[:seg]=format_toc.lev0 + toc[:seg_mini]=format_toc.mini_lev0 + title=if dob.ocn ==0 then linkname + else + @@toc[:scr] << '<br />' + %{<b><a href="##{dob.ocn}">#{linkname}</a></b>} + end + txt_obj={ txt: title } + format_toc=SiSU_HTML_Format::FormatToc.new(@md,txt_obj) + toc[:scr]=format_toc.lev0 + toc + end def level_1 dob=@data linkname,link=dob.obj.strip,dob.ocn @@ -567,9 +591,8 @@ WOK format_head_toc=SiSU_HTML_Format::HeadToc.new(@md) dochead=format_head_toc.head dochead=dochead.gsub(/toc\.(html)/,'doc.\1') #kludge - ads=SiSU_HTML_Promo::Ad.new(@md) - toc_shared << dochead << ads.div.major - @segtoc << format_head_toc.head << ads.div.major + toc_shared << dochead + @segtoc << format_head_toc.head if @make.build.html_top_band? toc_shared << format_head_toc.scroll_head_navigation_band end @@ -632,8 +655,7 @@ WOK #Segtoc tail added here @segtoc << "</p>\n" #bugfix sort later DEBUGNOW @segtoc << @seg_toc_band_bottom - ads=SiSU_HTML_Promo::Ad.new(@md) - @segtoc << format_head_toc.seg_navigation_tail << ads.div.close << ads.display << format_head_toc.html_close + @segtoc << format_head_toc.seg_navigation_tail << format_head_toc.html_close @segtoc=@segtoc.flatten.compact #watch if @md.opt.act[:html_seg][:set]==:on SiSU_HTML::Source::Output.new(@segtoc,@md).segtoc |