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 +4 -4
- data/lib/avv2word/document.rb +9 -3
- data/lib/avv2word/templates/default.docx +0 -0
- data/lib/avv2word/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 12608a2eee602a49862149373bcca101d30c41dda0f01299aafcddc82339fc5d
|
|
4
|
+
data.tar.gz: 777335a6b1c245634f6f5c489838c586fe44c281fdf628deb089550b0281143e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6844840f037c70f8643ff54f21f533fb55f68606879aa72f4c41266e483e8183a138ade09c9dec28154f783a01271da4ff45518707c4218037616a4d10c2932e
|
|
7
|
+
data.tar.gz: 51790dc531a1be5fd1aac15e5194f13a835e6534635c255cbc4eacd2cd01aba2982b44cab2531ca484199d93973fa46f54158902ca3b75d1612317d11433540b
|
data/lib/avv2word/document.rb
CHANGED
|
@@ -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
|
-
|
|
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="
|
|
210
|
-
new_rel.sub!(/
|
|
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
|
|
Binary file
|
data/lib/avv2word/version.rb
CHANGED
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.
|
|
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
|
+
date: 2019-07-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actionpack
|