class SiSU_HTML::Source::ScrollHeadAndSegToc

Public Class Methods

new(md='',toc='',links_guide_toc='') click to toggle source
# File lib/sisu/html.rb, line 600
def initialize(md='',toc='',links_guide_toc='')
  @md,@toc,@links_guide_toc=md,toc,links_guide_toc
  @make=SiSU_Env::ProcessingSettings.new(@md)
end

Public Instance Methods

in_common() click to toggle source
# File lib/sisu/html.rb, line 604
def in_common
  toc_shared=[]
  @segtoc=[]
  if (@md.opt.act[:verbose][:set]==:on \
  || @md.opt.act[:verbose_plus][:set]==:on \
  || @md.opt.act[:maintenance][:set]==:on)
    SiSU_Screen::Ansi.new(
      @md.opt.act[:color_state][:set],
      'Scroll & Segtoc'
    ).txt_grey
  end
  format_head_toc=SiSU_HTML_Format::HeadToc.new(@md)
  dochead=format_head_toc.head
  dochead=dochead.gsub(/toc\.(html)/,'doc.\1') #kludge
  toc_shared << dochead
  @segtoc << format_head_toc.head
  if @make.build.html_top_band?
    toc_shared << format_head_toc.scroll_head_navigation_band
  end
  if defined? @md.rights.all
    rights=format_head_toc.rights.all
    rights=SiSU_HTML_Tune::CleanHTML.new(rights).clean
  end
  if @md.prefix_b
    prefix_b=format_head_toc.notes.prefix_b
    prefix_b=SiSU_HTML_Tune::CleanHTML.new(prefix_b).clean
  end
  if @make.build.html_top_band?
    @segtoc << format_head_toc.seg_head_navigation_band
  end
  toc_shared << format_head_toc.scroll_head_title_banner_open
  @segtoc << format_head_toc.seg_head_title_banner_open
  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 }
  format_txt_obj=SiSU_HTML_Format::FormatTextObject.new(@md,txt_obj)
  toc_shared << format_txt_obj.center_bold
  @segtoc << format_txt_obj.center_bold
  if defined? @md.creator.author
    creator=SiSU_HTML_Tune::CleanHTML.new(@md.creator.author).clean_for_html
    creator_endnote=creator.gsub(/(\*+)/,
      %{&nbsp;<sup><a href="#notes">\\1</a></sup>})
    tmp_head=creator_endnote + "\n"
    txt_obj={ txt: tmp_head }
    format_txt_obj=SiSU_HTML_Format::FormatTextObject.new(@md,txt_obj)
    toc_shared << format_txt_obj.center_bold
    @segtoc << format_txt_obj.center_bold
  end
  toc_shared << "#{the_table_close*1}\n"
  @segtoc << "#{the_table_close*1}\n"
  tmp_head=nil
  if @md.prefix_a
    tmp_head ||= %{<p>#{@md.prefix_a}\n}
    toc_shared << tmp_head.dup
    @segtoc << tmp_head.dup
  end
  tmp_head=nil
  toc_shared << @links_guide_toc
  if defined? @md.rights.all #and ? @md.rights.all
    toc_shared << rights
  end
  if defined? @md.prefix_b
    toc_shared << prefix_b
  end
  if @make.build.toc? #Table of Contents added/appended here
    toc_shared << @toc[:scr]
  end
  @segtoc << @links_guide_toc
  @segtoc << @toc[:seg]
  if defined? @md.rights.all \
  and not @md.rights.all.empty?
    @segtoc << rights
  end
  @segtoc << prefix_b if @md.prefix_b
  #Segtoc tail added here
  @segtoc << "</p>\n" #bugfix sort later DEBUGNOW
  @segtoc << @seg_toc_band_bottom
  @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
  end
  @segtoc=[]
  @toc[:scr],@toc[:seg]=[],[]
  toc_shared
end