ruby_docx_beta 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fd4e2a60f7e42de5175a06cf4e50d7e90feb0a5
|
4
|
+
data.tar.gz: 92436e4cc6ec99d81f9191391674a1ca6fa6e41b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bda5ef2feb28778ebac31649d85f0cb97dc05006790994a6f6aef244b53d6016404f5a35ffc32fcb7c33baa2f7346a193884e87c5156bcaf701c009e231627aa
|
7
|
+
data.tar.gz: 6a1388d538c152937bcc95a47eaf3c833213b8a3a14c22a194c2f42d5cf9e85997fad62ed8aa3025c417ec1338a8ac74ed16063812a6efd45714a560c02baae7
|
@@ -28,13 +28,42 @@ module RubyDocx::Elements
|
|
28
28
|
@link = lnk
|
29
29
|
end
|
30
30
|
|
31
|
+
def width
|
32
|
+
ext = @node.xpath(".//a:ext", "a" => "http://schemas.openxmlformats.org/drawingml/2006/main").first
|
33
|
+
|
34
|
+
ext["cx"].value.to_i/9525.0
|
35
|
+
rescue
|
36
|
+
nil
|
37
|
+
end
|
38
|
+
|
39
|
+
def height
|
40
|
+
ext = @node.xpath(".//a:ext", "a" => "http://schemas.openxmlformats.org/drawingml/2006/main").first
|
41
|
+
|
42
|
+
ext["cy"].value.to_i/9525.0
|
43
|
+
rescue
|
44
|
+
nil
|
45
|
+
end
|
46
|
+
|
31
47
|
def style
|
32
48
|
element = @node.xpath(".//v:shape").first
|
33
49
|
|
34
50
|
if element && element.attributes.keys.index("style")
|
35
51
|
element.attributes["style"].value
|
36
52
|
else
|
37
|
-
|
53
|
+
s = ""
|
54
|
+
if self.width
|
55
|
+
s += "width: #{self.width}px;"
|
56
|
+
end
|
57
|
+
|
58
|
+
if self.height
|
59
|
+
s += "height: #{self.height}px;"
|
60
|
+
end
|
61
|
+
|
62
|
+
if self.width || self.height
|
63
|
+
s
|
64
|
+
else
|
65
|
+
nil
|
66
|
+
end
|
38
67
|
end
|
39
68
|
end
|
40
69
|
|
@@ -51,9 +51,9 @@ module RubyDocx::Elements
|
|
51
51
|
|
52
52
|
def to_html
|
53
53
|
if @link
|
54
|
-
"<img src='#{@link}' data-latex=\"#{self.to_latex}\" style='height: 13px;' />"
|
54
|
+
"<img src='#{@link}' data-latex=\"#{self.to_latex}\" data-mathml=\"#{self.to_mathml}\" style='height: 13px;' />"
|
55
55
|
else
|
56
|
-
"<img src='#{self.base64_data}' data-latex=\"#{self.to_latex}\" style='height: 13px;' />"
|
56
|
+
"<img src='#{self.base64_data}' data-latex=\"#{self.to_latex}\" data-mathml=\"#{self.to_mathml}\" style='height: 13px;' />"
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
@@ -83,16 +83,16 @@ module RubyDocx::Elements
|
|
83
83
|
def to_html
|
84
84
|
if self.style
|
85
85
|
if @link
|
86
|
-
"<img src='#{@link}' data-latex=\"#{self.to_latex}\" style='#{self.style}' />"
|
86
|
+
"<img src='#{@link}' data-latex=\"#{self.to_latex}\" data-mathml=\"#{self.to_mathml}\" style='#{self.style}' />"
|
87
87
|
else
|
88
|
-
"<img src='#{self.base64_data}' data-latex=\"#{self.to_latex}\" style='#{self.style}' />"
|
88
|
+
"<img src='#{self.base64_data}' data-latex=\"#{self.to_latex}\" data-mathml=\"#{self.to_mathml}\" style='#{self.style}' />"
|
89
89
|
end
|
90
90
|
|
91
91
|
else
|
92
92
|
if @link
|
93
|
-
"<img src='#{@link}' data-latex=\"#{self.to_latex}\" style='height: 13px;' />"
|
93
|
+
"<img src='#{@link}' data-latex=\"#{self.to_latex}\" data-mathml=\"#{self.to_mathml}\" style='height: 13px;' />"
|
94
94
|
else
|
95
|
-
"<img src='#{self.base64_data}' data-latex=\"#{self.to_latex}\" style='height: 13px;' />"
|
95
|
+
"<img src='#{self.base64_data}' data-latex=\"#{self.to_latex}\" data-mathml=\"#{self.to_mathml}\" style='height: 13px;' />"
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
data/lib/ruby_docx/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_docx_beta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joey Lin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|