class SiSU_XML_Scaffold_Structure_Sisu::Source::Scroll
Public Class Methods
new(data='',md='')
click to toggle source
# File lib/sisu/xml_scaffold_structure_sisu.rb, line 82 def initialize(data='',md='') @data,@md=data,md end
Public Instance Methods
output(o,lev=nil,comment='')
click to toggle source
# File lib/sisu/xml_scaffold_structure_sisu.rb, line 114 def output(o,lev=nil,comment='') puts lev == (0..6) \ ? "#{spaces*lev}<#{lev}>[#{o.ocn}] #{o.ln} #{o.obj}</#{lev}>#{comment}" : "<#{lev}>[#{o.ocn}] #{o.ln} #{o.obj}</#{lev}>#{comment}" end
sisu()
click to toggle source
# File lib/sisu/xml_scaffold_structure_sisu.rb, line 94 def sisu [ '0', 'A', 'B', 'C', '1', '2', '3' ] end
songsheet()
click to toggle source
# File lib/sisu/xml_scaffold_structure_sisu.rb, line 85 def songsheet @t='sisu' data=@data if @md.opt.act[:verbose_plus][:set]==:on structure_sisu_simple(data) end structure_build_sisu(data) end
structure_build_sisu(data)
click to toggle source
# File lib/sisu/xml_scaffold_structure_sisu.rb, line 119 def structure_build_sisu(data) @s=tags.sisu puts "\nXML [#{@t} type] structure outline --->\n\n" h=[0,false,false,false] puts "<#{@s[0]}>" data.each_with_index do |o,i| if (o.is ==:heading || o.is ==:heading_insert) structure_build_tag_close(o.ln,h) puts "#{spaces*o.ln}<#{@s[o.ln]}>\n#{spaces*o.ln} [#{o.ocn}] #{o.ln} {#{o.node}}" case o.ln when 1 h=[o.ln,true,false,false] when 2 h=[o.ln,true,true,false] when 3 h=[o.ln,true,true,true] when 4..6 h[0]=o.ln end end end structure_build_tag_close(0,h) end
structure_build_tag_close(lev,h)
click to toggle source
# File lib/sisu/xml_scaffold_structure_sisu.rb, line 142 def structure_build_tag_close(lev,h) case h[0] when 1 puts "#{spaces*1}</#{@s[1]}>" if (lev <= 1) && h[1] puts "</#{@s[0]}>" if (lev==0) when 2 puts "#{spaces*2}</#{@s[2]}>" if (lev <= 2) && h[2] puts "#{spaces*1}</#{@s[1]}>" if (lev <= 1) && h[1] puts "</#{@s[0]}>" if (lev==0) when 3 puts "#{spaces*3}</#{@s[3]}>" if (lev <= 3) && h[3] puts "#{spaces*2}</#{@s[2]}>" if (lev <= 2) && h[2] puts "#{spaces*1}</#{@s[1]}>" if (lev <= 1) && h[1] puts "</#{@s[0]}>" if (lev==0) when 4 puts "#{spaces*4}</#{@s[4]}>" if (lev <= 4) puts "#{spaces*3}</#{@s[3]}>" if (lev <= 3) && h[3] puts "#{spaces*2}</#{@s[2]}>" if (lev <= 2) && h[2] puts "#{spaces*1}</#{@s[1]}>" if (lev <= 1) && h[1] puts "</#{@s[0]}>" if (lev==0) when 5 puts "#{spaces*5}</#{@s[5]}>" if (lev <= 5) puts "#{spaces*4}</#{@s[4]}>" if (lev <= 4) puts "#{spaces*3}</#{@s[3]}>" if (lev <= 3) && h[3] puts "#{spaces*2}</#{@s[2]}>" if (lev <= 2) && h[2] puts "#{spaces*1}</#{@s[1]}>" if (lev <= 1) && h[1] puts "</#{@s[0]}>" if (lev==0) when 6 puts "#{spaces*6}</#{@s[6]}>" if (lev <= 6) puts "#{spaces*5}</#{@s[5]}>" if (lev <= 5) puts "#{spaces*4}</#{@s[4]}>" if (lev <= 4) puts "#{spaces*3}</#{@s[3]}>" if (lev <= 3) && h[3] puts "#{spaces*2}</#{@s[2]}>" if (lev <= 2) && h[2] puts "#{spaces*1}</#{@s[1]}>" if (lev <= 1) && h[1] puts "</#{@s[0]}>" if (lev==0) end end
structure_sisu_simple(data)
click to toggle source
# File lib/sisu/xml_scaffold_structure_sisu.rb, line 106 def structure_sisu_simple(data) puts "\nsisu structure, heading outline --->\n\n" data.each_with_index do |o,i| if (o.is ==:heading || o.is ==:heading_insert) puts "#{spaces*o.ln}<#{tags.sisu[o.ln]}>[#{o.ocn}] #{o.ln} #{o.obj}</#{tags.sisu[o.ln]}>" end end end