Class: SiSU_HTML_Seg::Output
- Inherits:
-
Object
- Object
- SiSU_HTML_Seg::Output
- Defined in:
- lib/sisu/html_segments.rb
Instance Method Summary collapse
-
#initialize(md, outputfile, per, minitoc, type = '') ⇒ Output
constructor
A new instance of Output.
- #output ⇒ Object
Constructor Details
#initialize(md, outputfile, per, minitoc, type = '') ⇒ Output
Returns a new instance of Output.
62 63 64 65 66 67 68 69 70 71 |
# File 'lib/sisu/html_segments.rb', line 62 def initialize(md,outputfile,per,minitoc,type='') @md, @output_seg_file,@per,@minitoc,@type= md,outputfile, per,minitoc, type @title_banner_=SiSU_Env::CreateSite.new(@md.opt). @file=SiSU_Env::FileOp.new(@md) @make=SiSU_Env::ProcessingSettings.new(@md) @cl=(@make.build.html_minitoc?) \ ? 'content' : 'content0' end |
Instance Method Details
#output ⇒ Object
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/sisu/html_segments.rb', line 72 def output if @per.title =~/\S/ filename_seg=[] if @make.build.html_top_band? filename_seg \ << @per.title \ << @per. else filename_seg \ << @per.title end if @type=='endnotes' @per.headings=[] format_head_seg=SiSU_HTML_Format::HeadSeg.new(@md) if @title_banner_ @per.headings \ << format_head_seg. (@md.title.main,@md.title.sub,@author) end txt_obj={ txt: 'Endnotes', ocn_display: '' } format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) @per.headings \ << format_seg.title_heading1 filename_seg \ << @per.heading_endnotes \ << @minitoc << @per.headings \ << %{\n<div class="#{@cl}">\n} \ << @per.endnote_all \ << '</div>' # << '</div>' elsif @type=='idx' @per.headings=[] format_head_seg=SiSU_HTML_Format::HeadSeg.new(@md) if @title_banner_ @per.headings \ << format_head_seg. (@md.title.main,@md.title.sub,@author) end txt_obj={ txt: 'Index', ocn_display: '' } format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) @per.headings << format_seg.title_heading1 filename_seg \ << @per.heading_idx \ << @minitoc << @per.headings \ << %{\n<div class="#{@cl}">\n} \ << @per.idx \ << '</div>' # << '</div>' elsif @type=='metadata' =SiSU_Metadata::Summary.new(@md).html_display. @per.headings=[] format_head_seg=SiSU_HTML_Format::HeadSeg.new(@md) if @title_banner_ @per.headings \ << format_head_seg. (@md.title.main,@md.title.sub,@author) end txt_obj={ txt: 'Metadata', ocn_display: '' } format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) @per.headings \ << format_seg.title_heading1 filename_seg \ << @per.heading_idx \ << @minitoc \ << @per.headings \ << %{\n<div class="#{@cl}">\n} \ << \ << '</div>' # << '</div>' else if @make.build.html_top_band? filename_seg \ << @minitoc \ << @per.headings \ << @per.main \ << "\n</div>\n" else filename_seg \ << @minitoc \ << @per.main \ << "\n</div>\n" end end filename_seg <<=if @make.build.html_top_band? @per.tail \ << @per. \ << @per.credits else @per.tail \ << @per.credits end filename_seg=filename_seg.flatten.compact #watch filename_seg.each do |str| unless str =~/\A\s*\Z/ str=str.strip. gsub(Xx[:html_relative2], @file.path_rel_links.html_seg_2). gsub(Xx[:html_relative1], @file.path_rel_links.html_seg_1) @output_seg_file << str end end @output_seg_file.close end end |