diff options
author | Ralph Amissah <ralph@amissah.com> | 2015-04-19 14:44:38 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2015-05-01 18:49:40 -0400 |
commit | 1323f18af45ea0d3aaef5cd9ead0efb5de8b9729 (patch) | |
tree | e1abd6d04547c269666f276d8bdb24afa9d7dfee /lib/sisu/current/xml_odf_odt.rb | |
parent | setup.rb s/Config/RbConfig/ (diff) |
c<-d: sync, roll develop into current dir branch (5==6)
* two dir branches, same library contents
(v5 synced & updated with v6)
Diffstat (limited to 'lib/sisu/current/xml_odf_odt.rb')
-rw-r--r-- | lib/sisu/current/xml_odf_odt.rb | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/lib/sisu/current/xml_odf_odt.rb b/lib/sisu/current/xml_odf_odt.rb index 8b7c493c..8a09fb88 100644 --- a/lib/sisu/current/xml_odf_odt.rb +++ b/lib/sisu/current/xml_odf_odt.rb @@ -67,7 +67,8 @@ module SiSU_XML_ODF_ODT require_relative 'txt_shared' # txt_shared.rb require_relative 'xml_shared' # xml_shared.rb include SiSU_XML_Munge - @@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0 + require_relative 'xml_persist' # xml_persist.rb + @@alt_id_count,@@alt_id_count=0,0 class Source begin require 'zlib' @@ -128,7 +129,6 @@ module SiSU_XML_ODF_ODT require_relative 'txt_shared' # txt_shared.rb include SiSU_Parts_XML @@img_count=0 - @@odf={ body: [], head: [], toc: [], metadata: [], tail: [], book_idx: [], endnotes: [] } @@docstart=true @@fns=nil def initialize(particulars) @@ -140,10 +140,12 @@ module SiSU_XML_ODF_ODT end def songsheet begin + @per=SiSU_XML_Persist::Persist.new pre @data=markup(@ao_array) publish ensure + SiSU_XML_Persist::Persist.new.persist_init unless (@md.opt.act[:verbose_plus][:set]==:on \ || @md.opt.act[:maintenance][:set]==:on) if @env.processing_path.odt =~/od[ft]/ @@ -187,18 +189,18 @@ module SiSU_XML_ODF_ODT end idx_arr << x.strip if x.is_a?(String) end - @@odf[:book_idx]=idx_arr.join + @per.book_idx=idx_arr.join end end def odf_metadata - @@odf[:metadata]=SiSU_Metadata::Summary.new(@md). + @per.metadata=SiSU_Metadata::Summary.new(@md). odf.metadata end def odf_tail manifest="#{@md.file.output_path.manifest.url}/#{@md.file.base_filename.manifest}" - @@odf[:tail] << %{<text:p text:style-name="P_normal">Available document outputs: <br /> <<text:a xl:type="simple" xl:href="#{manifest}">#{manifest}</text:a>></text:p>} - @@odf[:tail] << %{\n<text:p text:style-name="P_normal">SiSU: <<text:a xl:type="simple" xl:href="http://www.jus.uio.no/lm">www.jus.uio.no/sisu</text:a>> and <<text:a xl:type="simple" xl:href="http://www.sisudoc.org">www.sisudoc.org</text:a>></text:p>} - @@odf[:tail] << "\n</office:text></office:body></office:document-content>" + @per.tail << %{<text:p text:style-name="P_normal">Available document outputs: <br /> <<text:a xl:type="simple" xl:href="#{manifest}">#{manifest}</text:a>></text:p>} + @per.tail << %{\n<text:p text:style-name="P_normal">SiSU: <<text:a xl:type="simple" xl:href="http://www.jus.uio.no/lm">www.jus.uio.no/sisu</text:a>> and <<text:a xl:type="simple" xl:href="http://www.sisudoc.org">www.sisudoc.org</text:a>></text:p>} + @per.tail << "\n</office:text></office:body></office:document-content>" end def set_bookmark_tag(dob) SiSU_XML_ODF_ODT_Format::Tags.new.set_bookmark_tag(dob) @@ -616,26 +618,26 @@ module SiSU_XML_ODF_ODT end end if dob.is==:heading - @@odf[:body] << heading(dob,p_num).obj << break_line*2 + @per.body << heading(dob,p_num).obj << break_line*2 if SiSU_Env::ProcessingSettings.new(md).build.toc? if dob.lv =~/[A-D1]/i - @@odf[:toc] << toc(dob,p_num).obj + @per.toc << toc(dob,p_num).obj end end elsif dob.is ==:verse - @@odf[:body] << poem(dob,p_num).obj << break_line*2 + @per.body << poem(dob,p_num).obj << break_line*2 elsif dob.is==:group - @@odf[:body] << group(dob,p_num).obj << break_line*2 + @per.body << group(dob,p_num).obj << break_line*2 elsif dob.is==:block - @@odf[:body] << block(dob,p_num).obj << break_line*2 + @per.body << block(dob,p_num).obj << break_line*2 elsif dob.is==:code - @@odf[:body] << code(dob,p_num).obj << break_line*2 + @per.body << code(dob,p_num).obj << break_line*2 elsif dob.is==:table #elsif dob.obj =~ /<!Th?ยก/u - @@odf[:body] << table(dob,p_num).obj << break_line*2 + @per.body << table(dob,p_num).obj << break_line*2 elsif dob.is==:break - @@odf[:body] << obj_break(dob).obj << break_line*2 + @per.body << obj_break(dob).obj << break_line*2 else - @@odf[:body] << normal(dob,p_num).obj << break_line*2 # main text, contents, body KEEP + @per.body << normal(dob,p_num).obj << break_line*2 # main text, contents, body KEEP end @@endnotes_para=[] end @@ -803,20 +805,20 @@ WOK WOK x=x.strip x=x.gsub(/\n+/m,'') unless @md.opt.act[:maintenance][:set]==:on - @@odf[:head] << x + @per.head << x end def publish content=[] br_pg='<text:p text:style-name="P_normal_page_new"> </text:p>' content << - @@odf[:head] << - @@odf[:toc] << + @per.head << + @per.toc << br_pg << - @@odf[:body] << - @@odf[:book_idx] << + @per.body << + @per.book_idx << br_pg << - @@odf[:metadata] << - @@odf[:tail] + @per.metadata << + @per.tail SiSU_XML_ODF_ODT::Source::Output.new(content,@md,@env).odf @@odf={ head: [], toc: [], body: [], tail: [], book_idx: [], metadata: [] } end |