class SiSU_HTML_Format::FormatSeg
Public Class Methods
new(md,txt)
click to toggle source
Calls superclass method
SiSU_HTML_Format::FormatTextObject::new
# File lib/sisu/html_format.rb, line 1130 def initialize(md,txt) super(md,txt) end
Public Instance Methods
clean(txt)
click to toggle source
# File lib/sisu/html_format.rb, line 1141 def clean(txt) txt=txt.gsub(/#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}/,''). gsub(/#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]}/,'') end
endnote_seg_body(fn='')
click to toggle source
# File lib/sisu/html_format.rb, line 1133 def endnote_seg_body(fn='') fn="../#{@md.fnb}" if fn.to_s.empty? %{ <p class="endnote"> #{@endnote_part_a}#{fn}#{@md.lang_code_insert}#{Sfx[:html]}#{@endnote_part_b} </p> } end
heading4()
click to toggle source
# File lib/sisu/html_format.rb, line 1189 def heading4 %{ <div class="substance"> #{@p_num.ocn_display} <h1 class="norm" #{@p_num.id}>#{@p_num.name} #{@t_o[:format]} #{@txt} </h1> </div> } end
heading5()
click to toggle source
# File lib/sisu/html_format.rb, line 1183 def heading5 heading_sub('p','bold') end
heading6()
click to toggle source
# File lib/sisu/html_format.rb, line 1186 def heading6 heading_sub('p','bold') end
heading_sub(tag,attrib)
click to toggle source
# File lib/sisu/html_format.rb, line 1172 def heading_sub(tag,attrib) @txt=@txt.gsub(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' ') %{ <div class="substance"> #{@p_num.ocn_display} <#{tag} class="#{attrib}" #{@p_num.id}>#{@p_num.name} #{@headnamed} #{@txt} </#{tag}> </div> } end
subtoc_lev(tag,attrib)
click to toggle source
# File lib/sisu/html_format.rb, line 1145 def subtoc_lev(tag,attrib) @txt=clean(@txt) txt=if @txt \ and @txt =~/<\/?i>|<a\s+name="\S+?">/mi @txt.gsub(/<\/?i>|<a\s+name="\S+?">/mi,'') #removes name markers from subtoc, go directly to substantive text else @txt end note='' if txt =~/(#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})/m # had \s* at end note=$1 note=note.gsub(/[\s]+/m,' ') txt=txt.gsub(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' '). gsub(/<a[\s]+name="-\d+"[\s]+href="#_\d+"> <sup>\d+<\/sup> /m,'') end %{<#{tag} class="#{attrib}"> <a href="##{@ocn}"><i>#{txt}</i></a> #{note} </#{tag}>} end
subtoc_lev5()
click to toggle source
# File lib/sisu/html_format.rb, line 1163 def subtoc_lev5 subtoc_lev('h5','subtoc') if @txt end
subtoc_lev6()
click to toggle source
# File lib/sisu/html_format.rb, line 1166 def subtoc_lev6 subtoc_lev('h6','subtoc') if @txt end
subtoc_lev7()
click to toggle source
# File lib/sisu/html_format.rb, line 1169 def subtoc_lev7 subtoc_lev('h7','subtoc') if @txt end