class SiSU_XML_Format::FormatSeg
Public Class Methods
new(md,txt)
click to toggle source
Calls superclass method
SiSU_XML_Format::FormatTextObject::new
# File lib/sisu/xml_format.rb, line 627 def initialize(md,txt) super(md,txt) end
Public Instance Methods
endnote_seg_body(fn='')
click to toggle source
# File lib/sisu/xml_format.rb, line 678 def endnote_seg_body(fn='') #FIX #url construction keep within single line... BUG WATCH 200408 fn='doc' if fn.empty? #you may wish to reconsider, sends to 'doc' where no segment info # Sfx[:html] or Sfx[:xhtml] ? %{ <p class="endnote"> #{@endnote_part_a}#{fn}#{@md.lang_code_insert}#{Sfx[:html]}#{@endnote_part_b} </p> } end
header4()
click to toggle source
# File lib/sisu/xml_format.rb, line 724 def header4 %{ <div class="substance"> #{@p_num.ocn_display} <h1 class="norm" #{@p_num.id}>#{@p_num.name} #{@t_o[:format]} #{@txt} </h1> </div> } end
header5()
click to toggle source
# File lib/sisu/xml_format.rb, line 735 def header5 header_sub('p','bold') end
header6()
click to toggle source
# File lib/sisu/xml_format.rb, line 738 def header6 header_sub('p','bold') end
header7()
click to toggle source
# File lib/sisu/xml_format.rb, line 741 def header7 header_sub('p','bold') end
header_sub(tag,attrib)
click to toggle source
% para sisu
# File lib/sisu/xml_format.rb, line 713 def header_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} #{@headname} #{@txt} </#{tag}> </div> } end
subtoc_lev(tag,attrib)
click to toggle source
# File lib/sisu/xml_format.rb, line 686 def subtoc_lev(tag,attrib) 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]}\s*)/m note=$1 note=note.gsub(/[\n\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[\n\s]+name="-\d+"[\n\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/xml_format.rb, line 703 def subtoc_lev5 subtoc_lev('h5','subtoc') if @txt end
subtoc_lev6()
click to toggle source
# File lib/sisu/xml_format.rb, line 706 def subtoc_lev6 subtoc_lev('h6','subtoc') if @txt end
subtoc_lev7()
click to toggle source
# File lib/sisu/xml_format.rb, line 709 def subtoc_lev7 subtoc_lev('h7','subtoc') if @txt end