metanorma-iso 2.1.6 → 2.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +3 -1
- data/.github/workflows/release.yml +24 -0
- data/lib/isodoc/iso/html/html_iso_titlepage.html +2 -2
- data/lib/isodoc/iso/html/style-human.css +34 -2
- data/lib/isodoc/iso/html/style-human.scss +35 -1
- data/lib/isodoc/iso/html/style-iso.css +34 -2
- data/lib/isodoc/iso/html/style-iso.scss +36 -1
- data/lib/isodoc/iso/i18n-en.yaml +4 -0
- data/lib/isodoc/iso/i18n-fr.yaml +5 -0
- data/lib/isodoc/iso/i18n-ru.yaml +4 -0
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +5 -0
- data/lib/isodoc/iso/init.rb +4 -0
- data/lib/isodoc/iso/iso.amendment.xsl +195 -197
- data/lib/isodoc/iso/iso.international-standard.xsl +195 -197
- data/lib/isodoc/iso/presentation_xml_convert.rb +22 -6
- data/lib/isodoc/iso/xref.rb +35 -4
- data/lib/metanorma/iso/base.rb +4 -0
- data/lib/metanorma/iso/biblio.rng +8 -5
- data/lib/metanorma/iso/cleanup.rb +5 -1
- data/lib/metanorma/iso/front_id.rb +63 -38
- data/lib/metanorma/iso/section.rb +5 -0
- data/lib/metanorma/iso/validate.rb +3 -2
- data/lib/metanorma/iso/version.rb +1 -1
- data/lib/metanorma/requirements/modspec.rb +60 -0
- data/lib/metanorma/requirements/requirements.rb +16 -0
- data/lib/metanorma-iso.rb +2 -1
- data/metanorma-iso.gemspec +1 -1
- data/spec/assets/iso.adoc +10 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig1a.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig1b.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig2.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig3.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig4.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig5_f.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figA.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figA1.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figA2.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figTab1.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figTab2.png +0 -0
- data/spec/examples/rice_img/1001_ed2amd3fig1.png +0 -0
- data/spec/examples/rice_img/ISO_1213_1.png +0 -0
- data/spec/examples/rice_img/SL1000-1_ed2amd3fig1.png +0 -0
- data/spec/isodoc/ref_spec.rb +129 -82
- data/spec/metanorma/amd_spec.rb +0 -10
- data/spec/metanorma/base_spec.rb +15 -12
- data/spec/metanorma/cleanup_spec.rb +136 -0
- data/spec/metanorma/macros_spec.rb +99 -0
- data/spec/metanorma/processor_spec.rb +86 -86
- data/spec/metanorma/section_spec.rb +2 -2
- data/spec/metanorma/validate_spec.rb +41 -40
- data/spec/requirements/requirements_spec.rb +1299 -0
- data/spec/requirements/xref_spec.rb +1205 -0
- data/spec/vcr_cassettes/docrels.yml +385 -0
- data/spec/vcr_cassettes/withdrawn_iso.yml +21 -21
- metadata +40 -18
@@ -9,95 +9,95 @@ RSpec.describe Metanorma::Iso::Processor do
|
|
9
9
|
processor = registry.find_processor(:iso)
|
10
10
|
|
11
11
|
inputxml = <<~INPUT
|
12
|
-
|
13
|
-
<bibdata type="standard">
|
14
|
-
<title language="en" format="text/plain" type="main">English</title>
|
15
|
-
<title language="en" format="text/plain" type="title-main">English</title>
|
16
|
-
<title language="fr" format="text/plain" type="main">French</title>
|
17
|
-
<title language="fr" format="text/plain" type="title-main">French</title>
|
18
|
-
<docidentifier type="ISO">ISO DIR 1</docidentifier><docidentifier type="iso-with-lang">ISO DIR 1(F)</docidentifier><docidentifier type="iso-reference">ISO DIR 1(F)</docidentifier>
|
19
|
-
<docnumber>1</docnumber>
|
20
|
-
<contributor>
|
21
|
-
<role type="author"/>
|
22
|
-
<organization>
|
23
|
-
<name>International Organization for Standardization</name>
|
24
|
-
<abbreviation>ISO</abbreviation>
|
25
|
-
</organization>
|
26
|
-
</contributor>
|
27
|
-
<contributor>
|
28
|
-
<role type="publisher"/>
|
29
|
-
<organization>
|
30
|
-
<name>International Organization for Standardization</name>
|
31
|
-
<abbreviation>ISO</abbreviation>
|
32
|
-
</organization>
|
33
|
-
</contributor>
|
34
|
-
<language>fr</language>
|
35
|
-
<script>Latn</script>
|
36
|
-
<status>
|
37
|
-
<stage abbreviation="IS">60</stage>
|
38
|
-
<substage>60</substage>
|
39
|
-
</status>
|
40
|
-
<copyright>
|
41
|
-
<from>#{Time.new.year}</from>
|
42
|
-
<owner>
|
43
|
-
<organization>
|
44
|
-
<name>International Organization for Standardization</name>
|
45
|
-
<abbreviation>ISO</abbreviation>
|
46
|
-
</organization>
|
47
|
-
</owner>
|
48
|
-
</copyright>
|
49
|
-
<ext>
|
50
|
-
<doctype>directive</doctype>
|
51
|
-
<subdoctype>vocabulary</subdoctype>
|
52
|
-
<editorialgroup>
|
53
|
-
<technical-committee/>
|
54
|
-
<subcommittee/>
|
55
|
-
<workgroup/>
|
56
|
-
</editorialgroup>
|
57
|
-
<structuredidentifier>
|
58
|
-
<project-number>ISO 1</project-number>
|
59
|
-
</structuredidentifier>
|
60
|
-
<stagename>International standard</stagename>
|
61
|
-
</ext>
|
62
|
-
</bibdata>
|
63
|
-
<boilerplate>
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
12
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
13
|
+
<bibdata type="standard">
|
14
|
+
<title language="en" format="text/plain" type="main">English</title>
|
15
|
+
<title language="en" format="text/plain" type="title-main">English</title>
|
16
|
+
<title language="fr" format="text/plain" type="main">French</title>
|
17
|
+
<title language="fr" format="text/plain" type="title-main">French</title>
|
18
|
+
<docidentifier type="ISO">ISO DIR 1</docidentifier><docidentifier type="iso-with-lang">ISO DIR 1(F)</docidentifier><docidentifier type="iso-reference">ISO DIR 1(F)</docidentifier>
|
19
|
+
<docnumber>1</docnumber>
|
20
|
+
<contributor>
|
21
|
+
<role type="author"/>
|
22
|
+
<organization>
|
23
|
+
<name>International Organization for Standardization</name>
|
24
|
+
<abbreviation>ISO</abbreviation>
|
25
|
+
</organization>
|
26
|
+
</contributor>
|
27
|
+
<contributor>
|
28
|
+
<role type="publisher"/>
|
29
|
+
<organization>
|
30
|
+
<name>International Organization for Standardization</name>
|
31
|
+
<abbreviation>ISO</abbreviation>
|
32
|
+
</organization>
|
33
|
+
</contributor>
|
34
|
+
<language>fr</language>
|
35
|
+
<script>Latn</script>
|
36
|
+
<status>
|
37
|
+
<stage abbreviation="IS">60</stage>
|
38
|
+
<substage>60</substage>
|
39
|
+
</status>
|
40
|
+
<copyright>
|
41
|
+
<from>#{Time.new.year}</from>
|
42
|
+
<owner>
|
43
|
+
<organization>
|
44
|
+
<name>International Organization for Standardization</name>
|
45
|
+
<abbreviation>ISO</abbreviation>
|
46
|
+
</organization>
|
47
|
+
</owner>
|
48
|
+
</copyright>
|
49
|
+
<ext>
|
50
|
+
<doctype>directive</doctype>
|
51
|
+
<subdoctype>vocabulary</subdoctype>
|
52
|
+
<editorialgroup>
|
53
|
+
<technical-committee/>
|
54
|
+
<subcommittee/>
|
55
|
+
<workgroup/>
|
56
|
+
</editorialgroup>
|
57
|
+
<structuredidentifier>
|
58
|
+
<project-number>ISO 1</project-number>
|
59
|
+
</structuredidentifier>
|
60
|
+
<stagename>International standard</stagename>
|
61
|
+
</ext>
|
62
|
+
</bibdata>
|
63
|
+
<boilerplate>
|
64
|
+
<copyright-statement>
|
65
|
+
<clause>
|
66
|
+
<title>DOCUMENT PROTÉGÉ PAR COPYRIGHT</title>
|
67
|
+
<p id="boilerplate-year">© ISO 2021</p>
|
68
68
|
|
69
|
-
|
70
|
-
Droits de reproduction réservés. Sauf indication contraire, aucune partie de cette publication ne
|
71
|
-
peut être reproduite ni utilisée sous quelque forme que ce soit et par aucun procédé, électronique
|
72
|
-
ou mécanique, y compris la photocopie, l’affichage sur l’internet ou sur un Intranet, sans
|
73
|
-
autorisation écrite préalable. Les demandes d’autorisation peuvent être adressées à l’ISO à
|
74
|
-
l’adresse ci-après ou au comité membre de l’ISO dans le pays du demandeur.
|
75
|
-
|
69
|
+
<p id="boilerplate-message">
|
70
|
+
Droits de reproduction réservés. Sauf indication contraire, aucune partie de cette publication ne
|
71
|
+
peut être reproduite ni utilisée sous quelque forme que ce soit et par aucun procédé, électronique
|
72
|
+
ou mécanique, y compris la photocopie, l’affichage sur l’internet ou sur un Intranet, sans
|
73
|
+
autorisation écrite préalable. Les demandes d’autorisation peuvent être adressées à l’ISO à
|
74
|
+
l’adresse ci-après ou au comité membre de l’ISO dans le pays du demandeur.
|
75
|
+
</p>
|
76
76
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
</clause>
|
89
|
-
|
77
|
+
<p id="boilerplate-address" align="left">
|
78
|
+
ISO copyright office<br/>
|
79
|
+
Ch. de Blandonnet 8 • CP 401<br/>
|
80
|
+
CH-1214 Vernier, Geneva, Switzerland<br/>
|
81
|
+
Phone: +41 22 749 01 11<br/>
|
82
|
+
Email: copyright@iso.org<br/>
|
83
|
+
Website: www.iso.org
|
84
|
+
</p>
|
85
|
+
<p id="boilerplate-place">
|
86
|
+
Publié en Suisse
|
87
|
+
</p>
|
88
|
+
</clause>
|
89
|
+
</copyright-statement>
|
90
90
|
|
91
91
|
|
92
|
-
</boilerplate>
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
92
|
+
</boilerplate>
|
93
|
+
<sections>
|
94
|
+
<terms id="H" obligation="normative"><title>1  Terms, Definitions, Symbols and Abbreviated Terms</title>
|
95
|
+
<term id="J">
|
96
|
+
<name>1.1</name>
|
97
|
+
<preferred>Term2</preferred>
|
98
|
+
</term>
|
99
|
+
</terms>
|
100
|
+
</sections>
|
101
101
|
</iso-standard>
|
102
102
|
INPUT
|
103
103
|
|
@@ -152,7 +152,7 @@ l’adresse ci-après ou au comité membre de l’ISO dans le pa
|
|
152
152
|
FileUtils.rm_f "test.xml"
|
153
153
|
FileUtils.rm_f "test.sts.xml"
|
154
154
|
FileUtils.rm_f "test.iso.sts.xml"
|
155
|
-
File.
|
155
|
+
File.write("test.xml", inputxml)
|
156
156
|
processor.output(inputxml, "test.xml", "test.sts.xml", :sts)
|
157
157
|
processor.output(inputxml, "test.xml", "test.iso.sts.xml", :isosts)
|
158
158
|
expect(File.exist?("test.sts.xml")).to be true
|
@@ -35,102 +35,103 @@ RSpec.describe Metanorma::ISO do
|
|
35
35
|
:partnumber: 1
|
36
36
|
:edition: 2
|
37
37
|
:amendment-number: 3
|
38
|
+
:data-uri-image: false
|
38
39
|
|
39
40
|
.Split-it-right sample divider
|
40
|
-
image::spec/examples/
|
41
|
-
image::spec/examples/
|
42
|
-
image::spec/examples/
|
43
|
-
image::spec/examples/
|
44
|
-
image::spec/examples/
|
41
|
+
image::spec/examples/rice_img/rice_image1.png[]
|
42
|
+
image::spec/examples/rice_img/SL1000-1_ed2amd3fig1.png[]
|
43
|
+
image::spec/examples/rice_img/1001_ed2amd3fig1.png[]
|
44
|
+
image::spec/examples/rice_img/ISO_1213_1.png[]
|
45
|
+
image::spec/examples/rice_img/1000-1_ed2amd3figA.png[]
|
45
46
|
|
46
47
|
|===
|
47
48
|
|a |b
|
48
49
|
|
49
|
-
a|image::spec/examples/
|
50
|
-
a|image::spec/examples/
|
50
|
+
a|image::spec/examples/rice_img/1000-1_ed2amd3figTab1.png[]
|
51
|
+
a|image::spec/examples/rice_img/1000-1_ed2amd3fig2.png[]
|
51
52
|
|===
|
52
53
|
|
53
|
-
image::spec/examples/
|
54
|
+
image::spec/examples/rice_img/1000-1_ed2amd3figTab2.png[]
|
54
55
|
|
55
|
-
image::spec/examples/
|
56
|
-
image::spec/examples/
|
56
|
+
image::spec/examples/rice_img/1000-1_ed2amd3figA1.png[]
|
57
|
+
image::spec/examples/rice_img/1000-1_ed2amd3fig1a.png[]
|
57
58
|
|
58
59
|
.Stages of gelatinization
|
59
60
|
====
|
60
|
-
image::spec/examples/
|
61
|
+
image::spec/examples/rice_img/1000-1_ed2amd3fig1b.png[]
|
61
62
|
|
62
|
-
image::spec/examples/
|
63
|
+
image::spec/examples/rice_img/1000-1_ed2amd3fig4.png[]
|
63
64
|
====
|
64
65
|
|
65
|
-
image::spec/examples/
|
66
|
+
image::spec/examples/rice_img/1000-1_ed2amd3fig5_f.png[]
|
66
67
|
|
67
68
|
[appendix]
|
68
69
|
== Annex
|
69
|
-
image::spec/examples/
|
70
|
-
image::spec/examples/
|
70
|
+
image::spec/examples/rice_img/1000-1_ed2amd3figA2.png[]
|
71
|
+
image::spec/examples/rice_img/1000-1_ed2amd3fig3.png[]
|
71
72
|
|
72
73
|
INPUT
|
73
74
|
expect(File.read("test.err")).to include \
|
74
|
-
"image name spec/examples/
|
75
|
+
"image name spec/examples/rice_img/rice_image1.png does not match "\
|
75
76
|
"DRG requirements: expect 1000-1_ed2amd3fig"
|
76
77
|
expect(File.read("test.err")).to include \
|
77
|
-
"image name spec/examples/
|
78
|
+
"image name spec/examples/rice_img/1001_ed2amd3fig1.png does not "\
|
78
79
|
"match DRG requirements: " \
|
79
80
|
"expect 1000-1_ed2amd3fig"
|
80
81
|
expect(File.read("test.err")).not_to include \
|
81
|
-
"image name spec/examples/
|
82
|
+
"image name spec/examples/rice_img/SL1000-1_ed2amd3fig1.png does not "\
|
82
83
|
"match DRG requirements: " \
|
83
84
|
"expect 1000-1_ed2amd3fig"
|
84
85
|
expect(File.read("test.err")).not_to include \
|
85
|
-
"image name spec/examples/
|
86
|
+
"image name spec/examples/rice_img/ISO_1213_1.png does not match DRG "\
|
86
87
|
"requirements: expect 1000-1_ed2amd3fig"
|
87
88
|
expect(File.read("test.err")).to include \
|
88
|
-
"image name spec/examples/
|
89
|
+
"image name spec/examples/rice_img/1000-1_ed2amd3figA.png does not "\
|
89
90
|
"match DRG requirements"
|
90
91
|
expect(File.read("test.err")).not_to include \
|
91
|
-
"image name spec/examples/
|
92
|
+
"image name spec/examples/rice_img/1000-1_ed2amd3figTab1.png does "\
|
92
93
|
"not match DRG requirements"
|
93
94
|
expect(File.read("test.err")).not_to include \
|
94
|
-
"image name spec/examples/
|
95
|
+
"image name spec/examples/rice_img/1000-1_ed2amd3figTab1.png is "\
|
95
96
|
"under a table but is not so labelled"
|
96
97
|
expect(File.read("test.err")).to include \
|
97
|
-
"image name spec/examples/
|
98
|
+
"image name spec/examples/rice_img/1000-1_ed2amd3fig2.png is under "\
|
98
99
|
"a table but is not so labelled"
|
99
100
|
expect(File.read("test.err")).to include \
|
100
|
-
"image name spec/examples/
|
101
|
+
"image name spec/examples/rice_img/1000-1_ed2amd3figTab2.png is "\
|
101
102
|
"labelled as under a table but is not"
|
102
103
|
expect(File.read("test.err")).not_to include \
|
103
|
-
"image name spec/examples/
|
104
|
+
"image name spec/examples/rice_img/1000-1_ed2amd3fig1.png is "\
|
104
105
|
"labelled as under a table but is not"
|
105
106
|
expect(File.read("test.err")).not_to include \
|
106
|
-
"image name spec/examples/
|
107
|
+
"image name spec/examples/rice_img/1000-1_ed2amd3figA2.png is "\
|
107
108
|
"under an annex but is not so labelled"
|
108
109
|
expect(File.read("test.err")).to include \
|
109
|
-
"image name spec/examples/
|
110
|
+
"image name spec/examples/rice_img/1000-1_ed2amd3fig3.png is "\
|
110
111
|
"under an annex but is not so labelled"
|
111
112
|
expect(File.read("test.err")).to include \
|
112
|
-
"image name spec/examples/
|
113
|
+
"image name spec/examples/rice_img/1000-1_ed2amd3figA1.png is "\
|
113
114
|
"labelled as under an annex but is not"
|
114
115
|
expect(File.read("test.err")).not_to include \
|
115
|
-
"image name spec/examples/
|
116
|
+
"image name spec/examples/rice_img/1000-1_ed2amd3fig1.png is "\
|
116
117
|
"labelled as under an annex but is not"
|
117
118
|
expect(File.read("test.err")).not_to include \
|
118
|
-
"image name spec/examples/
|
119
|
+
"image name spec/examples/rice_img/1000-1_ed2amd3fig1b.png has a "\
|
119
120
|
"subfigure letter but is not a subfigure"
|
120
121
|
expect(File.read("test.err")).to include \
|
121
|
-
"image name spec/examples/
|
122
|
+
"image name spec/examples/rice_img/1000-1_ed2amd3fig4.png does not "\
|
122
123
|
"have a subfigure letter but is a subfigure"
|
123
124
|
expect(File.read("test.err")).to include \
|
124
|
-
"image name spec/examples/
|
125
|
+
"image name spec/examples/rice_img/1000-1_ed2amd3fig1a.png has a "\
|
125
126
|
"subfigure letter but is not a subfigure"
|
126
127
|
expect(File.read("test.err")).not_to include \
|
127
|
-
"image name spec/examples/
|
128
|
+
"image name spec/examples/rice_img/1000-1_ed2amd3fig1.png has a "\
|
128
129
|
"subfigure letter but is not a subfigure"
|
129
130
|
expect(File.read("test.err")).to include \
|
130
|
-
"image name spec/examples/
|
131
|
+
"image name spec/examples/rice_img/1000-1_ed2amd3fig5_f.png expected "\
|
131
132
|
"to have suffix _e"
|
132
133
|
expect(File.read("test.err")).not_to include \
|
133
|
-
"image name spec/examples/
|
134
|
+
"image name spec/examples/rice_img/1000-1_ed2amd3fig1.png expected "\
|
134
135
|
"to have suffix _e"
|
135
136
|
end
|
136
137
|
|
@@ -487,7 +488,7 @@ RSpec.describe Metanorma::ISO do
|
|
487
488
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
488
489
|
#{VALIDATING_BLANK_HDR}
|
489
490
|
|
490
|
-
image::spec/examples/
|
491
|
+
image::spec/examples/rice_img/rice_image1.png[]
|
491
492
|
INPUT
|
492
493
|
expect(File.read("test.err")).to include "Figure should have title"
|
493
494
|
end
|
@@ -2136,12 +2137,12 @@ RSpec.describe Metanorma::ISO do
|
|
2136
2137
|
|
2137
2138
|
[[b]]
|
2138
2139
|
=== Term 1
|
2139
|
-
<<b>>
|
2140
|
-
<<c>>
|
2140
|
+
_<<b>>_
|
2141
|
+
_<<c>>_
|
2141
2142
|
|
2142
2143
|
== Clause
|
2143
|
-
<<b>>
|
2144
|
-
<<c>>
|
2144
|
+
_<<b>>_
|
2145
|
+
_<<c>>_
|
2145
2146
|
|
2146
2147
|
INPUT
|
2147
2148
|
expect(File.read("test.err"))
|