From 8090434eb4d686035a8b6f4e1ff0d06b32d930a0 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 27 Oct 2013 23:23:46 -0400 Subject: v4 v5: cleaning, minor --- lib/sisu/v5/options.rb | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'lib/sisu/v5') diff --git a/lib/sisu/v5/options.rb b/lib/sisu/v5/options.rb index 6f23d5a1..5bf851e3 100644 --- a/lib/sisu/v5/options.rb +++ b/lib/sisu/v5/options.rb @@ -682,16 +682,6 @@ module SiSU_Commandline { bool: false, set: :off } else { bool: true, set: :na } end - act[:manifest]=if mod.inspect =~/"--inc-manifest"/ - { bool: true, set: :on } - elsif mod.inspect =~/"--(?:exc|no)-manifest"/ \ - || act[:switch][:off].inspect =~/"manifest"/ - { bool: false, set: :off } - elsif act[:manifest]=(cmd =~/y/ \ - || mod.inspect =~/"--manifest"/) - { bool: true, set: :on } - else { bool: true, set: :na } - end act[:links_to_manifest]=if mod.inspect =~/"--inc-links-to-manifest"|"--inc-manifest-links"/ { bool: true, set: :on } elsif mod.inspect =~/"--(?:exc|no)-manifest"/ \ -- cgit v1.2.3 From d08020e7b2cfd7cabc3b5d0aa18e5d07465ecfc6 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 27 Oct 2013 23:27:13 -0400 Subject: v4 v5: dal, document_structure_check_info --- lib/sisu/v5/dal_doc_str.rb | 138 +++++++++++++++++++++++++++++++++------------ 1 file changed, 102 insertions(+), 36 deletions(-) (limited to 'lib/sisu/v5') diff --git a/lib/sisu/v5/dal_doc_str.rb b/lib/sisu/v5/dal_doc_str.rb index edf826de..409c28ab 100644 --- a/lib/sisu/v5/dal_doc_str.rb +++ b/lib/sisu/v5/dal_doc_str.rb @@ -796,12 +796,71 @@ module SiSU_DAL_DocumentStructureExtract def initialize(md,data) @md,@data=md,data end + def structure_info + def lv + %w[0 A~ B~ C~ 1 2 3] + end + def possible_parents(child) + case child + when /A~/ + 'none' + when /B~/ + 'A~' + when /C~/ + 'B~' + when /1/ + 'A~, B~, C~' + when /2/ + '1' + when /3/ + '3' + end + end + def possible_children(parent) + case parent + when /A~/ + 'B~, 1' + when /B~/ + 'C~, 1' + when /C~/ + '1' + when /1/ + '2' + when /2/ + '3' + when /3/ + 'none' + end + end + self + end + def document_structure_check_info(node,node_parent,status=:ok) + node_ln=/^([0-6])/.match(node)[1].to_i + node_parent_ln=/^([0-6])/.match(node_parent)[1].to_i + if status==:error \ + or @md.opt.act[:maintenance][:set]==:on + puts %{node: #{node}, parent node: #{node_parent} #{status.upcase}} + if status==:error + node_ln=/^([0-6])/.match(node)[1].to_i + node_parent_ln=/^([0-6])/.match(node_parent)[1].to_i + puts %{current level: #{structure_info.lv[node_ln]} (possible parent levels: #{structure_info.possible_parents(structure_info.lv[node_ln])}) +parent level: #{structure_info.lv[node_parent_ln]} (possible child levels: #{structure_info.possible_children(structure_info.lv[node_parent_ln])}) +-- } + end + end + end + def warning_incorrect_parent_level_or_level(txt) + puts %{warning, +#{txt} +has incorrect level and/or parent level} + end def ocn #and auto segment numbering increment data=@data @o_array=[] 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|