From 1832a937713d33517066dc4cf8222871045b2b58 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 6 Jan 2014 22:56:02 -0500 Subject: v5: single document root A~ (recalibrate headings); level D~ possible * :A~ document title, single document root (ln==0) * introduce additional possible heading level, D~ * markup rule change: single document root * breaks much downstream code, recalibrate (fix, test, fix & test again) * v4 & v5 bifurcate (diverge "un-merge-ably") --- lib/sisu/v5/ao_numbering.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/sisu/v5/ao_numbering.rb') diff --git a/lib/sisu/v5/ao_numbering.rb b/lib/sisu/v5/ao_numbering.rb index 0458d626..8caa5ccc 100644 --- a/lib/sisu/v5/ao_numbering.rb +++ b/lib/sisu/v5/ao_numbering.rb @@ -158,7 +158,7 @@ module SiSU_AO_Numbering @subnumber=1 @subnumber=0 if dob.ln==no1 end - if dob.ln.to_s =~/^[1-6]/ \ + if dob.ln.to_s =~/^[0-6]/ \ and not dob.toc_ \ and dob.obj !~/#{Mx[:fa_o]}(?:~#|-#)#{Mx[:fa_c]}/ # <-- fix if dob.ln==no1 @@ -206,7 +206,7 @@ module SiSU_AO_Numbering dob.tags=["h#{title_no}",dob.tags].flatten #check whether will work across file types with stop signs dob=number_sub_heading(dob,no3,title_no) end - elsif dob.ln.to_s =~/^[1-6]/ \ + elsif dob.ln.to_s =~/^[0-6]/ \ and dob.name =~ /^[\w-]+-/ # endnotes, watch2005# endnotes, watch2005 dob.tags=[dob.name,dob.tags].flatten if dob.name !~/^\d+$/ #check whether will work across file types with stop signs dob.name.gsub(/^([a-z_\.]+)-$/,'\1') @@ -216,7 +216,7 @@ module SiSU_AO_Numbering and @md.markup =~/num_extract/ #AS DANGEROUS force enable with document, note already does this type of numbering for cisg, locate and coordinate logic, is currently misplaced in code, chengwei inspired 2004w23/4 #here lies a bug, as is nil when run from -Dv --update, FIX if (dob.name.nil? or dob.name.empty?) \ - and dob.ln.to_s =~/^[1-9]/ \ + and dob.ln.to_s =~/^[0-9]/ \ and dob.obj =~ /^([\d\.]+)/ #risky (must be unique) consider output to 4~~\d instead of 4~\d dob.name=$1 dob.tags=[dob.name,dob.tags].flatten if dob.name !~/^\d+$/ #check whether will work across file types with stop signs @@ -250,7 +250,7 @@ module SiSU_AO_Numbering || dob.of ==:para \ || dob.of ==:block if dob.is ==:heading \ - and dob.ln.to_s=~/^[1-9]/ #% sub-number system, (baby numbering) reset with any change of major number (more obviously should be placed in number titles, but that is conditionally executed, check and move later) + and dob.ln.to_s=~/^[0-9]/ #% sub-number system, (baby numbering) reset with any change of major number (more obviously should be placed in number titles, but that is conditionally executed, check and move later) number_small,letter_small=0,0 elsif dob.is ==:para if dob.obj =~/^#[ 1]/ \ @@ -373,7 +373,7 @@ module SiSU_AO_Numbering : @segname tags["#{dob.ocn}"]={ segname: @segname } ocn_html_seg[dob.ocn]=if (dob.is==:heading || dob.is==:heading_insert) - if dob.ln =~/[1-3]/ + if dob.ln =~/[0-3]/ { seg: nil, level: dob.ln } else #elsif dob.ln =~/[4-6]/ { seg: @seg, level: dob.ln } @@ -446,7 +446,7 @@ module SiSU_AO_Numbering @tuned_file=[] data.each do |dob| unless @md.set_heading_seg - if defined? dob.ln and dob.ln.to_s !~/^[123]/m \ + if defined? dob.ln and dob.ln.to_s !~/^[0-3]/m \ and dob.obj !~/\A\s*\Z/m \ and dob.is !=:layout @md.set_heading_seg=true -- cgit v1.2.3