From d29a3e5469d8468084641c385ebf16948f7c2437 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 22 Jul 2008 20:00:59 -0400 Subject: sisu-0.68.0 proposed * middle layer document representation changed, (accounting for substantial patch) * texpdf multiple document sizes as specified in config * numerous small fixes [should on the whole be easier to maintain] --- lib/sisu/v0/dal_doc_str_tables.rb | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'lib/sisu/v0/dal_doc_str_tables.rb') diff --git a/lib/sisu/v0/dal_doc_str_tables.rb b/lib/sisu/v0/dal_doc_str_tables.rb index a17eb63f..5b636dfa 100644 --- a/lib/sisu/v0/dal_doc_str_tables.rb +++ b/lib/sisu/v0/dal_doc_str_tables.rb @@ -97,29 +97,29 @@ module SiSU_document_structure_tables w=widths.split(/;/) tuned_file=[] tuned_file << if para =~/\{(?:t|table)~h(?:\sc\d+;)?[\d; ]*\}/ - "" + "#{Mx[:gr_o]}Th#{Mx[:tc_p]} c#{@row[2].length}; #{widths}#{Mx[:gr_c]}" elsif para =~/\{(?:t|table)(?:\sc\d+;)?[\d; ]*\}/ - "" + "#{Mx[:gr_o]}T#{Mx[:tc_p]} c#{@row[2].length}; #{widths}#{Mx[:gr_c]}" end @row.each do |l| l << '' if l.length == (@row[1].length - 1) table=[] if l.length == @row[1].length - table << '' + table << Mx[:tc_o] #'' n= -1 l.each do |c| n +=1 #'' + c + '' table << if c =~/\A(?:\n)?\s*\Z/ - "#{TS1}#{TS1}#{w[n]}#{TS1}" + ' ' + "#{Mx[:tc_p]}#{Mx[:tc_p]}#{w[n]}#{Mx[:tc_p]}" + ' ' else - "#{TS1}#{TS1}#{w[n]}#{TS1}" + c.strip + "#{Mx[:tc_p]}#{Mx[:tc_p]}#{w[n]}#{Mx[:tc_p]}" + c.strip end end - table << '!>' #'' + table << Mx[:tc_c] tuned_file << table.join end end - tuned_file << '' #'' + tuned_file << "#{Mx[:gr_o]}TZ#{Mx[:gr_c]}" #'' tuned_file=tuned_file.compact.join("\n") end def tables @@ -141,13 +141,13 @@ module SiSU_document_structure_tables instructions=$1 @@column=instructions.split(/;\s*/) @@columns=@@column[0] - para.gsub!(/^table\{~h\s+(c\d+?;.+?)$/,"") - para.gsub!(/^table\{\s+(c\d+?;.+?)$/,"") + para.gsub!(/^table\{~h\s+(c\d+?;.+?)$/,"#{Mx[:gr_o]}Th#{Mx[:tc_p]} \\1#{Mx[:gr_c]}") + para.gsub!(/^table\{\s+(c\d+?;.+?)$/,"#{Mx[:gr_o]}T#{Mx[:tc_p]} \\1#{Mx[:gr_c]}") @@flag['table_to']=true end if @@flag['table_to'] \ and para =~/\}table/ - para.gsub!(/^\}table\s*$/,"\n") + para.gsub!(/^\}table\s*$/,"#{Mx[:gr_o]}TZ#{Mx[:gr_c]}\n") para.gsub!(/\n/,' ') #newlines taken out para.strip! @tuned_table << para @@ -164,13 +164,13 @@ module SiSU_document_structure_tables @@line_mode=sub_array.scan(/.+/u) Tables.new(@md,@@line_mode).tr_td para=@@line_mode.join - para.gsub!(/(.*\S+.*)\Z/m,'') unless para =~// + para.gsub!(/\n/,' ') unless para =~/#{Mx[:gr_o]}(?:code|verse|alt|group)#{Mx[:gr_c]}/ para.strip! @tuned_file << para end @@ -182,11 +182,11 @@ module SiSU_document_structure_tables data=@data data.each do |line| if @@counter <= @@columns.to_i \ - and line !~/(\}T\s*$|<:table[-_](close|end)>|)/ + and line !~/(\}T\s*$|#{Mx[:gr_o]}:table[-_](close|end)#{Mx[:gr_c]}|#{Mx[:gr_o]}TZ#{Mx[:gr_c]})/ #if line.encoding.inspect =~/Encoding:ASCII-8BIT/ # line=line.force_encoding('utf-8') #end - line.gsub!(/(.+)/,"#{TS1}#{TS1}#{@@column[@@counter]}#{TS1}\\1") unless line =~/