avv2word 1.1.20 → 1.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c2007bdd078951c37ebd73c35daf9a6a6022b23b366e28335c1f482a6da18b0
4
- data.tar.gz: 42af443d0dce033451ebd545115fe2db68438b338287cb8b6713f91a8de87fb2
3
+ metadata.gz: 12608a2eee602a49862149373bcca101d30c41dda0f01299aafcddc82339fc5d
4
+ data.tar.gz: 777335a6b1c245634f6f5c489838c586fe44c281fdf628deb089550b0281143e
5
5
  SHA512:
6
- metadata.gz: 6bedab9f56d9134974c78f20ab3b500102c281bae9d69c8f0c0c0c56e28be74b650421f7ed3730e13a5c32ed293d99cd415681346964dc0cbe72171a9d37a5f5
7
- data.tar.gz: ac2849c81b0dfd36a327b6b86673c936aa2d035777477093f9bd178a3a9375fa5a4d977ff3bd14e2d172109925c29b3ee19e6c50da0218ba71207d8ef243ffac
6
+ metadata.gz: 6844840f037c70f8643ff54f21f533fb55f68606879aa72f4c41266e483e8183a138ade09c9dec28154f783a01271da4ff45518707c4218037616a4d10c2932e
7
+ data.tar.gz: 51790dc531a1be5fd1aac15e5194f13a835e6534635c255cbc4eacd2cd01aba2982b44cab2531ca484199d93973fa46f54158902ca3b75d1612317d11433540b
@@ -92,6 +92,10 @@ module Avv2word
92
92
  def content_types_xml_file
93
93
  '[Content_Types].xml'
94
94
  end
95
+
96
+ def footnotes_xml_file
97
+ 'word/footnotes.xml'
98
+ end
95
99
  end
96
100
 
97
101
  def initialize(template_path)
@@ -193,7 +197,9 @@ module Avv2word
193
197
  @replaceable_files["word/footnotes.xml"] = ""
194
198
  return
195
199
  end
196
- doc = Nokogiri::XML.parse(File.read("templates/default/word/footnotes.xml"))
200
+ #text = Zip::File.open("templates/default.docx"){|zipfile| zipfile.read("word/footnotes.xml")}
201
+ text = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><w:footnotes xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:cx=\"http://schemas.microsoft.com/office/drawing/2014/chartex\" xmlns:cx1=\"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex\" xmlns:cx2=\"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex\" xmlns:cx3=\"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex\" xmlns:cx4=\"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex\" xmlns:cx5=\"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex\" xmlns:cx6=\"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex\" xmlns:cx7=\"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex\" xmlns:cx8=\"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:aink=\"http://schemas.microsoft.com/office/drawing/2016/ink\" xmlns:am3d=\"http://schemas.microsoft.com/office/drawing/2017/model3d\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:w16cid=\"http://schemas.microsoft.com/office/word/2016/wordml/cid\" xmlns:w16se=\"http://schemas.microsoft.com/office/word/2015/wordml/symex\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 w15 w16se w16cid wp14\"><w:footnote w:type=\"separator\" w:id=\"-1\"><w:p w:rsidR=\"00C3170C\" w:rsidRDefault=\"00C3170C\" w:rsidP=\"001755D5\"><w:r><w:separator/></w:r></w:p></w:footnote><w:footnote w:type=\"continuationSeparator\" w:id=\"0\"><w:p w:rsidR=\"00C3170C\" w:rsidRDefault=\"00C3170C\" w:rsidP=\"001755D5\"><w:r><w:continuationSeparator/></w:r></w:p></w:footnote><w:footnote w:id=\"1\"><w:p w:rsidR=\"001755D5\" w:rsidRDefault=\"001755D5\"><w:pPr><w:pStyle w:val=\"FootnoteText\"/></w:pPr><w:r><w:rPr><w:rStyle w:val=\"FootnoteReference\"/></w:rPr><w:footnoteRef/></w:r><w:r><w:t xml:space=\"preserve\"> How are you?</w:t></w:r></w:p></w:footnote></w:footnotes>"
202
+ doc = Nokogiri::XML.parse( text )
197
203
  fn_node = doc.xpath("//w:footnote").last
198
204
  footnotes.each_with_index do |footnote,i|
199
205
  fn_node2 = fn_node.clone
@@ -206,8 +212,8 @@ module Avv2word
206
212
  @replaceable_files["word/footnotes.xml"] = doc.to_xml
207
213
  # add relation
208
214
  rels = Nokogiri::XML(@replaceable_files["word/_rels/document.xml.rels"])
209
- new_rel = '<Relationship Id="rIdXXXXX" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes" Target="footnotes.xml"/>'
210
- new_rel.sub!(/XXXXX/, (rels.xpath("//xmlns:Relationship").size+1).to_s )
215
+ new_rel = '<Relationship Id="rIdXX" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes" Target="footnotes.xml"/>'
216
+ new_rel.sub!(/XX/, (rels.xpath("//xmlns:Relationship").size+1).to_s )
211
217
  new_rel = Nokogiri::XML.parse(new_rel).child
212
218
  rels.children.first << new_rel
213
219
  @replaceable_files["word/_rels/document.xml.rels"] = rels.to_xml
@@ -1,3 +1,3 @@
1
1
  module Avv2word
2
- VERSION = '1.1.20'
2
+ VERSION = '1.1.21'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avv2word
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.20
4
+ version: 1.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marián Bilas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-11 00:00:00.000000000 Z
11
+ date: 2019-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack