From edd89902036bde18c91031470e19c871a182cf6d Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 23 Oct 2013 23:40:45 -0400 Subject: v5: options & downstream, more use of opt.act instead of opt.cmd * opt.act.*.set==:on instead of opt.cmd =~/\S/ --- lib/sisu/v5/dal_doc_str.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/sisu/v5/dal_doc_str.rb') diff --git a/lib/sisu/v5/dal_doc_str.rb b/lib/sisu/v5/dal_doc_str.rb index 87e5c908..4b31c066 100644 --- a/lib/sisu/v5/dal_doc_str.rb +++ b/lib/sisu/v5/dal_doc_str.rb @@ -952,7 +952,7 @@ module SiSU_DAL_DocumentStructureExtract hs=[0,false,false,false] t={ lv: @s[0], status: 'open' } tuned_file << tags(t) - if @md.opt.cmd =~/V/ + if @md.opt.act[:verbose_plus][:set]==:on puts "\nXML sisu structure outline --->\n" puts "<#{@s[0]}>" end @@ -963,7 +963,7 @@ module SiSU_DAL_DocumentStructureExtract when 1 tuned_file << tag_close(o.ln,hs) tuned_file << tag_open(o,@s) - if @md.opt.cmd =~/V/ + if @md.opt.act[:verbose_plus][:set]==:on puts_tag_close(o.ln,hs) puts_tag_open(o,@s) end @@ -971,7 +971,7 @@ module SiSU_DAL_DocumentStructureExtract when 2 tuned_file << tag_close(o.ln,hs) tuned_file << tag_open(o,@s) - if @md.opt.cmd =~/V/ + if @md.opt.act[:verbose_plus][:set]==:on puts_tag_close(o.ln,hs) puts_tag_open(o,@s) end @@ -979,7 +979,7 @@ module SiSU_DAL_DocumentStructureExtract when 3 tuned_file << tag_close(o.ln,hs) tuned_file << tag_open(o,@s) - if @md.opt.cmd =~/V/ + if @md.opt.act[:verbose_plus][:set]==:on puts_tag_close(o.ln,hs) puts_tag_open(o,@s) end @@ -987,7 +987,7 @@ module SiSU_DAL_DocumentStructureExtract when 4 tuned_file << tag_close(o.ln,hs) tuned_file << tag_open(o,@s) - if @md.opt.cmd =~/V/ + if @md.opt.act[:verbose_plus][:set]==:on puts_tag_close(o.ln,hs) puts_tag_open(o,@s) end @@ -995,7 +995,7 @@ module SiSU_DAL_DocumentStructureExtract when 5 tuned_file << tag_close(o.ln,hs) tuned_file << tag_open(o,@s) - if @md.opt.cmd =~/V/ + if @md.opt.act[:verbose_plus][:set]==:on puts_tag_close(o.ln,hs) puts_tag_open(o,@s) end @@ -1003,7 +1003,7 @@ module SiSU_DAL_DocumentStructureExtract when 6 tuned_file << tag_close(o.ln,hs) tuned_file << tag_open(o,@s) - if @md.opt.cmd =~/V/ + if @md.opt.act[:verbose_plus][:set]==:on puts_tag_close(o.ln,hs) puts_tag_open(o,@s) end @@ -1012,7 +1012,7 @@ module SiSU_DAL_DocumentStructureExtract end tuned_file << o end - puts_tag_close(0,hs) if @md.opt.cmd =~/V/ + puts_tag_close(0,hs) if @md.opt.act[:verbose_plus][:set]==:on tuned_file << tag_close(0,hs) tuned_file=tuned_file.flatten end -- cgit v1.2.3 From f7da57f46e69dd2fd0ac30eed917b82ea66217f9 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 23 Oct 2013 23:46:55 -0400 Subject: v4 v5: dal, parent & node info, fix * used e.g. for mind map type output (last for kdissert output, no longer supported) --- lib/sisu/v5/dal_doc_str.rb | 65 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 60 insertions(+), 5 deletions(-) (limited to 'lib/sisu/v5/dal_doc_str.rb') diff --git a/lib/sisu/v5/dal_doc_str.rb b/lib/sisu/v5/dal_doc_str.rb index 4b31c066..dbdab139 100644 --- a/lib/sisu/v5/dal_doc_str.rb +++ b/lib/sisu/v5/dal_doc_str.rb @@ -843,23 +843,78 @@ module SiSU_DAL_DocumentStructureExtract elsif ln==2 \ or ln=~@md.lv2; ocnh2+=1 node2="2:#{ocnh2};#{ocn}" - node,ocn_sp,parent=node2,"h#{ocnh}",node1 + parent=if node1 + node1 + else + 0 + end + node,ocn_sp=node2,"h#{ocnh}" elsif ln==3 \ or ln=~@md.lv3; ocnh3+=1 node3="3:#{ocnh3};#{ocn}" - node,ocn_sp,parent=node3,"h#{ocnh}",node2 + parent=if node2 + node2 + elsif node1 + puts "warning, incorrect parent or node level, parent is :A~ parent should be :B~ else this node should be :B~ rather than :C~" unless @md.opt.act[:quiet][:set]==:on + node1 + else + puts "warning, incorrect node and or parent level" unless @md.opt.act[:quiet][:set]==:on + 0 + end + node,ocn_sp=node3,"h#{ocnh}" elsif ln==4 \ or ln=~@md.lv4; ocnh4+=1 node4="4:#{ocnh4};#{ocn}" - node,ocn_sp,parent=node4,"h#{ocnh}",node3 + parent=if node3 + node3 + elsif node2 + node2 + elsif node1 + node1 + else + puts "warning, incorrect node and or parent level" unless @md.opt.act[:quiet][:set]==:on + 0 + end + node,ocn_sp=node4,"h#{ocnh}" elsif ln==5 \ or ln=~@md.lv5; ocnh5+=1 node5="5:#{ocnh5};#{ocn}" - node,ocn_sp,parent=node5,"h#{ocnh}",node4 + parent=if node4 + node4 + elsif node3 + puts "warning, incorrect node and or parent level" unless @md.opt.act[:quiet][:set]==:on + node3 + elsif node2 + puts "warning, incorrect node and or parent level" unless @md.opt.act[:quiet][:set]==:on + node2 + elsif node1 + puts "warning, incorrect node and or parent level" unless @md.opt.act[:quiet][:set]==:on + node1 + else + 0 + end + node,ocn_sp=node5,"h#{ocnh}" elsif ln==6 \ or ln=~@md.lv6; ocnh6+=1 node6="6:#{ocnh6};#{ocn}" - node,ocn_sp,parent=node6,"h#{ocnh}",node5 + parent=if node5 + node5 + elsif node4 + puts "warning, incorrect parent or node level, parent is 4~ parent should be 5~ else this node should be 5~ rather than 6~" unless @md.opt.act[:quiet][:set]==:on + node4 + elsif node3 + puts "warning, incorrect node and or parent level" unless @md.opt.act[:quiet][:set]==:on + node3 + elsif node2 + puts "warning, incorrect node and or parent level" unless @md.opt.act[:quiet][:set]==:on + node2 + elsif node1 + puts "warning, incorrect node and or parent level" unless @md.opt.act[:quiet][:set]==:on + node1 + else + 0 + end + node,ocn_sp=node6,"h#{ocnh}" end else ocno+=1 -- cgit v1.2.3 From 15ff37477b84c90a365954c81ce6726a0137de37 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 23 Oct 2013 23:58:37 -0400 Subject: v4 v5: dal, collapsed levels implemented * convenience, collapse sisu's dual level document structure for output of markup with straight linear structure --- lib/sisu/v5/dal_doc_str.rb | 69 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 57 insertions(+), 12 deletions(-) (limited to 'lib/sisu/v5/dal_doc_str.rb') diff --git a/lib/sisu/v5/dal_doc_str.rb b/lib/sisu/v5/dal_doc_str.rb index dbdab139..edf826de 100644 --- a/lib/sisu/v5/dal_doc_str.rb +++ b/lib/sisu/v5/dal_doc_str.rb @@ -802,6 +802,7 @@ module SiSU_DAL_DocumentStructureExtract node=ocn=ocn_dv=ocn_sp=ocnh=ocnh1=ocnh2=ocnh3=ocnh4=ocnh5=ocnh6=ocno=ocnp=ocnt=ocnc=ocng=ocni=ocnu=0 # h heading, o other, t table, g group, i image regex_exclude_ocn_and_node = /#{Rx[:meta]}|^@\S+?:\s|^4~endnotes|^#{Mx[:lv_o]}4:endnotes#{Mx[:lv_c]}|^\^~ |<:e[:_]\d+?>|^<:\#|<:- |<[:!]!4|