Class: SiSU_TexInfoFormat::TeXinfoTxt

Inherits:
Object
  • Object
show all
Defined in:
lib/sisu/texinfo_format.rb

Instance Method Summary collapse

Constructor Details

#initialize(md, dob, txt) ⇒ TeXinfoTxt

Returns a new instance of TeXinfoTxt.



515
516
517
# File 'lib/sisu/texinfo_format.rb', line 515

def initialize(md,dob,txt)
  @md,@dob,@txt=md,dob,txt
end

Instance Method Details

#clean(dob, txt) ⇒ Object



518
519
520
521
522
523
524
525
# File 'lib/sisu/texinfo_format.rb', line 518

def clean(dob,txt)
  if dob.is==:heading \
  and txt !~/#{Dx[:ocn_o]}#{dob.ocn}#{Dx[:ocn_c]}/
    txt=dob.ocn.is_a?(Fixnum) \
    ? "#{dob.obj} #{Dx[:ocn_o]}#{dob.ocn}#{Dx[:ocn_c]}" : dob.obj
  end
  txt.strip
end


526
527
528
529
530
531
# File 'lib/sisu/texinfo_format.rb', line 526

def submenu
  txt=@txt.join("\n")
  txt=clean(@dob,txt)
  txt="@menu\n#{txt}\n@end menu\n\n"
  txt=txt.gsub(/.+/m,"#{txt}")
end

#subsubmenuObject



532
533
534
535
536
537
# File 'lib/sisu/texinfo_format.rb', line 532

def subsubmenu
  txt=@txt.join("\n")
  txt=clean(@dob,txt)
  txt="@menu\n#{txt}\n@end menu\n\n"
  txt=txt.gsub(/.+/m,"#{txt}")
end