metanorma-standoc 2.2.2 → 2.2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/metanorma/standoc/base.rb +5 -2
- data/lib/metanorma/standoc/converter.rb +13 -14
- data/lib/metanorma/standoc/validate.rb +4 -2
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +1 -0
- data/spec/spec_helper.rb +0 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0268c3ff4369ed762e3b37515adf258a24a51561802243c9e054428b09351570'
|
4
|
+
data.tar.gz: d9d652832d3a7ac866d3c4e1f47ee3fc1a9cb803658864278b0cefaa7f23ec68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff1f0b3266523dfb2b67c2b1e888af2136970815da0caebd6f906168aa5b3083bad1c1d0c50d66b27d6faa7a35fcaf7608f1191bd35043b69c76b60b33bb3ee9
|
7
|
+
data.tar.gz: a94108f4584720b053727a46f6c9e9c634927543e9efcd0fab5633edcffebb8dee147f9231f978caac6ce65330f4e4d983c5dddeb49ffbfbee02f8a06aa01fbc
|
@@ -160,8 +160,11 @@ module Metanorma
|
|
160
160
|
end
|
161
161
|
|
162
162
|
def clean_abort(msg, file = nil)
|
163
|
-
file
|
164
|
-
|
163
|
+
if file
|
164
|
+
doc = file.to_xml(encoding: "UTF-8", indent: 2,
|
165
|
+
save_with: Nokogiri::XML::Node::SaveOptions::AS_XML)
|
166
|
+
File.open("#{@filename}.xml.abort", "w:UTF-8") { |f| f.write(doc) }
|
167
|
+
end
|
165
168
|
clean_exit
|
166
169
|
abort(msg)
|
167
170
|
end
|
@@ -1,18 +1,17 @@
|
|
1
1
|
require "asciidoctor"
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
require "metanorma/standoc/reqt"
|
2
|
+
require_relative "version"
|
3
|
+
require_relative "base"
|
4
|
+
require_relative "front"
|
5
|
+
require_relative "lists"
|
6
|
+
require_relative "ref"
|
7
|
+
require_relative "inline"
|
8
|
+
require_relative "blocks"
|
9
|
+
require_relative "section"
|
10
|
+
require_relative "table"
|
11
|
+
require_relative "validate"
|
12
|
+
require_relative "utils"
|
13
|
+
require_relative "cleanup"
|
14
|
+
require_relative "reqt"
|
16
15
|
require_relative "./macros"
|
17
16
|
|
18
17
|
module Metanorma
|
@@ -55,7 +55,8 @@ module Metanorma
|
|
55
55
|
table_validate(doc)
|
56
56
|
requirement_validate(doc)
|
57
57
|
image_validate(doc)
|
58
|
-
@fatalerror.empty? or
|
58
|
+
@fatalerror.empty? or
|
59
|
+
clean_abort(@fatalerror.join("\n"), doc)
|
59
60
|
end
|
60
61
|
|
61
62
|
def norm_ref_validate(doc)
|
@@ -108,7 +109,7 @@ module Metanorma
|
|
108
109
|
Tempfile.open(["tmp", ".xml"], encoding: "UTF-8") do |f|
|
109
110
|
schema_validate1(f, doc, schema)
|
110
111
|
rescue Jing::Error => e
|
111
|
-
clean_abort("Jing failed with error: #{e}", doc
|
112
|
+
clean_abort("Jing failed with error: #{e}", doc)
|
112
113
|
ensure
|
113
114
|
f.close!
|
114
115
|
end
|
@@ -161,6 +162,7 @@ module Metanorma
|
|
161
162
|
def image_validate(doc)
|
162
163
|
doc.xpath("//image[@mimetype = 'image/png']").each do |i|
|
163
164
|
d = Metanorma::Utils::datauri(i["src"], @localdir)
|
165
|
+
# d.chars.to_a.each_slice(80).to_a.map { |s| s.join }.each { |s| warn s }
|
164
166
|
png_validate1(i, Base64.strict_decode64(d.sub(/^.+?base64,/, "")))
|
165
167
|
end
|
166
168
|
end
|
data/metanorma-standoc.gemspec
CHANGED
@@ -28,6 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_dependency "asciidoctor", "~> 2.0.0"
|
29
29
|
spec.add_dependency "iev", "~> 0.3.0"
|
30
30
|
spec.add_dependency "isodoc", "~> 2.2.3"
|
31
|
+
spec.add_dependency "metanorma"
|
31
32
|
spec.add_dependency "metanorma-plugin-datastruct", "~> 0.2.0"
|
32
33
|
spec.add_dependency "metanorma-plugin-lutaml"
|
33
34
|
spec.add_dependency "ruby-jing"
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-standoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.2
|
4
|
+
version: 2.2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 2.2.3
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: metanorma
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: metanorma-plugin-datastruct
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|