diff options
Diffstat (limited to 'lib/sisu/v5/xml_scaffold_structure_sisu.rb')
-rw-r--r-- | lib/sisu/v5/xml_scaffold_structure_sisu.rb | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/lib/sisu/v5/xml_scaffold_structure_sisu.rb b/lib/sisu/v5/xml_scaffold_structure_sisu.rb index 5e2afa4d..39ca1e6a 100644 --- a/lib/sisu/v5/xml_scaffold_structure_sisu.rb +++ b/lib/sisu/v5/xml_scaffold_structure_sisu.rb @@ -70,7 +70,9 @@ module SiSU_XML_Scaffold_Structure_Sisu def initialize(opt) @opt=opt @particulars=SiSU_Particulars::CombinedSingleton.instance.get_all(opt) - @sp=' ' + end + def spaces + Ax[:spaces] end def read begin @@ -87,7 +89,6 @@ module SiSU_XML_Scaffold_Structure_Sisu class Scroll <Source def initialize(data='',md='') @data,@md=data,md - @sp=' ' end def songsheet @t='sisu' @@ -114,13 +115,13 @@ module SiSU_XML_Scaffold_Structure_Sisu puts "\nsisu structure, heading outline --->\n\n" data.each_with_index do |o,i| if (o.is ==:heading || o.is ==:heading_insert) - puts "#{@sp*o.ln}<#{tags.sisu[o.ln]}>[#{o.ocn}] #{o.ln} #{o.obj}</#{tags.sisu[o.ln]}>" + puts "#{spaces*o.ln}<#{tags.sisu[o.ln]}>[#{o.ocn}] #{o.ln} #{o.obj}</#{tags.sisu[o.ln]}>" end end end def output(o,lev=nil,comment='') - puts lev == 0..6 \ - ? "#{@sp*lev}<#{lev}>[#{o.ocn}] #{o.ln} #{o.obj}</#{lev}>#{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 def structure_build_sisu(data) @@ -131,7 +132,7 @@ module SiSU_XML_Scaffold_Structure_Sisu data.each_with_index do |o,i| if (o.is ==:heading || o.is ==:heading_insert) structure_build_tag_close(o.ln,h) - puts "#{@sp*o.ln}<#{@s[o.ln]}>\n#{@sp*o.ln} [#{o.ocn}] #{o.ln} {#{o.node}}" + 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] @@ -149,37 +150,37 @@ module SiSU_XML_Scaffold_Structure_Sisu def structure_build_tag_close(lev,h) case h[0] when 1 - puts "#{@sp*1}</#{@s[1]}>" if (lev <= 1) && h[1] + puts "#{spaces*1}</#{@s[1]}>" if (lev <= 1) && h[1] puts "</#{@s[0]}>" if (lev==0) when 2 - puts "#{@sp*2}</#{@s[2]}>" if (lev <= 2) && h[2] - puts "#{@sp*1}</#{@s[1]}>" if (lev <= 1) && h[1] + 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 "#{@sp*3}</#{@s[3]}>" if (lev <= 3) && h[3] - puts "#{@sp*2}</#{@s[2]}>" if (lev <= 2) && h[2] - puts "#{@sp*1}</#{@s[1]}>" if (lev <= 1) && h[1] + 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 "#{@sp*4}</#{@s[4]}>" if (lev <= 4) - puts "#{@sp*3}</#{@s[3]}>" if (lev <= 3) && h[3] - puts "#{@sp*2}</#{@s[2]}>" if (lev <= 2) && h[2] - puts "#{@sp*1}</#{@s[1]}>" if (lev <= 1) && h[1] + 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 "#{@sp*5}</#{@s[5]}>" if (lev <= 5) - puts "#{@sp*4}</#{@s[4]}>" if (lev <= 4) - puts "#{@sp*3}</#{@s[3]}>" if (lev <= 3) && h[3] - puts "#{@sp*2}</#{@s[2]}>" if (lev <= 2) && h[2] - puts "#{@sp*1}</#{@s[1]}>" if (lev <= 1) && h[1] + 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 "#{@sp*6}</#{@s[6]}>" if (lev <= 6) - puts "#{@sp*5}</#{@s[5]}>" if (lev <= 5) - puts "#{@sp*4}</#{@s[4]}>" if (lev <= 4) - puts "#{@sp*3}</#{@s[3]}>" if (lev <= 3) && h[3] - puts "#{@sp*2}</#{@s[2]}>" if (lev <= 2) && h[2] - puts "#{@sp*1}</#{@s[1]}>" if (lev <= 1) && h[1] + 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 |