metanorma-iec 2.0.7 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/iec/base_convert.rb +5 -5
- data/lib/isodoc/iec/html/html_iec_titlepage.html +1 -0
- data/lib/isodoc/iec/iec.international-standard.xsl +1596 -311
- data/lib/isodoc/iec/init.rb +6 -5
- data/lib/isodoc/iec/metadata.rb +2 -2
- data/lib/isodoc/iec/presentation_xml_convert.rb +3 -3
- data/lib/isodoc/iec/word_convert.rb +3 -3
- data/lib/isodoc/iec/xref.rb +4 -0
- data/lib/metanorma/iec/biblio.rng +62 -10
- data/lib/metanorma/iec/front.rb +1 -1
- data/lib/metanorma/iec/iec.rng +1 -0
- data/lib/metanorma/iec/isodoc.rng +56 -0
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +3 -2
- data/spec/isodoc/blocks_spec.rb +146 -202
- data/spec/isodoc/i18n_spec.rb +22 -7
- data/spec/isodoc/iev_spec.rb +8 -8
- data/spec/isodoc/inline_spec.rb +255 -249
- data/spec/isodoc/metadata_spec.rb +9 -9
- data/spec/isodoc/postproc_spec.rb +2 -2
- data/spec/isodoc/ref_spec.rb +14 -62
- data/spec/metanorma/base_spec.rb +2 -2
- data/spec/metanorma/blocks_spec.rb +2 -2
- data/spec/metanorma/cleanup_spec.rb +1 -1
- data/spec/metanorma/iev_spec.rb +1 -1
- data/spec/metanorma/inline_spec.rb +86 -70
- data/spec/metanorma/section_spec.rb +196 -183
- data/spec/spec_helper.rb +7 -0
- metadata +4 -4
data/spec/isodoc/ref_spec.rb
CHANGED
@@ -71,7 +71,7 @@ RSpec.describe IsoDoc::Iec do
|
|
71
71
|
|
72
72
|
</references><references id="_bibliography" obligation="informative" normative="false">
|
73
73
|
<title>Bibliography</title>
|
74
|
-
<bibitem id="ISBN" type="
|
74
|
+
<bibitem id="ISBN" type="book">
|
75
75
|
<title format="text/plain">Chemicals for analytical laboratory use</title>
|
76
76
|
<docidentifier type="ISBN">ISBN</docidentifier>
|
77
77
|
<docidentifier type="metanorma">[1]</docidentifier>
|
@@ -82,7 +82,7 @@ RSpec.describe IsoDoc::Iec do
|
|
82
82
|
</organization>
|
83
83
|
</contributor>
|
84
84
|
</bibitem>
|
85
|
-
<bibitem id="ISSN" type="
|
85
|
+
<bibitem id="ISSN" type="journal">
|
86
86
|
<title format="text/plain">Instruments for analytical laboratory use</title>
|
87
87
|
<docidentifier type="ISSN">ISSN</docidentifier>
|
88
88
|
<docidentifier type="metanorma">[2]</docidentifier>
|
@@ -145,44 +145,18 @@ RSpec.describe IsoDoc::Iec do
|
|
145
145
|
<bibliography><references id="_normative_references" obligation="informative" normative="true" displayorder="2"><title depth="1">1<tab/>Normative References</title>
|
146
146
|
<p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
147
147
|
<bibitem id="ISO712" type="standard">
|
148
|
-
<
|
149
|
-
<title type="main" format="text/plain">Cereals and cereal products</title>
|
148
|
+
<formattedref><em><span class='stddocTitle'>Cereals and cereal products</span></em></formattedref>
|
150
149
|
<docidentifier type="ISO">ISO 712</docidentifier>
|
151
150
|
<docidentifier type="metanorma">[110]</docidentifier>
|
152
|
-
<contributor>
|
153
|
-
<role type="publisher"/>
|
154
|
-
<organization>
|
155
|
-
<name>International Organization for Standardization</name>
|
156
|
-
</organization>
|
157
|
-
</contributor>
|
158
151
|
</bibitem>
|
159
152
|
<bibitem id="ISO16634" type="standard">
|
160
|
-
<
|
161
|
-
<title language="en" format="text/plain">Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</title>
|
153
|
+
<formattedref><em><span class='stddocTitle'>Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</span></em></formattedref>
|
162
154
|
<docidentifier type="ISO">ISO 16634:-- (all parts)</docidentifier>
|
163
|
-
<date type="published"><on>--</on></date>
|
164
|
-
<contributor>
|
165
|
-
<role type="publisher"/>
|
166
|
-
<organization>
|
167
|
-
<abbreviation>ISO</abbreviation>
|
168
|
-
</organization>
|
169
|
-
</contributor>
|
170
155
|
<note format="text/plain" reference="1" type="Unpublished-Status">Under preparation. (Stage at the time of publication ISO/DIS 16634)</note>
|
171
|
-
<extent type="part">
|
172
|
-
<referenceFrom>all</referenceFrom>
|
173
|
-
</extent>
|
174
|
-
|
175
156
|
</bibitem>
|
176
157
|
<bibitem id="ISO20483" type="standard">
|
177
|
-
<
|
158
|
+
<formattedref><em><span class='stddocTitle'>Cereals and pulses</span></em></formattedref>
|
178
159
|
<docidentifier type="ISO">ISO 20483:2013-2014</docidentifier>
|
179
|
-
<date type="published"><from>2013</from><to>2014</to></date>
|
180
|
-
<contributor>
|
181
|
-
<role type="publisher"/>
|
182
|
-
<organization>
|
183
|
-
<name>International Organization for Standardization</name>
|
184
|
-
</organization>
|
185
|
-
</contributor>
|
186
160
|
</bibitem>
|
187
161
|
<bibitem id="ref1">
|
188
162
|
<formattedref format="application/x-isodoc+xml"><smallcap>Standard No I.C.C 167</smallcap>. <em>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</em> (see <link target="http://www.icc.or.at"/>)</formattedref>
|
@@ -190,51 +164,31 @@ RSpec.describe IsoDoc::Iec do
|
|
190
164
|
</bibitem>
|
191
165
|
<note><name>NOTE</name><p>This is an annotation of ISO 20483:2013-2014</p></note>
|
192
166
|
<bibitem id="zip_ffs"><formattedref format="application/x-isodoc+xml">Title 5</formattedref><docidentifier type="metanorma">[5]</docidentifier></bibitem>
|
193
|
-
|
194
|
-
|
195
167
|
</references><references id="_bibliography" obligation="informative" normative="false" displayorder="3">
|
196
168
|
<title depth="1">Bibliography</title>
|
197
|
-
<bibitem id="ISBN" type="
|
198
|
-
<
|
169
|
+
<bibitem id="ISBN" type="book">
|
170
|
+
<formattedref><em>Chemicals for analytical laboratory use</em>. ISBN.</formattedref>
|
199
171
|
<docidentifier type="ISBN">ISBN</docidentifier>
|
200
172
|
<docidentifier type="metanorma">[1]</docidentifier>
|
201
|
-
<contributor>
|
202
|
-
<role type="publisher"/>
|
203
|
-
<organization>
|
204
|
-
<abbreviation>ISBN</abbreviation>
|
205
|
-
</organization>
|
206
|
-
</contributor>
|
207
173
|
</bibitem>
|
208
|
-
<bibitem id="ISSN" type="
|
209
|
-
<
|
174
|
+
<bibitem id="ISSN" type="journal">
|
175
|
+
<formattedref><em>Instruments for analytical laboratory use</em>. ISSN.</formattedref>
|
210
176
|
<docidentifier type="ISSN">ISSN</docidentifier>
|
211
177
|
<docidentifier type="metanorma">[2]</docidentifier>
|
212
|
-
<contributor>
|
213
|
-
<role type="publisher"/>
|
214
|
-
<organization>
|
215
|
-
<abbreviation>ISSN</abbreviation>
|
216
|
-
</organization>
|
217
|
-
</contributor>
|
218
178
|
</bibitem>
|
219
179
|
<note><name>NOTE</name><p>This is an annotation of document ISSN.</p></note>
|
220
180
|
<note><name>NOTE</name><p>This is another annotation of document ISSN.</p></note>
|
221
181
|
<bibitem id="ISO3696" type="standard">
|
222
|
-
<
|
182
|
+
<formattedref><em><span class='stddocTitle'>Water for analytical laboratory use</span></em></formattedref>
|
223
183
|
<docidentifier type='metanorma-ordinal'>[3]</docidentifier>
|
224
184
|
<docidentifier type="ISO">ISO 3696</docidentifier>
|
225
|
-
<contributor>
|
226
|
-
<role type="publisher"/>
|
227
|
-
<organization>
|
228
|
-
<abbreviation>ISO</abbreviation>
|
229
|
-
</organization>
|
230
|
-
</contributor>
|
231
185
|
</bibitem>
|
232
186
|
<bibitem id="ref10">
|
233
187
|
<formattedref format="application/x-isodoc+xml"><smallcap>Standard No I.C.C 167</smallcap>. <em>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</em> (see <link target="http://www.icc.or.at"/>)</formattedref>
|
234
188
|
<docidentifier type="metanorma">[10]</docidentifier>
|
235
189
|
</bibitem>
|
236
190
|
<bibitem id="ref11">
|
237
|
-
<
|
191
|
+
<formattedref><em>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</em>.</formattedref>
|
238
192
|
<docidentifier type='metanorma-ordinal'>[4]</docidentifier>
|
239
193
|
<docidentifier type="IETF">IETF RFC 10</docidentifier>
|
240
194
|
</bibitem>
|
@@ -243,8 +197,6 @@ RSpec.describe IsoDoc::Iec do
|
|
243
197
|
<docidentifier type="metanorma">[Citn]</docidentifier>
|
244
198
|
<docidentifier type="IETF">IETF RFC 20</docidentifier>
|
245
199
|
</bibitem>
|
246
|
-
|
247
|
-
|
248
200
|
</references>
|
249
201
|
</bibliography>
|
250
202
|
</iso-standard>
|
@@ -318,11 +270,11 @@ RSpec.describe IsoDoc::Iec do
|
|
318
270
|
<h1 class='Section3'>Bibliography</h1>
|
319
271
|
<p id='ISBN' class='Biblio'>
|
320
272
|
[1] 
|
321
|
-
<i>Chemicals for analytical laboratory use</i
|
273
|
+
<i>Chemicals for analytical laboratory use</i>. ISBN.
|
322
274
|
</p>
|
323
275
|
<p id='ISSN' class='Biblio'>
|
324
276
|
[2] 
|
325
|
-
<i>Instruments for analytical laboratory use</i
|
277
|
+
<i>Instruments for analytical laboratory use</i>. ISSN.
|
326
278
|
</p>
|
327
279
|
<div class='Note'>
|
328
280
|
<p>
|
@@ -355,7 +307,7 @@ RSpec.describe IsoDoc::Iec do
|
|
355
307
|
</p>
|
356
308
|
<p id='ref11' class='Biblio'>
|
357
309
|
[4]  IETF RFC 10,
|
358
|
-
<i>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</i
|
310
|
+
<i>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</i>.
|
359
311
|
</p>
|
360
312
|
<p id='ref12' class='Biblio'>
|
361
313
|
Citn  IETF RFC 20, CitationWorks. 2019.
|
data/spec/metanorma/base_spec.rb
CHANGED
@@ -357,7 +357,7 @@ RSpec.describe Metanorma::Iec do
|
|
357
357
|
<?xml version="1.0" encoding="UTF-8"?>
|
358
358
|
<iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
|
359
359
|
<bibdata type='standard'>
|
360
|
-
<docidentifier type='ISO'>
|
360
|
+
<docidentifier type='ISO'>IEC/IETF/ISO/2CDTS 1000-1-1 ED 1</docidentifier>
|
361
361
|
<docidentifier type='iso-tc'>2000</docidentifier>
|
362
362
|
<docnumber>1000</docnumber>
|
363
363
|
<contributor>
|
@@ -443,7 +443,7 @@ RSpec.describe Metanorma::Iec do
|
|
443
443
|
<workgroup/>
|
444
444
|
</editorialgroup>
|
445
445
|
<structuredidentifier>
|
446
|
-
<project-number part='1' subpart='1'>
|
446
|
+
<project-number part='1' subpart='1'>IEC/IETF/ISO 1000</project-number>
|
447
447
|
</structuredidentifier>
|
448
448
|
<stagename>Committee draft</stagename>
|
449
449
|
</ext>
|
@@ -132,7 +132,7 @@ RSpec.describe Metanorma::Iec do
|
|
132
132
|
<title>Terms and definitions</title>
|
133
133
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
134
134
|
#{TERMS_BOILERPLATE}
|
135
|
-
<term id="term-
|
135
|
+
<term id="term-Term1">
|
136
136
|
<preferred><expression><name>Term1</name></expression></preferred>
|
137
137
|
<termnote id="_">
|
138
138
|
<p id="_">This is a note</p>
|
@@ -254,7 +254,7 @@ RSpec.describe Metanorma::Iec do
|
|
254
254
|
<title>Terms and definitions</title>
|
255
255
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
256
256
|
#{TERMS_BOILERPLATE}
|
257
|
-
<term id="term-
|
257
|
+
<term id="term-Term1">
|
258
258
|
<preferred><expression><name>Term1</name></expression></preferred>
|
259
259
|
<termexample id="_">
|
260
260
|
<p id="_">This is an example</p>
|
@@ -127,7 +127,7 @@ RSpec.describe Metanorma::Iec do
|
|
127
127
|
<p id='_'>So am I</p>
|
128
128
|
</li>
|
129
129
|
</ul>
|
130
|
-
<term id="term-
|
130
|
+
<term id="term-Time">
|
131
131
|
<preferred><expression><name>Time</name></expression></preferred>
|
132
132
|
<definition><verbal-definition><p id="_">This paragraph is extraneous</p></verbal-definition></definition>
|
133
133
|
</term></terms>
|
data/spec/metanorma/iev_spec.rb
CHANGED
@@ -164,7 +164,7 @@ RSpec.describe Metanorma::Iec do
|
|
164
164
|
<title>Terms and definitions</title>
|
165
165
|
<terms id='_' obligation='normative'>
|
166
166
|
<title>General</title>
|
167
|
-
<term id='term-
|
167
|
+
<term id='term-Term-1'>
|
168
168
|
<preferred><expression><name>Term 1</name></expression></preferred>
|
169
169
|
</term>
|
170
170
|
</terms>
|
@@ -1,12 +1,12 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
RSpec.describe Metanorma::Iec do
|
4
|
-
|
5
|
-
|
6
|
-
end
|
4
|
+
before(:all) do
|
5
|
+
@blank_hdr = blank_hdr_gen
|
6
|
+
end
|
7
7
|
|
8
8
|
it "processes breaks" do
|
9
|
-
|
9
|
+
input = <<~INPUT
|
10
10
|
#{ASCIIDOC_BLANK_HDR}
|
11
11
|
Line break +
|
12
12
|
line break
|
@@ -15,47 +15,56 @@ end
|
|
15
15
|
|
16
16
|
<<<
|
17
17
|
INPUT
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
output = <<~OUTPUT
|
19
|
+
#{@blank_hdr}
|
20
|
+
<sections><p id="_">Line break<br/>
|
21
|
+
line break</p>
|
22
|
+
<hr/>
|
23
|
+
<pagebreak/></sections>
|
24
|
+
</iec-standard>
|
24
25
|
OUTPUT
|
26
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
27
|
+
.to be_equivalent_to xmlpp(output)
|
25
28
|
end
|
26
29
|
|
27
30
|
it "processes links" do
|
28
|
-
|
31
|
+
input = <<~INPUT
|
29
32
|
#{ASCIIDOC_BLANK_HDR}
|
30
33
|
mailto:fred@example.com
|
31
34
|
http://example.com[]
|
32
35
|
http://example.com[Link]
|
33
36
|
INPUT
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
output = <<~OUTPUT
|
38
|
+
#{@blank_hdr}
|
39
|
+
<sections>
|
40
|
+
<p id="_">mailto:fred@example.com
|
41
|
+
<link target="http://example.com"/>
|
42
|
+
<link target="http://example.com">Link</link></p>
|
43
|
+
</sections>
|
44
|
+
</iec-standard>
|
41
45
|
OUTPUT
|
46
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
47
|
+
.to be_equivalent_to xmlpp(output)
|
42
48
|
end
|
43
49
|
|
44
|
-
|
45
|
-
|
50
|
+
it "processes bookmarks" do
|
51
|
+
input = <<~INPUT
|
46
52
|
#{ASCIIDOC_BLANK_HDR}
|
47
53
|
Text [[bookmark]] Text
|
48
54
|
INPUT
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
55
|
+
output = <<~OUTPUT
|
56
|
+
#{@blank_hdr}
|
57
|
+
<sections>
|
58
|
+
<p id="_">Text <bookmark id="bookmark"/> Text</p>
|
59
|
+
</sections>
|
60
|
+
</iec-standard>
|
54
61
|
OUTPUT
|
55
|
-
|
62
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
63
|
+
.to be_equivalent_to xmlpp(output)
|
64
|
+
end
|
56
65
|
|
57
|
-
|
58
|
-
|
66
|
+
it "processes crossreferences" do
|
67
|
+
input = <<~INPUT
|
59
68
|
#{ASCIIDOC_BLANK_HDR}
|
60
69
|
[[reference]]
|
61
70
|
== Section
|
@@ -65,22 +74,25 @@ end
|
|
65
74
|
Inline Reference with Text to <<reference,text>>
|
66
75
|
Footnoted Reference with Text to <<reference,fn: text>>
|
67
76
|
INPUT
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
77
|
+
output = <<~OUTPUT
|
78
|
+
#{@blank_hdr}
|
79
|
+
<sections>
|
80
|
+
<clause id="reference" inline-header="false" obligation="normative">
|
81
|
+
<title>Section</title>
|
82
|
+
<p id="_">Inline Reference to <xref target="reference"/>
|
83
|
+
Footnoted Reference to <xref target="reference"/>
|
84
|
+
Inline Reference with Text to <xref target="reference">text</xref>
|
85
|
+
Footnoted Reference with Text to <xref target="reference">text</xref></p>
|
86
|
+
</clause>
|
87
|
+
</sections>
|
88
|
+
</iec-standard>
|
89
|
+
OUTPUT
|
90
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
91
|
+
.to be_equivalent_to xmlpp(output)
|
92
|
+
end
|
81
93
|
|
82
|
-
|
83
|
-
|
94
|
+
it "processes bibliographic anchors" do
|
95
|
+
input = <<~INPUT
|
84
96
|
#{ASCIIDOC_BLANK_HDR}
|
85
97
|
[bibliography]
|
86
98
|
== Normative References
|
@@ -89,41 +101,45 @@ end
|
|
89
101
|
* [[[ISO713]]] Reference
|
90
102
|
|
91
103
|
INPUT
|
92
|
-
|
93
|
-
|
104
|
+
output = <<~OUTPUT
|
105
|
+
#{@blank_hdr}
|
106
|
+
<sections>
|
94
107
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
108
|
+
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
109
|
+
<title>Normative references</title>
|
110
|
+
<p id="_">The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
111
|
+
<bibitem id="ISO712">
|
112
|
+
<formattedref format="application/x-isodoc+xml">Reference</formattedref>
|
113
|
+
<docidentifier>x</docidentifier>
|
114
|
+
</bibitem>
|
115
|
+
<bibitem id="ISO713">
|
116
|
+
<formattedref format="application/x-isodoc+xml">Reference</formattedref>
|
117
|
+
<docidentifier>ISO713</docidentifier>
|
118
|
+
<docnumber>713</docnumber>
|
119
|
+
</bibitem>
|
120
|
+
</references>
|
121
|
+
</bibliography>
|
122
|
+
</iec-standard>
|
110
123
|
OUTPUT
|
124
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
125
|
+
.to be_equivalent_to xmlpp(output)
|
111
126
|
end
|
112
127
|
|
113
128
|
it "processes footnotes" do
|
114
|
-
|
129
|
+
input = <<~INPUT
|
115
130
|
#{ASCIIDOC_BLANK_HDR}
|
116
131
|
Hello!footnote:[Footnote text]
|
117
132
|
INPUT
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
133
|
+
output = <<~OUTPUT
|
134
|
+
#{@blank_hdr}
|
135
|
+
<sections>
|
136
|
+
<p id="_">Hello!<fn reference="1">
|
137
|
+
<p id="_">Footnote text</p>
|
138
|
+
</fn></p>
|
139
|
+
</sections>
|
140
|
+
</iec-standard>
|
125
141
|
OUTPUT
|
142
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
143
|
+
.to be_equivalent_to xmlpp(output)
|
126
144
|
end
|
127
|
-
|
128
|
-
|
129
145
|
end
|