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) --- data/doc/sisu/CHANGELOG_v4 | 4 +++ data/doc/sisu/CHANGELOG_v5 | 4 +++ lib/sisu/v4/dal_doc_str.rb | 65 ++++++++++++++++++++++++++++++++++++++++++---- lib/sisu/v5/dal_doc_str.rb | 65 ++++++++++++++++++++++++++++++++++++++++++---- 4 files changed, 128 insertions(+), 10 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v4 b/data/doc/sisu/CHANGELOG_v4 index cbecabca..dcae4ada 100644 --- a/data/doc/sisu/CHANGELOG_v4 +++ b/data/doc/sisu/CHANGELOG_v4 @@ -30,6 +30,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_4.2.8.orig.tar.xz sisu_4.2.8.orig.tar.xz sisu_4.2.8-1.dsc +* dal, parent & node info, fix + (used e.g. for mind map type output (last for kdissert output, no longer + supported)) + %% 4.2.7.orig.tar.xz (2013-10-17:41/4) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_4.2.7 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_4.2.7-1 diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index d28aeaee..7f3db7f0 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -32,6 +32,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.0.21.orig.tar.xz * options & downstream, more use of opt.act.*.set==:on instead of opt.cmd =~/\S/ +* dal, parent & node info, fix + (used e.g. for mind map type output (last for kdissert output, no longer + supported)) + %% 5.0.20.orig.tar.xz (2013-10-17:41/4) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_5.0.20 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_5.0.20-1 diff --git a/lib/sisu/v4/dal_doc_str.rb b/lib/sisu/v4/dal_doc_str.rb index e4a0be2b..552163a2 100644 --- a/lib/sisu/v4/dal_doc_str.rb +++ b/lib/sisu/v4/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.cmd=~/q/ + node1 + else + puts "warning, incorrect node and or parent level" unless @md.opt.cmd=~/q/ + 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.cmd=~/q/ + 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.cmd=~/q/ + node3 + elsif node2 + puts "warning, incorrect node and or parent level" unless @md.opt.cmd=~/q/ + node2 + elsif node1 + puts "warning, incorrect node and or parent level" unless @md.opt.cmd=~/q/ + 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.cmd=~/q/ + node4 + elsif node3 + puts "warning, incorrect node and or parent level" unless @md.opt.cmd=~/q/ + node3 + elsif node2 + puts "warning, incorrect node and or parent level" unless @md.opt.cmd=~/q/ + node2 + elsif node1 + puts "warning, incorrect node and or parent level" unless @md.opt.cmd=~/q/ + node1 + else + 0 + end + node,ocn_sp=node6,"h#{ocnh}" end else ocno+=1 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