From 6bc3b814011e829db684ec96bb3abd1e4abb29c3 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 8 Aug 2014 00:34:25 -0400 Subject: v5 v6: extend document structure, headings A - D, 1 - 4 * sql db table structure changed (needs to be rebuilt) --- lib/sisu/v5/ao_doc_str.rb | 78 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 67 insertions(+), 11 deletions(-) (limited to 'lib/sisu/v5/ao_doc_str.rb') diff --git a/lib/sisu/v5/ao_doc_str.rb b/lib/sisu/v5/ao_doc_str.rb index 931e51d3..11990abf 100644 --- a/lib/sisu/v5/ao_doc_str.rb +++ b/lib/sisu/v5/ao_doc_str.rb @@ -1223,7 +1223,7 @@ module SiSU_AO_DocumentStructureExtract end def structure_info def lv - %w[A~ B~ C~ D~ 1 2 3] + %w[A~ B~ C~ D~ 1 2 3 4] end def possible_parents(child) case child @@ -1234,6 +1234,7 @@ module SiSU_AO_DocumentStructureExtract when /1/ then 'A~, B~, C~, D~' when /2/ then '1' when /3/ then '2' + when /4/ then '3' end end def possible_children(parent) @@ -1244,20 +1245,21 @@ module SiSU_AO_DocumentStructureExtract when /D~/ then '1' when /1/ then '2' when /2/ then '3' - when /3/ then 'none' + when /3/ then '4' + when /4/ then '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 + node_ln=/^([0-7])/.match(node)[1].to_i + node_parent_ln=/^([0-7])/.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 + node_ln=/^([0-7])/.match(node)[1].to_i + node_parent_ln=/^([0-7])/.match(node_parent)[1].to_i STDERR.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])}) SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}"} @@ -1297,12 +1299,12 @@ SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}" required_headers_present? data=@data @o_array=[] - node=ocn=ocn_dv=ocn_sp=ocnh=ocnh0=ocnh1=ocnh2=ocnh3=ocnh4=ocnh5=ocnh6=ocno=ocnp=ocnt=ocnc=ocng=ocni=ocnu=0 # h heading, o other, t table, g group, i image + node=ocn=ocn_dv=ocn_sp=ocnh=ocnh0=ocnh1=ocnh2=ocnh3=ocnh4=ocnh5=ocnh6=ocnh7=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|
0 -- cgit v1.2.3