aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/html_minitoc.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v5/html_minitoc.rb')
-rw-r--r--lib/sisu/v5/html_minitoc.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/sisu/v5/html_minitoc.rb b/lib/sisu/v5/html_minitoc.rb
index 65cfe91a..dae74c46 100644
--- a/lib/sisu/v5/html_minitoc.rb
+++ b/lib/sisu/v5/html_minitoc.rb
@@ -89,6 +89,7 @@
gsub(@pat_strip_heading_name,'\1')
#gsub(/(.*?)<a name="(\d+)"><\/a>(.*)/,'\1') #2002w42 altered gsub - problematic? - suspect
toc=case txt.ln
+ when 0 then SiSU_HTML_MiniToc::TocMini.new(@md,txt).level_0
when 1 then SiSU_HTML_MiniToc::TocMini.new(@md,txt).level_1
when 2 then SiSU_HTML_MiniToc::TocMini.new(@md,txt).level_2
when 3 then SiSU_HTML_MiniToc::TocMini.new(@md,txt).level_3
@@ -115,6 +116,18 @@
format_head_toc=SiSU_HTML_Format::HeadToc.new(@d0c)
@@seg_mini << format_head_toc.mini_concordance
end
+ def level_0
+ txt=@data
+ if (txt.is ==:heading \
+ || txt.is ==:heading_insert) \
+ && txt.ocn !=0
+ txt.obj=txt.obj.gsub(@pat_strip_heading_name,'\1')
+ end
+ txt_obj={ txt: txt.obj }
+ format_toc=SiSU_HTML_Format::FormatToc.new(@md,txt_obj)
+ toc_mini=format_toc.mini_lev0
+ toc_mini
+ end
def level_1
txt=@data
if (txt.is ==:heading \
@@ -122,7 +135,7 @@
&& txt.ocn !=0
txt.obj=txt.obj.gsub(@pat_strip_heading_name,'\1')
end
- title=unless txt.obj =~/Document Information/; txt.obj
+ title=unless txt.obj =~/Document Information/ then txt.obj
else
link='metadata'
%{<b><a href="#{link}#{@md.lang_code_insert}#{Sfx[:html]}">#{txt.obj}</a></b>}