From 6d46257531b1384a3bff974e039b70f7a45c3ecc Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 15 Oct 2011 13:57:29 -0400 Subject: v2 v3: odf:odt v1.0: make odt header easier to track; remove binary blob * make odt header changes easier to track (this commit maintains rough equivalence to sisu-3.1.0 headers) * sysenv, builds odf:odt directory structure instead of binary blob * get rid of odf:odt (binary changeset) blob zipfile (containing odf:odt directory structure) --- lib/sisu/v2/odf.rb | 159 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 95 insertions(+), 64 deletions(-) (limited to 'lib/sisu/v2/odf.rb') diff --git a/lib/sisu/v2/odf.rb b/lib/sisu/v2/odf.rb index b6ec4c1b..2880cdfe 100644 --- a/lib/sisu/v2/odf.rb +++ b/lib/sisu/v2/odf.rb @@ -81,7 +81,6 @@ module SiSU_ODF def read begin @env,@md,@dal_array=@particulars.env,@particulars.md,@particulars.dal_array - @env.odf_structure opendoc=@md.fn[:odf] path=@env.path.output_tell unless @opt.cmd =~/q/ @@ -456,6 +455,7 @@ module SiSU_ODF def markup(data) # Used for major markup instructions safe_characters=/[^a-zA-Z0-9}{\/?,."';:)(><\-_&!@%~#\]\[*=$| \n+`#{Mx[:tc_p]}]/u dir=SiSU_Env::Info_env.new(@md.fns) + dir.path.odf_bld @data_mod,@endnotes,@level,@cont,@copen,@odf_contents_close=Array.new(6){[]} @rcdc=false (0..6).each { |x| @cont[x]=@level[x]=false } @@ -550,30 +550,35 @@ module SiSU_ODF end def pre table=if @md.flag_tables - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + x=< + + + + + + + + + + + + + + + + + + + + + + + +WOK + x.strip! + x.gsub!(/\n+/m,'') unless @md.opt.cmd=~/M/ + x else '' end breakpage=if @md.pagenew \ @@ -581,45 +586,50 @@ module SiSU_ODF ' fo:break-before="page"' else '' end - @@odf[:head]<<%{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{table}#{@br}} + - %{#{@br}} + - %{#{@br}} + # P1 - %{#{@br}} + # P1 - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + # P1 - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{#{@br}} + - %{} + x=< + + + +#{table} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +WOK + x.strip! + x.gsub!(/\n+/m,'') unless @md.opt.cmd=~/M/ + @@odf[:head] << x end def post end @@ -642,6 +652,27 @@ module SiSU_ODF end def odf #%odf output SiSU_Env::SiSU_file.new(@md).mkdir + header=SiSU_ODF_format::ODT_head.new(@md) + filename="#{@env.path.odf}/META-INF/manifest.xml" + od=File.new(filename,'w+') + od << header.meta_inf_manifest_xml + od.close + filename="#{@env.path.odf}/meta.xml" + od=File.new(filename,'w+') + od << header.meta_xml + od.close + filename="#{@env.path.odf}/settings.xml" + od=File.new(filename,'w+') + od << header.settings_xml + od.close + filename="#{@env.path.odf}/styles.xml" + od=File.new(filename,'w+') + od << header.styles_xml + od.close + filename="#{@env.path.odf}/mimetype" + od=File.new(filename,'w+') + od << header.mimetype + od.close filename="#{@env.path.odf}/content.xml" od=File.new(filename,'w+') @content.each do |para| # this is a hack -- cgit v1.2.3