metanorma-iec 2.1.0 → 2.1.1
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/isodoc/iec/base_convert.rb +5 -5
- data/lib/isodoc/iec/iec.international-standard.xsl +1045 -115
- data/lib/isodoc/iec/metadata.rb +2 -2
- data/lib/isodoc/iec/word_convert.rb +3 -3
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +3 -2
- data/spec/isodoc/metadata_spec.rb +9 -9
- data/spec/isodoc/postproc_spec.rb +2 -2
- data/spec/spec_helper.rb +7 -0
- metadata +4 -4
data/lib/isodoc/iec/metadata.rb
CHANGED
@@ -3,7 +3,7 @@ require "metanorma-iso"
|
|
3
3
|
|
4
4
|
module IsoDoc
|
5
5
|
module Iec
|
6
|
-
class
|
6
|
+
class Metadata < IsoDoc::Iso::Metadata
|
7
7
|
def docstatus(isoxml, _out)
|
8
8
|
docstatus = isoxml.at(ns("//bibdata/status/stage"))
|
9
9
|
substage = isoxml.at(ns("//bibdata/status/substage"))
|
@@ -22,7 +22,7 @@ module IsoDoc
|
|
22
22
|
|
23
23
|
def doctype(isoxml, _out)
|
24
24
|
super
|
25
|
-
b = isoxml&.at(ns("//bibdata/ext/doctype#{NOLANG}"))&.text
|
25
|
+
b = isoxml&.at(ns("//bibdata/ext/doctype#{NOLANG}"))&.text
|
26
26
|
b1 = isoxml&.at(ns("//bibdata/ext/doctype[@language = 'en']"))&.text || b
|
27
27
|
b1 and set(:doctype_en, status_print(b1))
|
28
28
|
b1 = isoxml&.at(ns("//bibdata/ext/doctype[@language = 'fr']"))&.text || b
|
@@ -58,7 +58,7 @@ module IsoDoc
|
|
58
58
|
<span lang="EN-GB"><span
|
59
59
|
style='mso-element:field-begin'></span><span
|
60
60
|
style='mso-spacerun:yes'> </span>TOC
|
61
|
-
\\h \\z \\t
|
61
|
+
\\h \\z \\t "TableTitle,tabletitle" <span
|
62
62
|
style='mso-element:field-separator'></span></span>
|
63
63
|
TOC
|
64
64
|
|
@@ -66,7 +66,7 @@ module IsoDoc
|
|
66
66
|
<span lang="EN-GB"><span
|
67
67
|
style='mso-element:field-begin'></span><span
|
68
68
|
style='mso-spacerun:yes'> </span>TOC
|
69
|
-
\\h \\z \\t
|
69
|
+
\\h \\z \\t "FigureTitle,figuretitle" <span
|
70
70
|
style='mso-element:field-separator'></span></span>
|
71
71
|
TOC
|
72
72
|
|
@@ -93,7 +93,7 @@ module IsoDoc
|
|
93
93
|
<span lang="EN-GB"><span
|
94
94
|
style='mso-element:field-begin'></span><span
|
95
95
|
style='mso-spacerun:yes'> </span>TOC
|
96
|
-
\\o
|
96
|
+
\\o "1-#{level}" \\h \\z \\u <span
|
97
97
|
style='mso-element:field-separator'></span></span>
|
98
98
|
TOC
|
99
99
|
end
|
data/metanorma-iec.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.email = ["open.source@ribose.com"]
|
12
12
|
|
13
13
|
spec.summary = "metanorma-iec lets you write IEC standards "\
|
14
|
-
|
14
|
+
"in AsciiDoc."
|
15
15
|
spec.description = <<~DESCRIPTION
|
16
16
|
metanorma-iec lets you write IEC standards in AsciiDoc syntax.
|
17
17
|
|
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.test_files = `git ls-files -- {spec}/*`.split("\n")
|
28
28
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
|
29
29
|
|
30
|
-
spec.add_dependency "metanorma-iso", "~> 2.1.
|
30
|
+
spec.add_dependency "metanorma-iso", "~> 2.1.1"
|
31
31
|
spec.add_dependency "ruby-jing"
|
32
32
|
|
33
33
|
spec.add_development_dependency "debug"
|
@@ -41,4 +41,5 @@ Gem::Specification.new do |spec|
|
|
41
41
|
spec.add_development_dependency "sassc", "2.4.0"
|
42
42
|
spec.add_development_dependency "simplecov", "~> 0.15"
|
43
43
|
spec.add_development_dependency "timecop", "~> 0.9"
|
44
|
+
# spec.metadata["rubygems_mfa_required"] = "true"
|
44
45
|
end
|
@@ -87,19 +87,19 @@ INPUT
|
|
87
87
|
:circulateddate=>"XXX",
|
88
88
|
:confirmeddate=>"XXX",
|
89
89
|
:copieddate=>"XXX",
|
90
|
-
:createddate=>"2010
|
90
|
+
:createddate=>"2010–2011",
|
91
91
|
:docnumber=>"ISO/PreCD3 17301-1",
|
92
92
|
:docnumeric=>"1730",
|
93
|
-
:docsubtitle=>"Céréales et légumineuses
|
93
|
+
:docsubtitle=>"Céréales et légumineuses — Spécification et méthodes d'essai — Partie 1: Riz",
|
94
94
|
:docsubtitleintro=>"Céréales et légumineuses",
|
95
95
|
:docsubtitlemain=>"Spécification et méthodes d'essai",
|
96
96
|
:docsubtitlepart=>"Riz",
|
97
|
-
:docsubtitlepartlabel=>"Partie
|
98
|
-
:doctitle=>"Cereals and pulses
|
97
|
+
:docsubtitlepartlabel=>"Partie 1",
|
98
|
+
:doctitle=>"Cereals and pulses — Specifications and test methods — Part 1: Rice",
|
99
99
|
:doctitleintro=>"Cereals and pulses",
|
100
100
|
:doctitlemain=>"Specifications and test methods",
|
101
101
|
:doctitlepart=>"Rice",
|
102
|
-
:doctitlepartlabel=>"Part
|
102
|
+
:doctitlepartlabel=>"Part 1",
|
103
103
|
:doctype=>"International Standard",
|
104
104
|
:doctype_display=>"International Standard",
|
105
105
|
:doctype_en=>"International Standard",
|
@@ -228,16 +228,16 @@ INPUT
|
|
228
228
|
:copieddate=>"XXX",
|
229
229
|
:createddate=>"XXX",
|
230
230
|
:docnumber=>"ISO/IEC/CD 17301-1-3",
|
231
|
-
:docsubtitle=>"Céréales et légumineuses
|
231
|
+
:docsubtitle=>"Céréales et légumineuses — Spécification et méthodes d'essai — Partie 1–3: Riz",
|
232
232
|
:docsubtitleintro=>"Céréales et légumineuses",
|
233
233
|
:docsubtitlemain=>"Spécification et méthodes d'essai",
|
234
234
|
:docsubtitlepart=>"Riz",
|
235
|
-
:docsubtitlepartlabel=>"Partie
|
236
|
-
:doctitle=>"Cereals and pulses
|
235
|
+
:docsubtitlepartlabel=>"Partie 1–3",
|
236
|
+
:doctitle=>"Cereals and pulses — Specifications and test methods — Part 1–3: Rice",
|
237
237
|
:doctitleintro=>"Cereals and pulses",
|
238
238
|
:doctitlemain=>"Specifications and test methods",
|
239
239
|
:doctitlepart=>"Rice",
|
240
|
-
:doctitlepartlabel=>"Part
|
240
|
+
:doctitlepartlabel=>"Part 1–3",
|
241
241
|
:doctype=>"Technical Report",
|
242
242
|
:doctype_display=>"Technical Report",
|
243
243
|
:doctype_en=>"Technical Report",
|
@@ -27,7 +27,7 @@ RSpec.describe IsoDoc do
|
|
27
27
|
.convert("test", input, false)
|
28
28
|
expect(File.exist?("test.html")).to be true
|
29
29
|
html = File.read("test.html", encoding: "UTF-8")
|
30
|
-
expect(html).to
|
30
|
+
expect(html).to include "<title>Cereals and pulses — Specifications and test methods — Rice</title>"
|
31
31
|
expect(html).to match(%r{cdnjs\.cloudflare\.com/ajax/libs/mathjax/})
|
32
32
|
expect(html).to match(/delimiters: \[\['\(#\(', '\)#\)'\]\]/)
|
33
33
|
end
|
@@ -57,7 +57,7 @@ RSpec.describe IsoDoc do
|
|
57
57
|
.convert("test", input, false)
|
58
58
|
expect(File.exist?("test.html")).to be true
|
59
59
|
html = File.read("test.html", encoding: "UTF-8")
|
60
|
-
expect(html).to
|
60
|
+
expect(html).to include "<title>Cereals and pulses — Specifications and test methods — Rice</title>"
|
61
61
|
expect(html).to match(%r{cdnjs\.cloudflare\.com/ajax/libs/mathjax/})
|
62
62
|
expect(html).to match(/delimiters: \[\['\(#\(', '\)#\)'\]\]/)
|
63
63
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -37,6 +37,13 @@ def strip_guid(xml)
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def xmlpp(xml)
|
40
|
+
c = HTMLEntities.new
|
41
|
+
xml &&= xml.split(/(&\S+?;)/).map do |n|
|
42
|
+
if /^&\S+?;$/.match?(n)
|
43
|
+
c.encode(c.decode(n), :hexadecimal)
|
44
|
+
else n
|
45
|
+
end
|
46
|
+
end.join
|
40
47
|
s = ""
|
41
48
|
f = REXML::Formatters::Pretty.new(2)
|
42
49
|
f.compact = true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-iec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.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-05-
|
11
|
+
date: 2022-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-iso
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.1.
|
19
|
+
version: 2.1.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.1.
|
26
|
+
version: 2.1.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: ruby-jing
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|