From f0776648316c5f54e27bcd5b4c8ee50b57e6489c Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 24 Oct 2010 16:34:22 -0400 Subject: html segments, title banner (including "copy @" mark) configurable, boolean * true/false (config.yml commented out, default false) (requested off option, Daniel Baumann) --- lib/sisu/v2/html_segments.rb | 22 +++++++++++++++++----- lib/sisu/v2/sysenv.rb | 6 ++++++ 2 files changed, 23 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v2/html_segments.rb b/lib/sisu/v2/html_segments.rb index 33e56402..a516d809 100644 --- a/lib/sisu/v2/html_segments.rb +++ b/lib/sisu/v2/html_segments.rb @@ -64,6 +64,7 @@ module SiSU_HTML_seg class Seg_output def initialize(md,outputfile,seg,minitoc,type='') @md,@output_seg_file,@seg,@minitoc,@type=md,outputfile,seg,minitoc,type + @title_banner_=SiSU_Env::Create_site.new(@md.cmd).html_seg_title_banner? end def output if @seg[:title] =~/\S/ @@ -72,7 +73,9 @@ module SiSU_HTML_seg if @type=='endnotes' @seg[:headings]=[] format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) - @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) + if @title_banner_ + @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) + end txt_obj={:txt =>'Endnotes',:ocn_display =>''} format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) @seg[:headings] << format_seg.title_heading1 @@ -80,7 +83,9 @@ module SiSU_HTML_seg elsif @type=='idx' @seg[:headings]=[] format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) - @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) + if @title_banner_ + @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) + end txt_obj={:txt =>'Index',:ocn_display =>''} format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) @seg[:headings] << format_seg.title_heading1 @@ -89,7 +94,9 @@ module SiSU_HTML_seg metadata=Metadata::Summary.new(@md).xhtml_display.metadata @seg[:headings]=[] format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) - @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) + if @title_banner_ + @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) + end txt_obj={:txt =>'Metadata',:ocn_display =>''} format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) @seg[:headings] << format_seg.title_heading1 @@ -122,11 +129,14 @@ module SiSU_HTML_seg @@dp,@@segtocband=nil,nil @@fns_previous='' attr_reader :seg_name_html,:seg_name_html_tracker - def initialize(md='',data='') + def initialize(md=nil,data='') @md,@data=md,data @vz=SiSU_Env::Get_init.instance.skin @seg_name_html=@@seg_name_html || nil @seg_name_html_tracker=@@tracker || nil + if @md + @title_banner_=SiSU_Env::Create_site.new(@md.cmd).html_seg_title_banner? + end end def songsheet begin @@ -299,7 +309,9 @@ module SiSU_HTML_seg end @@seg[:tocband_bannerless] << '
' << conditional_div_close << format_head_seg.navigation_band_bottom(@@segtocband,@@seg[:dot_nav]) @@seg[:headings] << format_head_seg.seg_head_escript if SiSU_HTML_Format::Head_seg.method_defined? :seg_head_escript #debug PHP move up in text #bug - @@seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author).gsub(clean,'') + if @title_banner_ + @@seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author).gsub(clean,'') + end ocn=if @@heading1[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#{@dp}:#{@dp}#{Mx[:id_c]}$/]; $1 #fix else '' end diff --git a/lib/sisu/v2/sysenv.rb b/lib/sisu/v2/sysenv.rb index 395559a8..f61b1fcd 100644 --- a/lib/sisu/v2/sysenv.rb +++ b/lib/sisu/v2/sysenv.rb @@ -3260,6 +3260,12 @@ WOK filename_homepage_toc << @vz_home.homepage end end + def html_seg_title_banner? + ((defined? @rc['html']['seg_title_banner']) \ + && @rc['html']['seg_title_banner']==true) \ + ? @rc['html']['seg_title_banner'] \ + : false + end def cp_images(src_path,dest_path) if FileTest.directory?(src_path) cd(src_path) -- cgit v1.2.3