class SiSU_HTML::Source::LinksGuide

Public Class Methods

new(data,md) click to toggle source
# File lib/sisu/html.rb, line 188
def initialize(data,md)
  @data,@md=data,md
  @links_guide_=SiSU_Env::CreateSite.new(@md.opt).html_quick_ref?
end

Public Instance Methods

toc() click to toggle source
# File lib/sisu/html.rb, line 192
def toc
  @links_guide_toc=[]
  if @links_guide_
    format_head_toc=SiSU_HTML_Format::HeadToc.new(@md)
    guide_type='horzontal' #values: horizontal or vertical
    @links_guide_toc << format_head_toc.links_guide_open(guide_type)
    if defined? @md.lnk \
    and @md.lnk
      @md.lnk.each do |l|
        if defined? l[:say]
          target=(l[:url] !~/^\.(\.)?\//) \
          ? 'external'
          : '_top'
          s_lnk_url,s_lnk_lnk=l[:url],l[:say]
          txt_obj={
            lnk_url: s_lnk_url,
            lnk_txt: s_lnk_lnk,
            target: target,
          }
          lev_dob_ocn=SiSU_HTML_Format::FormatToc.new(@md,txt_obj)
          @links_guide_toc << lev_dob_ocn.links_guide if s_lnk_lnk
        end
      end
    end
    format_head_toc=SiSU_HTML_Format::HeadToc.new(@md)
    @links_guide_toc << format_head_toc.links_guide_close #(guide_type)
    @links_guide_toc
  else ''
  end
end