diff options
author | Ralph Amissah <ralph@amissah.com> | 2008-09-15 21:52:19 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2008-09-15 21:52:19 -0400 |
commit | 87a7cfcd56eed6746b1500c88df3fc3e76a81668 (patch) | |
tree | 9e653d09f0e8c130273ef5ef3e7be0daf12d6007 /lib/sisu/v0/html_segments.rb | |
parent | dal_idx, and concordance, letter list for navigation (diff) |
various small fixes
* html segments, name more accurately
* rough description of how book index markup works
* clean out book index from these outputs
* book markup sample, free as in freedom, start doing book index, only letter "A" done so far
* texpdf, url matching, special characters
* # Please enter the commit message for your changes.
Diffstat (limited to 'lib/sisu/v0/html_segments.rb')
-rw-r--r-- | lib/sisu/v0/html_segments.rb | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/lib/sisu/v0/html_segments.rb b/lib/sisu/v0/html_segments.rb index 796c3939..a280a8c8 100644 --- a/lib/sisu/v0/html_segments.rb +++ b/lib/sisu/v0/html_segments.rb @@ -63,18 +63,28 @@ module SiSU_HTML_seg require "#{SiSU_lib}/html" require "#{SiSU_lib}/html_promo" class Seg_output - def initialize(outputfile,seg,minitoc,type='') - @output_seg_file,@seg,@minitoc,@type=outputfile,seg,minitoc,type + def initialize(md,outputfile,seg,minitoc,type='') + @md,@output_seg_file,@seg,@minitoc,@type=md,outputfile,seg,minitoc,type end def output #CONSIDER - if @seg[:title] =~/\S/ #kludge (for exception file better.ways, how ironic) get a real ruby test, e.g. test that not array or... + if @seg[:title] =~/\S/ filename_seg=[] filename_seg << @seg[:title] << @seg[:tocband_banner] if @type =~/endnote/ -#p @seg[:headers] #FIX endnote header + @seg[:headers]=[] + format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) + @seg[:headers] << format_head_seg.title_banner(@md.title,@md.subtitle,@dc_creator) + txt_obj={:txt =>'Endnotes',:ocn_display =>''} + format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) + @seg[:headers] << format_seg.title_header1 filename_seg << @seg[:header_endnotes] << @minitoc << @seg[:headers] << %{\n<div class="content">\n} << @seg[:endnote_all] << '</div>' # << '</div>' elsif @type =~/idx/ -#p @seg[:headers] #FIX inserted index header + @seg[:headers]=[] + format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) + @seg[:headers] << format_head_seg.title_banner(@md.title,@md.subtitle,@dc_creator) + txt_obj={:txt =>'Index',:ocn_display =>''} + format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) + @seg[:headers] << format_seg.title_header1 filename_seg << @seg[:header_idx] << @minitoc << @seg[:headers] << %{\n<div class="content">\n} << @seg[:idx] << '</div>' # << '</div>' else filename_seg << @minitoc << @seg[:headers] << @seg[:main] << "\n</div>\n" @@ -191,11 +201,11 @@ module SiSU_HTML_seg segfilename="#{@md.dir_out}/#{@md.fnl[:pre]}#{@@seg_name_html[tracking-1]}#{@md.fnl[:mid]}#@h_sfx#{@md.fnl[:post]}" @output_seg_file=File.new(segfilename,'w') if @@seg_name_html[tracking-1] if @@seg_name_html[tracking-1] !~/endnotes|idx/ - Seg_output.new(@output_seg_file,@@seg,@minitoc).output + Seg_output.new(@md,@output_seg_file,@@seg,@minitoc).output elsif @@seg_name_html[tracking-1] =~/endnotes/ - Seg_output.new(@output_seg_file,@@seg,@minitoc,'endnotes').output + Seg_output.new(@md,@output_seg_file,@@seg,@minitoc,'endnotes').output elsif @@seg_name_html[tracking-1] =~/idx/ - Seg_output.new(@output_seg_file,@@seg,@minitoc,'idx').output + Seg_output.new(@md,@output_seg_file,@@seg,@minitoc,'idx').output else p 'check' end Seg.new.reinitialise |