diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v2/html.rb | 36 | ||||
-rw-r--r-- | lib/sisu/v2/html_format.rb | 4 | ||||
-rw-r--r-- | lib/sisu/v2/sysenv.rb | 6 |
3 files changed, 28 insertions, 18 deletions
diff --git a/lib/sisu/v2/html.rb b/lib/sisu/v2/html.rb index 04406e48..c984a858 100644 --- a/lib/sisu/v2/html.rb +++ b/lib/sisu/v2/html.rb @@ -162,29 +162,33 @@ module SiSU_HTML @links_guide_toc=[] def initialize(data,md) @data,@md=data,md + @links_guide_=SiSU_Env::Create_site.new(@md.cmd).html_quick_ref? end def toc @links_guide_toc=[] - format_head_toc=SiSU_HTML_Format::Head_toc.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=if l[:url] !~/^\.(\.)?\//; 'external' - else '_top' + if @links_guide_ + format_head_toc=SiSU_HTML_Format::Head_toc.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=if l[:url] !~/^\.(\.)?\//; 'external' + 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} + 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 - 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::Format_toc.new(@md,txt_obj) - @links_guide_toc << lev_dob_ocn.links_guide if s_lnk_lnk end end + format_head_toc=SiSU_HTML_Format::Head_toc.new(@md) + @links_guide_toc << format_head_toc.links_guide_close #(guide_type) + @links_guide_toc + else '' end - format_head_toc=SiSU_HTML_Format::Head_toc.new(@md) - @links_guide_toc << format_head_toc.links_guide_close #(guide_type) - @links_guide_toc end end class Endnotes diff --git a/lib/sisu/v2/html_format.rb b/lib/sisu/v2/html_format.rb index 358fa293..c4758c5f 100644 --- a/lib/sisu/v2/html_format.rb +++ b/lib/sisu/v2/html_format.rb @@ -418,7 +418,7 @@ WOK #{@vz.table_close}} end end - def links_guide_vertical_open #??? + def links_guide_vertical_open url=((defined? @vz.url_hp) && @vz.url_hp =~/^https?:\/\/\S+$/ ? @vz.url_hp : @vz.url_home) %{ <div id="vertical_links"> @@ -438,7 +438,7 @@ WOK </li> <!- quick ref -!>} end - def links_guide_horizontal_open #??? + def links_guide_horizontal_open url=((defined? @vz.url_hp) && @vz.url_hp =~/^https?:\/\/\S+$/ ? @vz.url_hp : @vz.url_home) %{ <div id="horizontal_links"> diff --git a/lib/sisu/v2/sysenv.rb b/lib/sisu/v2/sysenv.rb index f61b1fcd..ed955006 100644 --- a/lib/sisu/v2/sysenv.rb +++ b/lib/sisu/v2/sysenv.rb @@ -3266,6 +3266,12 @@ WOK ? @rc['html']['seg_title_banner'] \ : false end + def html_quick_ref? + ((defined? @rc['html']['quick_ref']) \ + && @rc['html']['quick_ref']==true) \ + ? @rc['html']['quick_ref'] \ + : false + end def cp_images(src_path,dest_path) if FileTest.directory?(src_path) cd(src_path) |