metanorma-utils 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/utils/main.rb +79 -13
- data/lib/utils/version.rb +1 -1
- data/metanorma-utils.gemspec +2 -0
- data/spec/fixtures/rice_image1.png +0 -0
- data/spec/utils_spec.rb +127 -2
- metadata +31 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23f7f4f49baca7a94514b1e777c9b5f5e4b2e7338718926c2efb969e5a654dbf
|
4
|
+
data.tar.gz: f59c03b860494a645f430f0b7c52a01581d78ff44edbcd1c1469bbce9d616161
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d13842ede73e8ba31e6bd00ce7893a5e52aba0742a984e316ea3f3fc6af7d0c96d79902881aa1bbd9e0429dd32da51f31d66f9e73564d528c6d46796af62cbef
|
7
|
+
data.tar.gz: 511b8d457ab0e755bfcf1847c3406038ce3de29220ea40dd9b917ca1706a9da896be8c59aa58cb75e7ed98d40b2372772fd329eb35eb203fb305a2c9abe978c1
|
data/lib/utils/main.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
require "asciidoctor"
|
2
|
+
require "tempfile"
|
2
3
|
require "sterile"
|
3
4
|
require "uuidtools"
|
5
|
+
require "mimemagic"
|
6
|
+
require "mime/types"
|
7
|
+
require "base64"
|
4
8
|
|
5
9
|
module Metanorma
|
6
10
|
module Utils
|
@@ -78,23 +82,50 @@ module Metanorma
|
|
78
82
|
hash
|
79
83
|
end
|
80
84
|
|
85
|
+
class Namespace
|
86
|
+
def initialize(xmldoc)
|
87
|
+
@namespace = xmldoc.root.namespace
|
88
|
+
end
|
89
|
+
|
90
|
+
def ns(path)
|
91
|
+
return path if @namespace.nil?
|
92
|
+
path.gsub(%r{/([a-zA-z])}, "/xmlns:\\1").
|
93
|
+
gsub(%r{::([a-zA-z])}, "::xmlns:\\1").
|
94
|
+
gsub(%r{\[([a-zA-z][a-z0-9A-Z@/]* ?=)}, "[xmlns:\\1").
|
95
|
+
gsub(%r{\[([a-zA-z][a-z0-9A-Z@/]*\])}, "[xmlns:\\1")
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
def save_dataimage(uri)
|
100
|
+
%r{^data:(image|application)/(?<imgtype>[^;]+);base64,(?<imgdata>.+)$} =~ uri
|
101
|
+
imgtype.sub!(/\+[a-z0-9]+$/, '') # svg+xml
|
102
|
+
imgtype = 'png' unless /^[a-z0-9]+$/.match imgtype
|
103
|
+
Tempfile.open(['image', ".#{imgtype}"]) do |f|
|
104
|
+
f.binmode
|
105
|
+
f.write(Base64.strict_decode64(imgdata))
|
106
|
+
f.path
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
81
110
|
def svgmap_rewrite(xmldoc, localdir = "")
|
82
|
-
|
83
|
-
|
84
|
-
|
111
|
+
n = Namespace.new(xmldoc)
|
112
|
+
xmldoc.xpath(n.ns("//svgmap")).each do |s|
|
113
|
+
next unless i = s.at(n.ns(".//image")) and src = i["src"]
|
114
|
+
path = /^data:/.match(src) ? save_dataimage(src) : File.file?(src) ? src : localdir + src
|
85
115
|
File.file?(path) or next
|
86
116
|
svg = Nokogiri::XML(File.read(path, encoding: "utf-8"))
|
87
|
-
svgmap_rewrite1(s, svg, path)
|
88
|
-
|
89
|
-
s.
|
117
|
+
svgmap_rewrite1(s, svg, path, n)
|
118
|
+
/^data:/.match(src) and i["src"] = datauri(path)
|
119
|
+
next if s.at(n.ns("./target/eref"))
|
120
|
+
s.replace(s.at(n.ns("./figure")))
|
90
121
|
end
|
91
122
|
end
|
92
123
|
|
93
|
-
def svgmap_rewrite1(s, svg, path)
|
94
|
-
targets = s.xpath("./target").each_with_object({}) do |t, m|
|
95
|
-
x = t.at("./xref") and m[t["href"]] = "##{x['target']}"
|
96
|
-
x = t.at("./link") and m[t["href"]] = x['target']
|
97
|
-
t.remove if t.at("./xref | ./link")
|
124
|
+
def svgmap_rewrite1(s, svg, path, n)
|
125
|
+
targets = s.xpath(n.ns("./target")).each_with_object({}) do |t, m|
|
126
|
+
x = t.at(n.ns("./xref")) and m[t["href"]] = "##{x['target']}"
|
127
|
+
x = t.at(n.ns("./link")) and m[t["href"]] = x['target']
|
128
|
+
t.remove if t.at(n.ns("./xref | ./link"))
|
98
129
|
end
|
99
130
|
svg.xpath(".//xmlns:a").each do |a|
|
100
131
|
x = targets[a["xlink:href"]] and a["xlink:href"] = x
|
@@ -105,8 +136,7 @@ module Metanorma
|
|
105
136
|
# not currently used
|
106
137
|
def flatten_rawtext_lines(node, result)
|
107
138
|
node.lines.each do |x|
|
108
|
-
if node.respond_to?(:context) && (node.context == :literal ||
|
109
|
-
node.context == :listing)
|
139
|
+
if node.respond_to?(:context) && (node.context == :literal || node.context == :listing)
|
110
140
|
result << x.gsub(/</, "<").gsub(/>/, ">")
|
111
141
|
else
|
112
142
|
# strip not only HTML <tag>, and Asciidoc xrefs <<xref>>
|
@@ -132,6 +162,42 @@ module Metanorma
|
|
132
162
|
end
|
133
163
|
result.reject(&:empty?)
|
134
164
|
end
|
165
|
+
|
166
|
+
# FIXME: nested uri path error(
|
167
|
+
# sources/plantuml/plantuml20200524-90467-1iqek5i.png ->
|
168
|
+
# sources/sources/plantuml/plantuml20200524-90467-1iqek5i.png)
|
169
|
+
def datauri(uri, localdir = ".")
|
170
|
+
return uri if /^data:/.match(uri)
|
171
|
+
path = %r{^([A-Z]:)?/}.match?(uri) ? uri : File.join(localdir, uri)
|
172
|
+
types = MIME::Types.type_for(path)
|
173
|
+
type = types ? types.first.to_s : 'text/plain; charset="utf-8"'
|
174
|
+
bin = File.open(path, 'rb', &:read)
|
175
|
+
data = Base64.strict_encode64(bin)
|
176
|
+
"data:#{type};base64,#{data}"
|
177
|
+
end
|
178
|
+
|
179
|
+
def datauri2mime(uri)
|
180
|
+
%r{^data:image/(?<imgtype>[^;]+);base64,(?<imgdata>.+)$} =~ uri
|
181
|
+
type = nil
|
182
|
+
imgtype = "png" unless /^[a-z0-9]+$/.match imgtype
|
183
|
+
::Tempfile.open(["imageuri", ".#{imgtype}"]) do |file|
|
184
|
+
type = datauri2mime1(file, imgdata)
|
185
|
+
end
|
186
|
+
[type]
|
187
|
+
end
|
188
|
+
|
189
|
+
def datauri2mime1(file, imgdata)
|
190
|
+
type = nil
|
191
|
+
begin
|
192
|
+
file.binmode
|
193
|
+
file.write(Base64.strict_decode64(imgdata))
|
194
|
+
file.rewind
|
195
|
+
type = MimeMagic.by_magic(file)
|
196
|
+
ensure
|
197
|
+
file.close!
|
198
|
+
end
|
199
|
+
type
|
200
|
+
end
|
135
201
|
end
|
136
202
|
end
|
137
203
|
end
|
data/lib/utils/version.rb
CHANGED
data/metanorma-utils.gemspec
CHANGED
@@ -29,6 +29,8 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_dependency "nokogiri", "~> 1.10.4"
|
30
30
|
spec.add_dependency "asciidoctor", "~> 2.0.0"
|
31
31
|
spec.add_dependency "uuidtools"
|
32
|
+
spec.add_dependency "mimemagic"
|
33
|
+
spec.add_dependency "mime-types"
|
32
34
|
|
33
35
|
spec.add_development_dependency "byebug"
|
34
36
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
Binary file
|
data/spec/utils_spec.rb
CHANGED
@@ -102,10 +102,19 @@ RSpec.describe Metanorma::Utils do
|
|
102
102
|
</svgmap>
|
103
103
|
<svgmap id="_60dadf08-48d4-4164-845c-b4e293e00abd">
|
104
104
|
<figure><image src="action_schemaexpg2.svg" alt="Workmap"/></figure>
|
105
|
-
<target href="href1.htm"><xref target="ref1">Computer</xref></target><target href="mn://basic_attribute_schema"><link target="http://www.example.com">Phone</link></target><target href="mn://support_resource_schema"><eref type="express" bibitemid="express_action_schema" citeas=""><localityStack><locality type="anchor"><referenceFrom>action_schema.basic</referenceFrom></locality></localityStack>Coffee</eref></target></svgmap
|
105
|
+
<target href="href1.htm"><xref target="ref1">Computer</xref></target><target href="mn://basic_attribute_schema"><link target="http://www.example.com">Phone</link></target><target href="mn://support_resource_schema"><eref type="express" bibitemid="express_action_schema" citeas=""><localityStack><locality type="anchor"><referenceFrom>action_schema.basic</referenceFrom></locality></localityStack>Coffee</eref></target></svgmap>
|
106
|
+
<svgmap id="_60dadf08-48d4-4164-845c-b4e293e00abd">
|
107
|
+
<figure>
|
108
|
+
|
109
|
+
<image src='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjAuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1OTUuMjggODQxLjg5IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1OTUuMjggODQxLjg5OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGw6bm9uZTtzdHJva2U6IzAwMDAwMDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9Cjwvc3R5bGU+CjxpbWFnZSBzdHlsZT0ib3ZlcmZsb3c6dmlzaWJsZTsiIHdpZHRoPSIzNjgiIGhlaWdodD0iMzE1IiB4bGluazpocmVmPSJkYXRhOmltYWdlL2dpZjtiYXNlNjQsUjBsR09EbGhjQUU3QWZmL0FBQUFBQUFBTXdBQVpnQUFtUUFBekFBQS93QXpB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zvcm09Im1hdHJpeCgxIDAgMCAxIDExNCAyNjMuODg5OCkiPgo8L2ltYWdlPgo8YSB4bGluazpocmVmPSJtbjovL2FjdGlvbl9zY2hlbWEiID4KCTxyZWN0IHg9IjEyMy4yOCIgeT0iMjczLjkzIiBjbGFzcz0ic3QwIiB3aWR0aD0iODguMDUiIGhlaWdodD0iNDEuODQiLz4KPC9hPgo8YSB4bGluazpocmVmPSJtbjovL2Jhc2ljX2F0dHJpYnV0ZV9zY2hlbWEiID4KCTxyZWN0IHg9IjMyNC42OSIgeT0iNDUwLjUyIiBjbGFzcz0ic3QwIiB3aWR0aD0iMTMyLjYyIiBoZWlnaHQ9IjQwLjc1Ii8+CjwvYT4KPGEgeGxpbms6aHJlZj0ibW46Ly9zdXBwb3J0X3Jlc291cmNlX3NjaGVtYSIgPgoJPHJlY3QgeD0iMzI0LjY5IiB5PSI1MjguMzYiIGNsYXNzPSJzdDAiIHdpZHRoPSIxNDguMTYiIGhlaWdodD0iNDAuNzUiLz4KPC9hPgo8L3N2Zz4K' id='__ISO_17301-1_2016' mimetype='image/svg+xml' height='auto' width='auto' alt='Workmap1'/>
|
110
|
+
</figure>
|
111
|
+
<target href="href1.htm"><xref target="ref1">Computer</xref></target><target href="mn://basic_attribute_schema"><link target="http://www.example.com">Phone</link></target><target href="mn://support_resource_schema"><eref type="express" bibitemid="express_action_schema" citeas=""><localityStack><locality type="anchor"><referenceFrom>action_schema.basic</referenceFrom></locality></localityStack>Coffee</eref></target></svgmap>
|
112
|
+
</sections>
|
106
113
|
</standard-document>
|
107
114
|
INPUT
|
108
115
|
Metanorma::Utils.svgmap_rewrite(xmldoc)
|
116
|
+
xmldoc1 = xmldoc.dup
|
117
|
+
xmldoc&.at("//image[@alt = 'Workmap1']")&.remove
|
109
118
|
expect(xmlpp(xmldoc.to_xml)).to be_equivalent_to xmlpp(<<~OUTPUT)
|
110
119
|
<standard-document type="semantic" version="1.8.2">
|
111
120
|
<bibdata type="standard">
|
@@ -133,7 +142,22 @@ RSpec.describe Metanorma::Utils do
|
|
133
142
|
<figure>
|
134
143
|
<image src='action_schemaexpg2.svg' alt='Workmap'/>
|
135
144
|
</figure>
|
136
|
-
<target href="mn://support_resource_schema"><eref type="express" bibitemid="express_action_schema" citeas=""><localityStack><locality type="anchor"><referenceFrom>action_schema.basic</referenceFrom></locality></localityStack>Coffee</eref></target></svgmap
|
145
|
+
<target href="mn://support_resource_schema"><eref type="express" bibitemid="express_action_schema" citeas=""><localityStack><locality type="anchor"><referenceFrom>action_schema.basic</referenceFrom></locality></localityStack>Coffee</eref></target></svgmap>
|
146
|
+
<svgmap id='_60dadf08-48d4-4164-845c-b4e293e00abd'>
|
147
|
+
<figure>
|
148
|
+
</figure>
|
149
|
+
<target href='mn://support_resource_schema'>
|
150
|
+
<eref type='express' bibitemid='express_action_schema' citeas=''>
|
151
|
+
<localityStack>
|
152
|
+
<locality type='anchor'>
|
153
|
+
<referenceFrom>action_schema.basic</referenceFrom>
|
154
|
+
</locality>
|
155
|
+
</localityStack>
|
156
|
+
Coffee
|
157
|
+
</eref>
|
158
|
+
</target>
|
159
|
+
</svgmap>
|
160
|
+
</sections>
|
137
161
|
</standard-document>
|
138
162
|
OUTPUT
|
139
163
|
expect(xmlpp(File.read("action_schemaexpg1.svg", encoding: "utf-8").sub(%r{<image .*</image>}m, ""))).to be_equivalent_to <<~OUTPUT
|
@@ -168,6 +192,89 @@ expect(xmlpp(File.read("action_schemaexpg2.svg", encoding: "utf-8").sub(%r{<imag
|
|
168
192
|
</a>
|
169
193
|
</svg>
|
170
194
|
OUTPUT
|
195
|
+
expect(xmlpp(File.read(Metanorma::Utils.save_dataimage(xmldoc1.at("//image[@alt = 'Workmap1']/@src"))))).to be_equivalent_to <<~OUTPUT
|
196
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
197
|
+
<!-- Generator: Adobe Illustrator 25.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
198
|
+
<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' id='Layer_1' x='0px' y='0px' viewBox='0 0 595.28 841.89' style='enable-background:new 0 0 595.28 841.89;' xml:space='preserve'>
|
199
|
+
<style type='text/css'> .st0{fill:none;stroke:#000000;stroke-miterlimit:10;} </style>
|
200
|
+
<image style='overflow:visible;' width='368' height='315' xlink:href='data:image/gif;base64,R0lGODlhcAE7Aff/AAAAAAAAMwAAZgAAmQAAzAAA/wAzAAAzMwAzZgAzmQAzzAAz/wBmAABmMwBm ZgBmmQBmzABm/wCZAACZMwCZZgCZmQCZzACZ/wDMAADMMwDMZgDMmQDMzADM/wD/AAD/MwD/ZgD/ mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMzADMzMzMzZjMzmTMzzDMz/zNmADNmMzNmZjNmmTNm zDNm/zOZADOZMzOZZjOZmTOZzDOZ/zPMADPMMzPMZjPMmTPMzDPM/zP/ADP/MzP/ZjP/mTP/zDP/ /2YAAGYAM2YAZmYAmWYAzGYA/2YzAGYzM2YzZmYzmWYzzGYz/2ZmAGZmM2ZmZmZmmWZmzGZm/2aZ AGaZM2aZZmaZmWaZzGaZ/2bMAGbMM2bMZmbMmWbMzGbM/2b/AGb/M2b/Zmb/mWb/zGb//5kAAJkA M5kAZpkAmZkAzJkA/5kzAJkzM5kzZpkzmZkzzJkz/5lmAJlmM5lmZplmmZlmzJlm/5mZAJmZM5mZ ZpmZmZmZzJmZ/5nMAJnMM5nMZpnMmZnMzJnM/5n/AJn/M5n/Zpn/mZn/zJn//8wAAMwAM8wAZswA mcwAzMwA/8wzAMwzM8wzZswzmcwzzMwz/8xmAMxmM8xmZsxmmcxmzMxm/8yZAMyZM8yZZsyZmcyZ zMyZ/8zMAMzMM8zMZszMmczMzMzM/8z/AMz/M8z/Zsz/mcz/zMz///8AAP8AM/8AZv8Amf8AzP8A //8zAP8zM/8zZv8zmf8zzP8z//9mAP9mM/9mZv9mmf9mzP9m//+ZAP+ZM/+ZZv+Zmf+ZzP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OxPRySr6ciw CCSPJkYp1LN497jU+/GwTRqxC6fODMKjvQd7bnvXklu1lUuyKFmCqB2nzMdjGxKnL+ZjLatgLxtA BCWzsymyIU4u//3Y68JLAkSSL0aPRJUIXAZk0ToiZpYkx3PiL745GUnHQRuzVvW0PhuXpC0QIz65 CzOOg9xzarWFY7JnNqd7hNzlgCy23+0+Z/WoLjlCZhWpcPJXTytXOZ4TcOvbN/odpFZp/osMRZ9m RUrpqhtEt2sUaXBsWgGgArLVqqcKJEhpuIWTuK61uJlCTXxr5T8x4qAr3TZISVxdlkORuRv8EFrz 6QkjFJ8Lu6NbuqohbDliaaSuuizhyjPWE/Nru/QSu7Nbu7QtFJpdELqbL7zru70unzxRD8lrvN5r vsuOvuXr7OfLveML7c0u7c9u7dEevt+77cwuvteu7d2uvuzb2ORe7u97ZvV7v8UevBLGv/4LwHi+ ZARswAgc77C27vqba/guwMe27x997/Z+av6O3QC/5co28BQs8AFfaAgv0gWf3Apv8P2+8GfW8CJ8 8BS/ZBYP2fqe8TK28Xmdaydj7iRfFvIpo8qEnfIqv/Is3/Iu//IwH/OhERAAOw==' transform='matrix(1 0 0 1 114 263.8898)'> </image>
|
201
|
+
<a xlink:href='mn://action_schema'>
|
202
|
+
<rect x='123.28' y='273.93' class='st0' width='88.05' height='41.84'/>
|
203
|
+
</a>
|
204
|
+
<a xlink:href='http://www.example.com'>
|
205
|
+
<rect x='324.69' y='450.52' class='st0' width='132.62' height='40.75'/>
|
206
|
+
</a>
|
207
|
+
<a xlink:href='mn://support_resource_schema'>
|
208
|
+
<rect x='324.69' y='528.36' class='st0' width='148.16' height='40.75'/>
|
209
|
+
</a>
|
210
|
+
</svg>
|
211
|
+
OUTPUT
|
212
|
+
end
|
213
|
+
|
214
|
+
it "rewrites SVGs with namespaces" do
|
215
|
+
FileUtils.cp "spec/fixtures/action_schemaexpg1.svg", "action_schemaexpg1.svg"
|
216
|
+
FileUtils.cp "spec/fixtures/action_schemaexpg1.svg", "action_schemaexpg2.svg"
|
217
|
+
xmldoc = Nokogiri::XML(<<~INPUT)
|
218
|
+
<standard-document type="semantic" version="1.8.2" xmlns="http://www.example.com">
|
219
|
+
<bibdata type="standard">
|
220
|
+
<title language="en" format="text/plain">Document title</title>
|
221
|
+
<docidentifier/>
|
222
|
+
<docnumber/>
|
223
|
+
<version/>
|
224
|
+
<language>en</language>
|
225
|
+
<script>Latn</script>
|
226
|
+
<status>
|
227
|
+
<stage>published</stage>
|
228
|
+
</status>
|
229
|
+
<copyright>
|
230
|
+
<from>2021</from>
|
231
|
+
</copyright>
|
232
|
+
<ext>
|
233
|
+
<doctype>article</doctype>
|
234
|
+
</ext>
|
235
|
+
</bibdata>
|
236
|
+
<sections>
|
237
|
+
<svgmap id="_d5b5049a-dd53-4ea0-bc6f-e8773bd59052"><target href="mn://action_schema"><xref target="ref1">Computer</xref></target></svgmap>
|
238
|
+
<svgmap id="_4072bdcb-5895-4821-b636-5795b96787cb">
|
239
|
+
<figure><image src="action_schemaexpg1.svg"/></figure>
|
240
|
+
<target href="mn://action_schema"><xref target="ref1">Computer</xref></target><target href="http://www.example.com"><link target="http://www.example.com">Phone</link></target>
|
241
|
+
</svgmap>
|
242
|
+
<svgmap id="_60dadf08-48d4-4164-845c-b4e293e00abd">
|
243
|
+
<figure><image src="action_schemaexpg2.svg" alt="Workmap"/></figure>
|
244
|
+
<target href="href1.htm"><xref target="ref1">Computer</xref></target><target href="mn://basic_attribute_schema"><link target="http://www.example.com">Phone</link></target><target href="mn://support_resource_schema"><eref type="express" bibitemid="express_action_schema" citeas=""><localityStack><locality type="anchor"><referenceFrom>action_schema.basic</referenceFrom></locality></localityStack>Coffee</eref></target></svgmap></sections>
|
245
|
+
</standard-document>
|
246
|
+
INPUT
|
247
|
+
Metanorma::Utils.svgmap_rewrite(xmldoc)
|
248
|
+
expect(xmlpp(xmldoc.to_xml)).to be_equivalent_to xmlpp(<<~OUTPUT)
|
249
|
+
<standard-document type="semantic" version="1.8.2" xmlns="http://www.example.com">
|
250
|
+
<bibdata type="standard">
|
251
|
+
<title language="en" format="text/plain">Document title</title>
|
252
|
+
<docidentifier/>
|
253
|
+
<docnumber/>
|
254
|
+
<version/>
|
255
|
+
<language>en</language>
|
256
|
+
<script>Latn</script>
|
257
|
+
<status>
|
258
|
+
<stage>published</stage>
|
259
|
+
</status>
|
260
|
+
<copyright>
|
261
|
+
<from>2021</from>
|
262
|
+
</copyright>
|
263
|
+
<ext>
|
264
|
+
<doctype>article</doctype>
|
265
|
+
</ext>
|
266
|
+
</bibdata>
|
267
|
+
<sections><svgmap id="_d5b5049a-dd53-4ea0-bc6f-e8773bd59052"><target href="mn://action_schema"><xref target="ref1">Computer</xref></target></svgmap>
|
268
|
+
<figure>
|
269
|
+
<image src='action_schemaexpg1.svg'/>
|
270
|
+
</figure>
|
271
|
+
<svgmap id='_60dadf08-48d4-4164-845c-b4e293e00abd'>
|
272
|
+
<figure>
|
273
|
+
<image src='action_schemaexpg2.svg' alt='Workmap'/>
|
274
|
+
</figure>
|
275
|
+
<target href="mn://support_resource_schema"><eref type="express" bibitemid="express_action_schema" citeas=""><localityStack><locality type="anchor"><referenceFrom>action_schema.basic</referenceFrom></locality></localityStack>Coffee</eref></target></svgmap></sections>
|
276
|
+
</standard-document>
|
277
|
+
OUTPUT
|
171
278
|
end
|
172
279
|
|
173
280
|
# not testing Asciidoctor log extraction here
|
@@ -205,4 +312,22 @@ log.txt errors
|
|
205
312
|
</b>
|
206
313
|
OUTPUT
|
207
314
|
end
|
315
|
+
|
316
|
+
def datauri(uri, localdir = "")
|
317
|
+
return uri if /^data:/.match(uri)
|
318
|
+
path = File.join(localdir, uri)
|
319
|
+
types = MIME::Types.type_for(path)
|
320
|
+
type = types ? types.first.to_s : 'text/plain; charset="utf-8"'
|
321
|
+
bin = File.open(path, 'rb', &:read)
|
322
|
+
data = Base64.strict_encode64(bin)
|
323
|
+
"data:#{type};base64,#{data}"
|
324
|
+
end
|
325
|
+
|
326
|
+
|
327
|
+
it "generates data uris" do
|
328
|
+
expect(Metanorma::Utils.datauri("data:xyz")).to eq "data:xyz"
|
329
|
+
expect(Metanorma::Utils.datauri("spec/fixtures/rice_image1.png")).to be_equivalent_to "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADfCAIAAADDbnkhAAAAKXRFWHRjb3B5bGVmdABHZW5lcmF0ZWQgYnkgaHR0cDovL3BsYW50dW1sLmNvbREwORwAAAEOaVRYdHBsYW50dW1sAAEAAAB4nHWQy27CMBBF95byD7OEhRFJoaJRVREKrZQmKiKEvUnc1FIypn5E6t93AkJdtCy8mTk+99pL64RxvmsDlrSqksCfYKWPMSTefUp0qhJOaYSd/PLSuoDREjhBZ/ofzJ40WhmwPz7URBoQN7wX+pHzCy5u4Vf/UmJ9rs22rUBX5hn00tgBCifRNJpOwvmo8AgpnWgBURjfPcSzOSSbYg8DMGaj120GVntDybWyzqijH2LGLBW9gJ2n4I4e+X6SmK7frgPYYK+Mxo6KsfSQ/wL3M75SDgppqAsccraWH8K3jm5UulbYxFDuX/iCZQIbLxpyy5Y9a/Kab/qjkv0A6yGCEpbMNRwAAB/mSURBVHhe7Z0JdBRF/seTEK4AIaKIgKCAsIBcBhUSQCCE4wEusuxyCMohIrjyniJyGK7/Iuiu4XQBAXch4RHDEBKJslxmAYGA4YjyWA8QIi4EISIElBdQMv+vU9LbdlV30jWT6snM7/Pq+TrV1b/+1fD9TnVN4vxC3ARBOEqIsYMgCLWITXjz8tULu474Vbt55ZoxS4IQ4ax6JYQqNiFipYY86lft4u4jxiwJQoSz6pUQqpUJv1iUeGFXquPti4WJcnMjghOn1CstVCsTIm5x8VHH27f/TpWbGxGcOKVeaaGWGxNuW7g6Ozs7Nzf3xIkT586dKywsNCZNEB6cUq+0UMuNCV1zFmRmZmZlZeXk5GB6BQUFxqQJwoNT6pUWarkx4brp81NSUjIyMjA9vM3gPcaYNEF4cEq90kItNyZMnjZv7dq1mB7eZrDc5+XlGZMmCA9OqVdaqOXGhBtmJ2JuSUlJLpc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jTJ9lDYEA4Y0C05+ddN0PnzO/v0iYUncap69YgFC17WLoEJo6Ob4wEVpzBg6NDe7LcahiYtVHsm9LJhlc/L26L/vWKx5/czJ09msg+phE16bkRw4o16Cwv38hLFEoIFo9izseI/j9GatFCVmlCuSc+NCE6cUq+0UMmERKDhlHqlhUomJAINp9QrLVQyIRFoOKVeaaGSCYlAwyn1SguVTEgEGk6pV1qoZEIi0HBKvdJCJRMSgYZT6pUWqpUJv1iYiLiON1ZnQ2JuRHDilHqlhWplQr9qEnMjghNn1SshVLEJb165dnH3EdZ2LUt+b/5b7878W/K0eQ62pBWr1tr8YmMiOHFWvRJCFZtQT25uLgydkZGBuEmOYvcr/gnCEfXaFWrJJsR6mpOTg4hwtstR7Ba7IQhH1GtXqCWbEFZGLHgaa2uWo9gt+0YQjqjXrlBLNiGiwM0Ih6fbE46CBJAGkkFKRUVFxkQJgsMR9doVaskmJAiiTCETEoTDkAkJwmHIhAThMGRCgnAYMiFBOAyZkCAchkxIEA5DJiQIhyETEoTDkAkJwmHIhAThMP8PSlImtX3xowQAAAAASUVORK5CYII="
|
330
|
+
expect(Metanorma::Utils.datauri("rice_image1.png", "spec/fixtures")).to be_equivalent_to "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADfCAIAAADDbnkhAAAAKXRFWHRjb3B5bGVmdABHZW5lcmF0ZWQgYnkgaHR0cDovL3BsYW50dW1sLmNvbREwORwAAAEOaVRYdHBsYW50dW1sAAEAAAB4nHWQy27CMBBF95byD7OEhRFJoaJRVREKrZQmKiKEvUnc1FIypn5E6t93AkJdtCy8mTk+99pL64RxvmsDlrSqksCfYKWPMSTefUp0qhJOaYSd/PLSuoDREjhBZ/ofzJ40WhmwPz7URBoQN7wX+pHzCy5u4Vf/UmJ9rs22rUBX5hn00tgBCifRNJpOwvmo8AgpnWgBURjfPcSzOSSbYg8DMGaj120GVntDybWyzqijH2LGLBW9gJ2n4I4e+X6SmK7frgPYYK+Mxo6KsfSQ/wL3M75SD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A4Y0C05+ddN0PnzO/v0iYUncap69YgFC17WLoEJo6Ob4wEVpzBg6NDe7LcahiYtVHsm9LJhlc/L26L/vWKx5/czJ09msg+phE16bkRw4o16Cwv38hLFEoIFo9izseI/j9GatFCVmlCuSc+NCE6cUq+0UMmERKDhlHqlhUomJAINp9QrLVQyIRFoOKVeaaGSCYlAwyn1SguVTEgEGk6pV1qoZEIi0HBKvdJCJRMSgYZT6pUWqpUJv1iYiLiON1ZnQ2JuRHDilHqlhWplQr9qEnMjghNn1SshVLEJb165dnH3EdZ2LUt+b/5b7878W/K0eQ62pBWr1tr8YmMiOHFWvRJCFZtQT25uLgydkZGBuEmOYvcr/gnCEfXaFWrJJsR6mpOTg4hwtstR7Ba7IQhH1GtXqCWbEFZGLHgaa2uWo9gt+0YQjqjXrlBLNiGiwM0Ih6fbE46CBJAGkkFKRUVFxkQJgsMR9doVaskmJAiiTCETEoTDkAkJwmHIhAThMGRCgnAYMiFBOAyZkCAchkxIEA5DJiQIhyETEoTDkAkJwmHIhAThMP8PSlImtX3xowQAAAAASUVORK5CYII=")&.first&.to_s).to eq "image/png"
|
332
|
+
end
|
208
333
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sterile
|
@@ -80,6 +80,34 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: mimemagic
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: mime-types
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
83
111
|
- !ruby/object:Gem::Dependency
|
84
112
|
name: byebug
|
85
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -257,6 +285,7 @@ files:
|
|
257
285
|
- lib/utils/version.rb
|
258
286
|
- metanorma-utils.gemspec
|
259
287
|
- spec/fixtures/action_schemaexpg1.svg
|
288
|
+
- spec/fixtures/rice_image1.png
|
260
289
|
- spec/hash_transform_keys_spec.rb
|
261
290
|
- spec/spec_helper.rb
|
262
291
|
- spec/utils_spec.rb
|