metanorma-iso 2.0.7 → 2.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/iso/base.rb +0 -1
- data/lib/asciidoctor/iso/cleanup.rb +0 -1
- data/lib/asciidoctor/iso/converter.rb +0 -1
- data/lib/asciidoctor/iso/deprecated.rb +4 -2
- data/lib/asciidoctor/iso/front.rb +0 -1
- data/lib/asciidoctor/iso/front_id.rb +0 -1
- data/lib/asciidoctor/iso/section.rb +0 -1
- data/lib/asciidoctor/iso/validate.rb +0 -1
- data/lib/asciidoctor/iso/validate_image.rb +0 -1
- data/lib/asciidoctor/iso/validate_requirements.rb +0 -1
- data/lib/asciidoctor/iso/validate_section.rb +0 -1
- data/lib/asciidoctor/iso/validate_style.rb +0 -1
- data/lib/asciidoctor/iso/validate_title.rb +0 -1
- data/lib/isodoc/iso/html/html_iso_titlepage.html +2 -2
- data/lib/isodoc/iso/html/word_iso_titlepage-dis.html +1 -1
- data/lib/isodoc/iso/html/word_iso_titlepage.html +2 -2
- data/lib/isodoc/iso/i18n-en.yaml +1 -1
- data/lib/isodoc/iso/index.rb +1 -1
- data/lib/isodoc/iso/iso.amendment.xsl +132 -46
- data/lib/isodoc/iso/iso.international-standard.xsl +132 -46
- data/lib/isodoc/iso/metadata.rb +74 -56
- data/lib/isodoc/iso/presentation_xml_convert.rb +0 -2
- data/lib/isodoc/iso/xref.rb +4 -5
- data/lib/metanorma/iso/biblio.rng +25 -2
- data/lib/metanorma/iso/cleanup.rb +5 -5
- data/lib/metanorma/iso/front_id.rb +28 -11
- data/lib/metanorma/iso/version.rb +1 -1
- data/spec/isodoc/i18n_spec.rb +111 -114
- data/spec/isodoc/iso_spec.rb +42 -26
- data/spec/metanorma/amd_spec.rb +39 -16
- data/spec/metanorma/base_spec.rb +8 -0
- data/spec/metanorma/blocks_spec.rb +4 -4
- data/spec/metanorma/cleanup_spec.rb +11 -11
- data/spec/metanorma/section_spec.rb +3 -3
- data/spec/spec_helper.rb +1 -1
- metadata +2 -2
data/spec/isodoc/i18n_spec.rb
CHANGED
@@ -380,11 +380,7 @@ RSpec.describe IsoDoc do
|
|
380
380
|
<p id="A">This is a preamble</p>
|
381
381
|
</foreword>
|
382
382
|
<introduction id="B" obligation="informative" displayorder='2'>
|
383
|
-
<title depth="1">
|
384
|
-
0
|
385
|
-
<tab/>
|
386
|
-
Introduction
|
387
|
-
</title>
|
383
|
+
<title depth="1">0<tab/>Introduction</title>
|
388
384
|
<clause id="C" inline-header="false" obligation="informative">
|
389
385
|
<title depth="2">0.1<tab/>Introduction Subsection</title>
|
390
386
|
</clause>
|
@@ -1146,40 +1142,31 @@ RSpec.describe IsoDoc do
|
|
1146
1142
|
<doctype language='zh'>国际标准</doctype>
|
1147
1143
|
</ext>
|
1148
1144
|
</bibdata>
|
1145
|
+
|
1149
1146
|
<preface>
|
1150
1147
|
<foreword obligation="informative" displayorder='1'>
|
1151
1148
|
<title>Foreword</title>
|
1152
1149
|
<p id="A">This is a preamble</p>
|
1153
1150
|
</foreword>
|
1154
1151
|
<introduction id="B" obligation="informative" displayorder='2'>
|
1155
|
-
<title depth="1">0
|
1156
|
-
<tab/>
|
1157
|
-
Introduction</title>
|
1152
|
+
<title depth="1">0<tab/>Introduction</title>
|
1158
1153
|
<clause id="C" inline-header="false" obligation="informative">
|
1159
|
-
<title depth="2">0.1
|
1160
|
-
<tab/>
|
1161
|
-
Introduction Subsection</title>
|
1154
|
+
<title depth="2">0.1<tab/>Introduction Subsection</title>
|
1162
1155
|
</clause>
|
1163
1156
|
<p>This is patent boilerplate</p>
|
1164
1157
|
</introduction>
|
1165
1158
|
</preface>
|
1166
1159
|
<sections>
|
1167
1160
|
<clause id="D" obligation="normative" type="scope" displayorder='3'>
|
1168
|
-
<title depth="1">1
|
1169
|
-
<tab/>
|
1170
|
-
Scope</title>
|
1161
|
+
<title depth="1">1<tab/>Scope</title>
|
1171
1162
|
<p id="E">
|
1172
|
-
<eref bibitemid="ISO712" type="inline"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality>ISO 712
|
1163
|
+
<eref bibitemid="ISO712" type="inline"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality>ISO 712, 第1–1表</eref>
|
1173
1164
|
</p>
|
1174
1165
|
</clause>
|
1175
1166
|
<clause id="H" obligation="normative" displayorder='5'>
|
1176
|
-
<title depth="1">3
|
1177
|
-
<tab/>
|
1178
|
-
Terms, definitions, symbols and abbreviated terms</title>
|
1167
|
+
<title depth="1">3<tab/>Terms, definitions, symbols and abbreviated terms</title>
|
1179
1168
|
<terms id="I" obligation="normative">
|
1180
|
-
<title depth="2">3.1
|
1181
|
-
<tab/>
|
1182
|
-
Normal Terms</title>
|
1169
|
+
<title depth="2">3.1<tab/>Normal Terms</title>
|
1183
1170
|
<term id="J">
|
1184
1171
|
<name>3.1.1</name>
|
1185
1172
|
<preferred><strong>Term2</strong></preferred>
|
@@ -1201,18 +1188,12 @@ RSpec.describe IsoDoc do
|
|
1201
1188
|
</dl>
|
1202
1189
|
</definitions>
|
1203
1190
|
<clause id="M" inline-header="false" obligation="normative" displayorder='7'>
|
1204
|
-
<title depth="1">5
|
1205
|
-
<tab/>
|
1206
|
-
Clause 4</title>
|
1191
|
+
<title depth="1">5<tab/>Clause 4</title>
|
1207
1192
|
<clause id="N" inline-header="false" obligation="normative">
|
1208
|
-
<title depth="2">5.1
|
1209
|
-
<tab/>
|
1210
|
-
Introduction</title>
|
1193
|
+
<title depth="2">5.1<tab/>Introduction</title>
|
1211
1194
|
</clause>
|
1212
1195
|
<clause id="O" inline-header="false" obligation="normative">
|
1213
|
-
<title depth="2">5.2
|
1214
|
-
<tab/>
|
1215
|
-
Clause 4.2</title>
|
1196
|
+
<title depth="2">5.2<tab/>Clause 4.2</title>
|
1216
1197
|
</clause>
|
1217
1198
|
</clause>
|
1218
1199
|
</sections>
|
@@ -1224,26 +1205,18 @@ RSpec.describe IsoDoc do
|
|
1224
1205
|
<br/>
|
1225
1206
|
<strong>Annex</strong></title>
|
1226
1207
|
<clause id="Q" inline-header="false" obligation="normative">
|
1227
|
-
<title depth="2">A.1
|
1228
|
-
<tab/>
|
1229
|
-
Annex A.1</title>
|
1208
|
+
<title depth="2">A.1<tab/>Annex A.1</title>
|
1230
1209
|
<clause id="Q1" inline-header="false" obligation="normative">
|
1231
|
-
<title depth="3">A.1.1
|
1232
|
-
<tab/>
|
1233
|
-
Annex A.1a</title>
|
1210
|
+
<title depth="3">A.1.1<tab/>Annex A.1a</title>
|
1234
1211
|
</clause>
|
1235
1212
|
</clause>
|
1236
1213
|
<appendix id="Q2" inline-header="false" obligation="normative">
|
1237
|
-
<title depth="2">附录1
|
1238
|
-
<tab/>
|
1239
|
-
An Appendix</title>
|
1214
|
+
<title depth="2">附录1<tab/>An Appendix</title>
|
1240
1215
|
</appendix>
|
1241
1216
|
</annex>
|
1242
1217
|
<bibliography>
|
1243
1218
|
<references id="R" normative="true" obligation="informative" displayorder='4'>
|
1244
|
-
<title depth="1">2
|
1245
|
-
<tab/>
|
1246
|
-
Normative References</title>
|
1219
|
+
<title depth="1">2<tab/>Normative References</title>
|
1247
1220
|
<bibitem id="ISO712" type="standard">
|
1248
1221
|
<title format="text/plain">Cereals and cereal products</title>
|
1249
1222
|
<docidentifier>ISO 712</docidentifier>
|
@@ -1267,78 +1240,102 @@ RSpec.describe IsoDoc do
|
|
1267
1240
|
|
1268
1241
|
html = <<~OUTPUT
|
1269
1242
|
#{HTML_HDR.gsub(/"en"/, '"zh"')}
|
1270
|
-
|
1271
|
-
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1243
|
+
<br/>
|
1244
|
+
<div>
|
1245
|
+
<h1 class='ForewordTitle'>Foreword</h1>
|
1246
|
+
<p id='A'>This is a preamble</p>
|
1247
|
+
</div>
|
1248
|
+
<br/>
|
1249
|
+
<div class='Section3' id='B'>
|
1250
|
+
<h1 class='IntroTitle'>0 Introduction</h1>
|
1251
|
+
<div id='C'>
|
1252
|
+
<h2>0.1 Introduction Subsection</h2>
|
1253
|
+
</div>
|
1254
|
+
<p>This is patent boilerplate</p>
|
1255
|
+
</div>
|
1256
|
+
<p class='zzSTDTitle1'/>
|
1257
|
+
<div id='D'>
|
1258
|
+
<h1>1 Scope</h1>
|
1259
|
+
<p id='E'>
|
1260
|
+
<a href='#ISO712'>ISO 712, 第1–1表</a>
|
1261
|
+
</p>
|
1262
|
+
</div>
|
1263
|
+
<div>
|
1264
|
+
<h1>2 Normative References</h1>
|
1265
|
+
<p id='ISO712' class='NormRef'>
|
1266
|
+
ISO 712,
|
1267
|
+
<i>Cereals and cereal products</i>
|
1268
|
+
</p>
|
1269
|
+
</div>
|
1270
|
+
<div id='H'>
|
1271
|
+
<h1>3 Terms, definitions, symbols and abbreviated terms</h1>
|
1272
|
+
<div id='I'>
|
1273
|
+
<h2>3.1 Normal Terms</h2>
|
1274
|
+
<p class='TermNum' id='J'>3.1.1</p>
|
1275
|
+
<p class='Terms' style='text-align:left;'>
|
1276
|
+
<b>Term2</b>
|
1277
|
+
</p>
|
1278
|
+
</div>
|
1279
|
+
<div id='K'>
|
1280
|
+
<span class='zzMoveToFollowing'>
|
1281
|
+
<b>3.2 </b>
|
1282
|
+
</span>
|
1283
|
+
<dl>
|
1284
|
+
<dt>
|
1285
|
+
<p>Symbol</p>
|
1286
|
+
</dt>
|
1287
|
+
<dd>Definition</dd>
|
1288
|
+
</dl>
|
1289
|
+
</div>
|
1290
|
+
</div>
|
1291
|
+
<div id='L' class='Symbols'>
|
1292
|
+
<h1>4</h1>
|
1293
|
+
<dl>
|
1294
|
+
<dt>
|
1295
|
+
<p>Symbol</p>
|
1296
|
+
</dt>
|
1297
|
+
<dd>Definition</dd>
|
1298
|
+
</dl>
|
1299
|
+
</div>
|
1300
|
+
<div id='M'>
|
1301
|
+
<h1>5 Clause 4</h1>
|
1302
|
+
<div id='N'>
|
1303
|
+
<h2>5.1 Introduction</h2>
|
1304
|
+
</div>
|
1305
|
+
<div id='O'>
|
1306
|
+
<h2>5.2 Clause 4.2</h2>
|
1307
|
+
</div>
|
1308
|
+
</div>
|
1309
|
+
<br/>
|
1310
|
+
<div id='P' class='Section3'>
|
1311
|
+
<h1 class='Annex'>
|
1312
|
+
<b>附件A</b>
|
1313
|
+
<br/>
|
1314
|
+
(规范性附录)
|
1315
|
+
<br/>
|
1316
|
+
<br/>
|
1317
|
+
<b>Annex</b>
|
1318
|
+
</h1>
|
1319
|
+
<div id='Q'>
|
1320
|
+
<h2>A.1 Annex A.1</h2>
|
1321
|
+
<div id='Q1'>
|
1322
|
+
<h3>A.1.1 Annex A.1a</h3>
|
1323
|
+
</div>
|
1324
|
+
</div>
|
1325
|
+
<div id='Q2'>
|
1326
|
+
<h2>附录1 An Appendix</h2>
|
1327
|
+
</div>
|
1328
|
+
</div>
|
1329
|
+
<br/>
|
1330
|
+
<div>
|
1331
|
+
<h1 class='Section3'>Bibliography</h1>
|
1332
|
+
<div>
|
1333
|
+
<h2 class='Section3'>Bibliography Subsection</h2>
|
1334
|
+
</div>
|
1335
|
+
</div>
|
1336
|
+
</div>
|
1337
|
+
</body>
|
1338
|
+
</html>
|
1342
1339
|
OUTPUT
|
1343
1340
|
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
|
1344
1341
|
.convert("test", input, true))
|
data/spec/isodoc/iso_spec.rb
CHANGED
@@ -15,9 +15,12 @@ RSpec.describe IsoDoc::Iso do
|
|
15
15
|
</iso-standard>
|
16
16
|
INPUT
|
17
17
|
html = File.read("test.html", encoding: "utf-8")
|
18
|
-
expect(html)
|
19
|
-
|
20
|
-
expect(html)
|
18
|
+
expect(html)
|
19
|
+
.to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
|
20
|
+
expect(html)
|
21
|
+
.to match(%r[blockquote[^{]+\{[^{]+font-family: "Cambria", serif;]m)
|
22
|
+
expect(html)
|
23
|
+
.to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Cambria", serif;]m)
|
21
24
|
end
|
22
25
|
|
23
26
|
it "processes isodoc as ISO: alt HTML output" do
|
@@ -33,27 +36,34 @@ RSpec.describe IsoDoc::Iso do
|
|
33
36
|
</iso-standard>
|
34
37
|
INPUT
|
35
38
|
html = File.read("test.html", encoding: "utf-8")
|
36
|
-
expect(html)
|
37
|
-
|
38
|
-
expect(html)
|
39
|
+
expect(html)
|
40
|
+
.to match(%r[\bpre[^{]+\{[^{]+font-family: "Space Mono", monospace;]m)
|
41
|
+
expect(html)
|
42
|
+
.to match(%r[blockquote[^{]+\{[^{]+font-family: "Lato", sans-serif;]m)
|
43
|
+
expect(html)
|
44
|
+
.to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Lato", sans-serif;]m)
|
39
45
|
end
|
40
46
|
|
41
47
|
it "processes isodoc as ISO: Chinese HTML output" do
|
42
|
-
IsoDoc::Iso::HtmlConvert.new(script: "Hans")
|
43
|
-
|
44
|
-
<
|
45
|
-
<
|
46
|
-
<
|
47
|
-
<
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
48
|
+
IsoDoc::Iso::HtmlConvert.new(script: "Hans")
|
49
|
+
.convert("test", <<~"INPUT", false)
|
50
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
51
|
+
<preface>
|
52
|
+
<foreword>
|
53
|
+
<note>
|
54
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
|
55
|
+
</note>
|
56
|
+
</foreword>
|
57
|
+
</preface>
|
58
|
+
</iso-standard>
|
59
|
+
INPUT
|
53
60
|
html = File.read("test.html", encoding: "utf-8")
|
54
|
-
expect(html)
|
55
|
-
|
56
|
-
expect(html)
|
61
|
+
expect(html)
|
62
|
+
.to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
|
63
|
+
expect(html)
|
64
|
+
.to match(%r[blockquote[^{]+\{[^{]+font-family: "Source Han Sans", serif;]m)
|
65
|
+
expect(html)
|
66
|
+
.to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Source Han Sans", sans-serif;]m)
|
57
67
|
end
|
58
68
|
|
59
69
|
it "processes isodoc as ISO: user nominated fonts" do
|
@@ -72,9 +82,12 @@ RSpec.describe IsoDoc::Iso do
|
|
72
82
|
</iso-standard>
|
73
83
|
INPUT
|
74
84
|
html = File.read("test.html", encoding: "utf-8")
|
75
|
-
expect(html)
|
76
|
-
|
77
|
-
expect(html)
|
85
|
+
expect(html)
|
86
|
+
.to match(%r[\bpre[^{]+\{[^{]+font-family: Andale Mono;]m)
|
87
|
+
expect(html)
|
88
|
+
.to match(%r[blockquote[^{]+\{[^{]+font-family: Zapf Chancery;]m)
|
89
|
+
expect(html)
|
90
|
+
.to match(%r[\.h2Annex[^{]+\{[^{]+font-family: Comic Sans;]m)
|
78
91
|
end
|
79
92
|
|
80
93
|
it "processes isodoc as ISO: Word output" do
|
@@ -90,9 +103,12 @@ RSpec.describe IsoDoc::Iso do
|
|
90
103
|
</iso-standard>
|
91
104
|
INPUT
|
92
105
|
html = File.read("test.doc", encoding: "utf-8")
|
93
|
-
expect(html)
|
94
|
-
|
95
|
-
expect(html)
|
106
|
+
expect(html)
|
107
|
+
.to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
|
108
|
+
expect(html)
|
109
|
+
.to match(%r[Quote[^{]+\{[^{]+font-family: "Cambria", serif;]m)
|
110
|
+
expect(html)
|
111
|
+
.to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Cambria", serif;]m)
|
96
112
|
end
|
97
113
|
|
98
114
|
it "does not include IEV in references" do
|
data/spec/metanorma/amd_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe Metanorma::ISO do
|
4
4
|
it "processes amendment sections" do
|
5
|
-
|
5
|
+
input = <<~INPUT
|
6
6
|
#{AMD_BLANK_HDR}
|
7
7
|
== Foreword
|
8
8
|
|
@@ -54,6 +54,7 @@ RSpec.describe Metanorma::ISO do
|
|
54
54
|
|
55
55
|
=== Bibliography Subsection
|
56
56
|
INPUT
|
57
|
+
output = <<~OUTPUT
|
57
58
|
#{BLANK_HDR.sub(%r{<doctype>article</doctype>}, '<doctype>amendment</doctype>')}
|
58
59
|
<sections>
|
59
60
|
<clause id="_" obligation="normative">
|
@@ -127,10 +128,12 @@ RSpec.describe Metanorma::ISO do
|
|
127
128
|
</annex>
|
128
129
|
</iso-standard>
|
129
130
|
OUTPUT
|
131
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
132
|
+
.to be_equivalent_to xmlpp(output)
|
130
133
|
end
|
131
134
|
|
132
135
|
it "processes default metadata, amendment" do
|
133
|
-
|
136
|
+
input = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
134
137
|
= Document title
|
135
138
|
Author
|
136
139
|
:docfile: test.adoc
|
@@ -182,7 +185,7 @@ RSpec.describe Metanorma::ISO do
|
|
182
185
|
:updates-document-type: international-standard
|
183
186
|
INPUT
|
184
187
|
|
185
|
-
|
188
|
+
output = <<~OUTPUT
|
186
189
|
<iso-standard type="semantic" version="#{Metanorma::ISO::VERSION}" xmlns="https://www.metanorma.org/ns/iso">
|
187
190
|
<bibdata type="standard">
|
188
191
|
<title format="text/plain" language="en" type="main">Introduction — Main Title — Title — Title Part — Mass fraction of
|
@@ -207,6 +210,7 @@ RSpec.describe Metanorma::ISO do
|
|
207
210
|
de transport
|
208
211
|
</title>
|
209
212
|
<docidentifier type="ISO">ISO 17301-1:2016/PreNP Amd 1</docidentifier>
|
213
|
+
<docidentifier type='iso-undated'>ISO 17301-1/PreNP Amd 1</docidentifier>
|
210
214
|
<docidentifier type="iso-with-lang">ISO 17301-1:2016/PreNP Amd 1(E)</docidentifier>
|
211
215
|
<docidentifier type="iso-reference">ISO 17301-1:2016/PreNP Amd 1:2017(E)</docidentifier>
|
212
216
|
<docnumber>17301</docnumber>
|
@@ -278,10 +282,12 @@ RSpec.describe Metanorma::ISO do
|
|
278
282
|
<sections/>
|
279
283
|
</iso-standard>
|
280
284
|
OUTPUT
|
285
|
+
expect(xmlpp(input.sub(%r{<boilerplate>.*</boilerplate>}m, "")))
|
286
|
+
.to be_equivalent_to xmlpp(output)
|
281
287
|
end
|
282
288
|
|
283
289
|
it "processes metadata, amendment, stage 30" do
|
284
|
-
|
290
|
+
input = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
285
291
|
= Document title
|
286
292
|
Author
|
287
293
|
:docfile: test.adoc
|
@@ -295,11 +301,11 @@ RSpec.describe Metanorma::ISO do
|
|
295
301
|
:updates: ISO 17301-1:2030
|
296
302
|
:amendment-number: 1
|
297
303
|
INPUT
|
298
|
-
|
299
|
-
|
304
|
+
output = <<~OUTPUT
|
300
305
|
<iso-standard type="semantic" version="#{Metanorma::ISO::VERSION}" xmlns="https://www.metanorma.org/ns/iso">
|
301
306
|
<bibdata type="standard">
|
302
307
|
<docidentifier type="ISO">ISO 17301-1:2030/CD Amd 1</docidentifier>
|
308
|
+
<docidentifier type='iso-undated'>ISO 17301-1/CD Amd 1</docidentifier>
|
303
309
|
<docidentifier type="iso-with-lang">ISO 17301-1:2030/CD Amd 1(E)</docidentifier>
|
304
310
|
<docidentifier type="iso-reference">ISO 17301-1:2030/CD Amd 1(E)</docidentifier>
|
305
311
|
<docnumber>17301</docnumber>
|
@@ -348,10 +354,12 @@ RSpec.describe Metanorma::ISO do
|
|
348
354
|
<sections/>
|
349
355
|
</iso-standard>
|
350
356
|
OUTPUT
|
357
|
+
expect(xmlpp(input.sub(%r{<boilerplate>.*</boilerplate>}m, "")))
|
358
|
+
.to be_equivalent_to xmlpp(output)
|
351
359
|
end
|
352
360
|
|
353
361
|
it "processes metadata, amendment, stage 40" do
|
354
|
-
|
362
|
+
input = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
355
363
|
= Document title
|
356
364
|
Author
|
357
365
|
:docfile: test.adoc
|
@@ -365,10 +373,11 @@ RSpec.describe Metanorma::ISO do
|
|
365
373
|
:updates: ISO 17301-1:2030
|
366
374
|
:amendment-number: 1
|
367
375
|
INPUT
|
368
|
-
|
376
|
+
output = <<~OUTPUT
|
369
377
|
<iso-standard type="semantic" version="#{Metanorma::ISO::VERSION}" xmlns="https://www.metanorma.org/ns/iso">
|
370
378
|
<bibdata type="standard">
|
371
379
|
<docidentifier type="ISO">ISO 17301-1:2030/DAmd 1</docidentifier>
|
380
|
+
<docidentifier type='iso-undated'>ISO 17301-1/DAmd 1</docidentifier>
|
372
381
|
<docidentifier type="iso-with-lang">ISO 17301-1:2030/DAmd 1(E)</docidentifier>
|
373
382
|
<docidentifier type="iso-reference">ISO 17301-1:2030/DAmd 1(E)</docidentifier>
|
374
383
|
<docnumber>17301</docnumber>
|
@@ -417,10 +426,12 @@ RSpec.describe Metanorma::ISO do
|
|
417
426
|
<sections/>
|
418
427
|
</iso-standard>
|
419
428
|
OUTPUT
|
429
|
+
expect(xmlpp(input.sub(%r{<boilerplate>.*</boilerplate>}m, "")))
|
430
|
+
.to be_equivalent_to xmlpp(output)
|
420
431
|
end
|
421
432
|
|
422
433
|
it "processes metadata, amendment, published" do
|
423
|
-
|
434
|
+
input = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
424
435
|
= Document title
|
425
436
|
Author
|
426
437
|
:docfile: test.adoc
|
@@ -433,10 +444,11 @@ RSpec.describe Metanorma::ISO do
|
|
433
444
|
:updates: ISO 17301-1:2030
|
434
445
|
:amendment-number: 1
|
435
446
|
INPUT
|
436
|
-
|
447
|
+
output = <<~OUTPUT
|
437
448
|
<iso-standard type="semantic" version="#{Metanorma::ISO::VERSION}" xmlns="https://www.metanorma.org/ns/iso">
|
438
449
|
<bibdata type="standard">
|
439
450
|
<docidentifier type="ISO">ISO 17301-1:2030/Amd 1</docidentifier>
|
451
|
+
<docidentifier type='iso-undated'>ISO 17301-1/Amd 1</docidentifier>
|
440
452
|
<docidentifier type="iso-with-lang">ISO 17301-1:2030/Amd 1(E)</docidentifier>
|
441
453
|
<docidentifier type="iso-reference">ISO 17301-1:2030/Amd 1(E)</docidentifier>
|
442
454
|
<docnumber>17301</docnumber>
|
@@ -485,10 +497,12 @@ RSpec.describe Metanorma::ISO do
|
|
485
497
|
<sections/>
|
486
498
|
</iso-standard>
|
487
499
|
OUTPUT
|
500
|
+
expect(xmlpp(input.sub(%r{<boilerplate>.*</boilerplate>}m, "")))
|
501
|
+
.to be_equivalent_to xmlpp(output)
|
488
502
|
end
|
489
503
|
|
490
504
|
it "processes metadata, corrigendum, stage 30" do
|
491
|
-
|
505
|
+
input = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
492
506
|
= Document title
|
493
507
|
Author
|
494
508
|
:docfile: test.adoc
|
@@ -502,10 +516,11 @@ RSpec.describe Metanorma::ISO do
|
|
502
516
|
:updates: ISO 17301-1:2030
|
503
517
|
:corrigendum-number: 3
|
504
518
|
INPUT
|
505
|
-
|
519
|
+
output = <<~OUTPUT
|
506
520
|
<iso-standard type="semantic" version="#{Metanorma::ISO::VERSION}" xmlns="https://www.metanorma.org/ns/iso">
|
507
521
|
<bibdata type="standard">
|
508
522
|
<docidentifier type="ISO">ISO 17301-1:2030/CD Cor.3</docidentifier>
|
523
|
+
<docidentifier type='iso-undated'>ISO 17301-1/CD Cor.3</docidentifier>
|
509
524
|
<docidentifier type="iso-with-lang">ISO 17301-1:2030/CD Cor.3(E)</docidentifier>
|
510
525
|
<docidentifier type="iso-reference">ISO 17301-1:2030/CD Cor.3(E)</docidentifier>
|
511
526
|
<docnumber>17301</docnumber>
|
@@ -554,10 +569,12 @@ RSpec.describe Metanorma::ISO do
|
|
554
569
|
<sections/>
|
555
570
|
</iso-standard>
|
556
571
|
OUTPUT
|
572
|
+
expect(xmlpp(input.sub(%r{<boilerplate>.*</boilerplate>}m, "")))
|
573
|
+
.to be_equivalent_to xmlpp(output)
|
557
574
|
end
|
558
575
|
|
559
576
|
it "processes metadata, corrigendum, stage 50" do
|
560
|
-
|
577
|
+
input = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
561
578
|
= Document title
|
562
579
|
Author
|
563
580
|
:docfile: test.adoc
|
@@ -571,10 +588,11 @@ RSpec.describe Metanorma::ISO do
|
|
571
588
|
:updates: ISO 17301-1:2030
|
572
589
|
:corrigendum-number: 3
|
573
590
|
INPUT
|
574
|
-
|
591
|
+
output = <<~OUTPUT
|
575
592
|
<iso-standard xmlns='https://www.metanorma.org/ns/iso' type="semantic" version="#{Metanorma::ISO::VERSION}">
|
576
593
|
<bibdata type='standard'>
|
577
594
|
<docidentifier type='ISO'>ISO 17301-1:2030/FDCor.3</docidentifier>
|
595
|
+
<docidentifier type='iso-undated'>ISO 17301-1/FDCor.3</docidentifier>
|
578
596
|
<docidentifier type='iso-with-lang'>ISO 17301-1:2030/FDCor.3(E)</docidentifier>
|
579
597
|
<docidentifier type='iso-reference'>ISO 17301-1:2030/FDCor.3(E)</docidentifier>
|
580
598
|
<docnumber>17301</docnumber>
|
@@ -623,10 +641,12 @@ RSpec.describe Metanorma::ISO do
|
|
623
641
|
<sections/>
|
624
642
|
</iso-standard>
|
625
643
|
OUTPUT
|
644
|
+
expect(xmlpp(input.sub(%r{<boilerplate>.*</boilerplate>}m, "")))
|
645
|
+
.to be_equivalent_to xmlpp(output)
|
626
646
|
end
|
627
647
|
|
628
648
|
it "processes metadata, corrigendum, published" do
|
629
|
-
|
649
|
+
input = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
630
650
|
= Document title
|
631
651
|
Author
|
632
652
|
:docfile: test.adoc
|
@@ -639,10 +659,11 @@ RSpec.describe Metanorma::ISO do
|
|
639
659
|
:updates: ISO 17301-1:2030
|
640
660
|
:corrigendum-number: 3
|
641
661
|
INPUT
|
642
|
-
|
662
|
+
output = <<~OUTPUT
|
643
663
|
<iso-standard type="semantic" version="#{Metanorma::ISO::VERSION}" xmlns="https://www.metanorma.org/ns/iso">
|
644
664
|
<bibdata type="standard">
|
645
665
|
<docidentifier type="ISO">ISO 17301-1:2030/Cor.3</docidentifier>
|
666
|
+
<docidentifier type='iso-undated'>ISO 17301-1/Cor.3</docidentifier>
|
646
667
|
<docidentifier type="iso-with-lang">ISO 17301-1:2030/Cor.3(E)</docidentifier>
|
647
668
|
<docidentifier type="iso-reference">ISO 17301-1:2030/Cor.3(E)</docidentifier>
|
648
669
|
<docnumber>17301</docnumber>
|
@@ -691,5 +712,7 @@ RSpec.describe Metanorma::ISO do
|
|
691
712
|
<sections/>
|
692
713
|
</iso-standard>
|
693
714
|
OUTPUT
|
715
|
+
expect(xmlpp(input.sub(%r{<boilerplate>.*</boilerplate>}m, "")))
|
716
|
+
.to be_equivalent_to xmlpp(output)
|
694
717
|
end
|
695
718
|
end
|