metanorma-iso 2.0.3 → 2.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/isodoc/iso/html/header.html +42 -33
- data/lib/isodoc/iso/html/html_iso_titlepage.html +1 -1
- data/lib/isodoc/iso/html/isodoc.css +9 -7
- data/lib/isodoc/iso/html/isodoc.scss +7 -5
- data/lib/isodoc/iso/html/style-human.css +0 -1
- data/lib/isodoc/iso/html/style-human.scss +0 -1
- data/lib/isodoc/iso/html/style-iso.css +0 -1
- data/lib/isodoc/iso/html/style-iso.scss +0 -1
- data/lib/isodoc/iso/html/word_iso_titlepage.html +12 -11
- data/lib/isodoc/iso/html/wordstyle.css +46 -19
- data/lib/isodoc/iso/html/wordstyle.scss +52 -25
- data/lib/isodoc/iso/i18n-en.yaml +29 -2
- data/lib/isodoc/iso/i18n-fr.yaml +27 -3
- data/lib/isodoc/iso/i18n-ru.yaml +45 -0
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +27 -3
- data/lib/isodoc/iso/i18n.rb +1 -0
- data/lib/isodoc/iso/init.rb +1 -2
- data/lib/isodoc/iso/iso.amendment.xsl +1204 -615
- data/lib/isodoc/iso/iso.international-standard.xsl +1204 -615
- data/lib/isodoc/iso/metadata.rb +12 -2
- data/lib/isodoc/iso/presentation_xml_convert.rb +58 -21
- data/lib/metanorma/iso/boilerplate-fr.xml +6 -7
- data/lib/metanorma/iso/boilerplate-ru.xml +37 -0
- data/lib/metanorma/iso/boilerplate.xml +6 -7
- data/lib/metanorma/iso/cleanup.rb +48 -11
- data/lib/metanorma/iso/front.rb +1 -1
- data/lib/metanorma/iso/front_id.rb +2 -0
- data/lib/metanorma/iso/isodoc.rng +73 -3
- data/lib/metanorma/iso/processor.rb +14 -7
- data/lib/metanorma/iso/validate.rb +30 -2
- data/lib/metanorma/iso/validate_image.rb +3 -3
- data/lib/metanorma/iso/validate_list.rb +122 -0
- data/lib/metanorma/iso/validate_section.rb +39 -32
- data/lib/metanorma/iso/validate_style.rb +32 -2
- data/lib/metanorma/iso/validate_title.rb +13 -1
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +1 -1
- data/spec/isodoc/amd_spec.rb +10 -5
- data/spec/isodoc/i18n_spec.rb +350 -9
- data/spec/isodoc/inline_spec.rb +127 -10
- data/spec/isodoc/metadata_spec.rb +153 -3
- data/spec/isodoc/postproc_spec.rb +3 -4
- data/spec/isodoc/section_spec.rb +1 -0
- data/spec/isodoc/terms_spec.rb +4 -4
- data/spec/metanorma/base_spec.rb +434 -326
- data/spec/metanorma/cleanup_spec.rb +11 -11
- data/spec/metanorma/refs_spec.rb +273 -61
- data/spec/metanorma/section_spec.rb +18 -26
- data/spec/metanorma/validate_spec.rb +448 -17
- data/spec/spec_helper.rb +6 -4
- data/spec/vcr_cassettes/docrels.yml +393 -0
- data/spec/vcr_cassettes/withdrawn_iso.yml +301 -0
- metadata +10 -5
@@ -7,7 +7,7 @@ RSpec.describe IsoDoc::Iso::Metadata do
|
|
7
7
|
_ = c.convert_init(<<~"INPUT", "test", false)
|
8
8
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
9
9
|
INPUT
|
10
|
-
|
10
|
+
input = <<~INPUT
|
11
11
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
12
12
|
<bibdata type="standard">
|
13
13
|
<title format="text/plain" language="en" type="title-intro">Cereals and pulses</title>
|
@@ -90,6 +90,7 @@ RSpec.describe IsoDoc::Iso::Metadata do
|
|
90
90
|
</bibdata>
|
91
91
|
</iso-standard>
|
92
92
|
INPUT
|
93
|
+
output = <<~OUTPUT
|
93
94
|
{:accesseddate=>"2012",
|
94
95
|
:activateddate=>"2013",
|
95
96
|
:agency=>"ISO",
|
@@ -146,6 +147,8 @@ RSpec.describe IsoDoc::Iso::Metadata do
|
|
146
147
|
:vote_starteddate=>"XXX",
|
147
148
|
:wg=>"WG 3"}
|
148
149
|
OUTPUT
|
150
|
+
expect(metadata(c.info(Nokogiri::XML(input),
|
151
|
+
nil))).to be_equivalent_to output
|
149
152
|
end
|
150
153
|
|
151
154
|
it "processes IsoXML metadata #2" do
|
@@ -153,7 +156,7 @@ RSpec.describe IsoDoc::Iso::Metadata do
|
|
153
156
|
_ = c.convert_init(<<~"INPUT", "test", false)
|
154
157
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
155
158
|
INPUT
|
156
|
-
|
159
|
+
input = <<~INPUT
|
157
160
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
158
161
|
<bibdata type="standard">
|
159
162
|
<title>
|
@@ -225,6 +228,7 @@ RSpec.describe IsoDoc::Iso::Metadata do
|
|
225
228
|
</bibdata>
|
226
229
|
</iso-standard>
|
227
230
|
INPUT
|
231
|
+
output = <<~OUTPUT
|
228
232
|
{:accesseddate=>"XXX",
|
229
233
|
:agency=>"ISO/IEC",
|
230
234
|
:circulateddate=>"XXX",
|
@@ -274,6 +278,8 @@ RSpec.describe IsoDoc::Iso::Metadata do
|
|
274
278
|
:vote_starteddate=>"XXX",
|
275
279
|
:wg=>"GHI 3"}
|
276
280
|
OUTPUT
|
281
|
+
expect(metadata(c.info(Nokogiri::XML(input),
|
282
|
+
nil))).to be_equivalent_to output
|
277
283
|
end
|
278
284
|
|
279
285
|
it "processes IsoXML metadata in French" do
|
@@ -285,7 +291,7 @@ RSpec.describe IsoDoc::Iso::Metadata do
|
|
285
291
|
</bibdata>
|
286
292
|
</iso-standard>
|
287
293
|
INPUT
|
288
|
-
|
294
|
+
input = <<~INPUT
|
289
295
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
290
296
|
<bibdata type="standard">
|
291
297
|
<title>
|
@@ -358,6 +364,7 @@ RSpec.describe IsoDoc::Iso::Metadata do
|
|
358
364
|
</bibdata>
|
359
365
|
</iso-standard>
|
360
366
|
INPUT
|
367
|
+
output = <<~OUTPUT
|
361
368
|
{:accesseddate=>"XXX",
|
362
369
|
:agency=>"ISO/IEC",
|
363
370
|
:circulateddate=>"XXX",
|
@@ -407,5 +414,148 @@ RSpec.describe IsoDoc::Iso::Metadata do
|
|
407
414
|
:vote_starteddate=>"XXX",
|
408
415
|
:wg=>"GHI 3"}
|
409
416
|
OUTPUT
|
417
|
+
expect(metadata(c.info(Nokogiri::XML(input),
|
418
|
+
nil))).to be_equivalent_to output
|
419
|
+
end
|
420
|
+
|
421
|
+
it "processes IsoXML metadata in Russian" do
|
422
|
+
c = IsoDoc::Iso::HtmlConvert.new({})
|
423
|
+
_ = c.convert_init(<<~"INPUT", "test", false)
|
424
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
425
|
+
<bibdata>
|
426
|
+
<language>ru</language>
|
427
|
+
</bibdata>
|
428
|
+
</iso-standard>
|
429
|
+
INPUT
|
430
|
+
input = <<~INPUT
|
431
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
432
|
+
<bibdata type="standard">
|
433
|
+
<title>
|
434
|
+
<title type="title-intro" language="en" format="text/plain">Cereals and pulses</title>
|
435
|
+
<title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
|
436
|
+
<title type="title-part" language="en" format="text/plain">Rice</title>
|
437
|
+
</title>
|
438
|
+
<title>
|
439
|
+
<title type="title-intro" language="fr" format="text/plain">Céréales et légumineuses</title>
|
440
|
+
<title type="title-main" language="fr" format="text/plain">Spécification et méthodes d'essai</title>
|
441
|
+
<title type="title-part" language="fr" format="text/plain">Riz</title>
|
442
|
+
</title>
|
443
|
+
<title>
|
444
|
+
<title type="title-intro" language="ru" format="text/plain">Зерновые и бобовые</title>
|
445
|
+
<title type="title-main" language="ru" format="text/plain">Технические характеристики и методы испытаний</title>
|
446
|
+
<title type="title-part" language="ru" format="text/plain">Рис</title>
|
447
|
+
</title>
|
448
|
+
<docidentifier type="ISO">ISO/IEC/CD 17301-1-3</docidentifier>
|
449
|
+
<docidentifier type="iso-with-lang">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
|
450
|
+
<docidentifier type="iso-reference">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
|
451
|
+
<docidentifier type="iso-tc">17301</docidentifier>
|
452
|
+
<contributor>
|
453
|
+
<role type="author"/>
|
454
|
+
<organization>
|
455
|
+
<name>ISO</name>
|
456
|
+
</organization>
|
457
|
+
</contributor>
|
458
|
+
<contributor>
|
459
|
+
<role type="publisher"/>
|
460
|
+
<organization>
|
461
|
+
<name>International Organization for Standardization</name>
|
462
|
+
<abbreviation>ISO</abbreviation>
|
463
|
+
</organization>
|
464
|
+
</contributor>
|
465
|
+
<contributor>
|
466
|
+
<role type="publisher"/>
|
467
|
+
<organization>
|
468
|
+
<name>International Electrotechnical Commission</name>
|
469
|
+
<abbreviation>IEC</abbreviation>
|
470
|
+
</organization>
|
471
|
+
</contributor>
|
472
|
+
<language>ru</language>
|
473
|
+
<script>Cyrl</script>
|
474
|
+
<status>
|
475
|
+
<stage abbreviation="IS">60</stage>
|
476
|
+
<substage>92</substage>
|
477
|
+
</status>
|
478
|
+
<copyright>
|
479
|
+
<from>2016</from>
|
480
|
+
<owner>
|
481
|
+
<organization>
|
482
|
+
<name>International Organization for Standardization</name>
|
483
|
+
</organization>
|
484
|
+
</owner>
|
485
|
+
</copyright>
|
486
|
+
<relation type="obsoletes">
|
487
|
+
<locality type="clause"><referenceFrom>3.1</referenceFrom></locality>
|
488
|
+
<docidentifier>IEC 8121</docidentifier>
|
489
|
+
</relation>
|
490
|
+
<ext>
|
491
|
+
<doctype language="">international-standard</doctype>
|
492
|
+
<doctype language="fr">Standard International</doctype>
|
493
|
+
<editorialgroup>
|
494
|
+
<technical-committee number="34" type="ABC">Food products</technical-committee>
|
495
|
+
<subcommittee number="4" type="DEF">Cereals and pulses</subcommittee>
|
496
|
+
<workgroup number="3" type="GHI">Rice Group</workgroup>
|
497
|
+
</editorialgroup>
|
498
|
+
<ics><code>1.2.3</code></ics>
|
499
|
+
<ics><code>1.2.3</code></ics>
|
500
|
+
<structuredidentifier>
|
501
|
+
<project-number part="1" subpart="3">ISO/IEC/CD 17301</project-number>
|
502
|
+
</strucuredidentifier>
|
503
|
+
<stagename>International standard</stagename>
|
504
|
+
</ext>
|
505
|
+
</bibdata>
|
506
|
+
</iso-standard>
|
507
|
+
INPUT
|
508
|
+
output = <<~OUTPUT
|
509
|
+
{:accesseddate=>"XXX",
|
510
|
+
:agency=>"ISO/IEC",
|
511
|
+
:circulateddate=>"XXX",
|
512
|
+
:confirmeddate=>"XXX",
|
513
|
+
:copieddate=>"XXX",
|
514
|
+
:createddate=>"XXX",
|
515
|
+
:docnumber=>"ISO/IEC/CD 17301-1-3",
|
516
|
+
:docnumber_lang=>"ISO/IEC/CD 17301-1-3 (E)",
|
517
|
+
:docnumber_reference=>"ISO/IEC/CD 17301-1-3 (E)",
|
518
|
+
:docsubtitle=>"Cereals and pulses — Specifications and test methods — Part 1–3: Rice",
|
519
|
+
:docsubtitleintro=>"Cereals and pulses",
|
520
|
+
:docsubtitlemain=>"Specifications and test methods",
|
521
|
+
:docsubtitlepart=>"Rice",
|
522
|
+
:docsubtitlepartlabel=>"Part 1–3",
|
523
|
+
:doctitle=>"Зерновые и бобовые — Технические характеристики и методы испытаний — Часть 1–3: Рис",
|
524
|
+
:doctitleintro=>"Зерновые и бобовые",
|
525
|
+
:doctitlemain=>"Технические характеристики и методы испытаний",
|
526
|
+
:doctitlepart=>"Рис",
|
527
|
+
:doctitlepartlabel=>"Часть 1–3",
|
528
|
+
:doctype=>"International Standard",
|
529
|
+
:doctype_display=>"International Standard",
|
530
|
+
:docyear=>"2016",
|
531
|
+
:editorialgroup=>["ABC 34", "DEF 4", "GHI 3"],
|
532
|
+
:ics=>"1.2.3, 1.2.3",
|
533
|
+
:implementeddate=>"XXX",
|
534
|
+
:issueddate=>"XXX",
|
535
|
+
:lang=>"ru",
|
536
|
+
:obsoleteddate=>"XXX",
|
537
|
+
:obsoletes=>"IEC 8121",
|
538
|
+
:obsoletes_part=>"3.1",
|
539
|
+
:publisheddate=>"XXX",
|
540
|
+
:publisher=>"International Organization for Standardization и International Electrotechnical Commission",
|
541
|
+
:receiveddate=>"XXX",
|
542
|
+
:sc=>"DEF 4",
|
543
|
+
:script=>"Latn",
|
544
|
+
:secretariat=>"XXX",
|
545
|
+
:stage=>"60",
|
546
|
+
:stage_int=>60,
|
547
|
+
:statusabbr=>"IS",
|
548
|
+
:tc=>"ABC 34",
|
549
|
+
:tc_docnumber=>["17301"],
|
550
|
+
:transmitteddate=>"XXX",
|
551
|
+
:unchangeddate=>"XXX",
|
552
|
+
:unpublished=>false,
|
553
|
+
:updateddate=>"XXX",
|
554
|
+
:vote_endeddate=>"XXX",
|
555
|
+
:vote_starteddate=>"XXX",
|
556
|
+
:wg=>"GHI 3"}
|
557
|
+
OUTPUT
|
558
|
+
expect(metadata(c.info(Nokogiri::XML(input),
|
559
|
+
nil))).to be_equivalent_to output
|
410
560
|
end
|
411
561
|
end
|
@@ -222,7 +222,7 @@ RSpec.describe IsoDoc do
|
|
222
222
|
.sub(%r{<br[^>]*>\s*<div class="colophon".*$}m, "")
|
223
223
|
|
224
224
|
expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
225
|
-
|
225
|
+
<div class='WordSection3'>
|
226
226
|
<p class='zzSTDTitle1'/>
|
227
227
|
<div>
|
228
228
|
<a name='_terms_and_definitions' id='_terms_and_definitions'/>
|
@@ -241,9 +241,7 @@ RSpec.describe IsoDoc do
|
|
241
241
|
rice retaining its husk after threshing
|
242
242
|
</p>
|
243
243
|
<p class='Source'>
|
244
|
-
[SOURCE:
|
245
|
-
<a href='#ISO7301'>ISO 7301:2011, 3.1</a>
|
246
|
-
, modified – The term "cargo rice" is shown as deprecated, and Note
|
244
|
+
[SOURCE: ISO 7301:2011, 3.1, modified – The term "cargo rice" is shown as deprecated, and Note
|
247
245
|
1 to entry is not included here]
|
248
246
|
</p>
|
249
247
|
</div>
|
@@ -875,6 +873,7 @@ RSpec.describe IsoDoc do
|
|
875
873
|
<bibdata type="standard">
|
876
874
|
<status>
|
877
875
|
<stage language="">30</stage>
|
876
|
+
<stage language='en'>Committee draft</stage>
|
878
877
|
</status>
|
879
878
|
</bibdata>
|
880
879
|
<boilerplate>
|
data/spec/isodoc/section_spec.rb
CHANGED
@@ -562,6 +562,7 @@ RSpec.describe IsoDoc do
|
|
562
562
|
<script current='true'>Latn</script>
|
563
563
|
<status>
|
564
564
|
<stage abbreviation='IS' language=''>60</stage>
|
565
|
+
<stage abbreviation='IS' language='en'>International standard</stage>
|
565
566
|
<substage language=''>60</substage>
|
566
567
|
</status>
|
567
568
|
<copyright>
|
data/spec/isodoc/terms_spec.rb
CHANGED
@@ -161,7 +161,7 @@ RSpec.describe IsoDoc do
|
|
161
161
|
</ul>
|
162
162
|
</div>
|
163
163
|
<p>[SOURCE:
|
164
|
-
|
164
|
+
ISO 7301:2011, 3.1, modified –
|
165
165
|
The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p>
|
166
166
|
<p class="TermNum" id="paddy">1.2</p>
|
167
167
|
<p class="Terms" style="text-align:left;"><b>paddy</b></p>
|
@@ -187,7 +187,7 @@ RSpec.describe IsoDoc do
|
|
187
187
|
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
|
188
188
|
</p>
|
189
189
|
</div>
|
190
|
-
<p>[SOURCE:
|
190
|
+
<p>[SOURCE: ISO 7301:2011, 3.1]</p>
|
191
191
|
<p class='TermNum' id='A'>1.3</p>
|
192
192
|
<p class='Terms' style='text-align:left;'><b>term1</b></p>
|
193
193
|
term1 definition
|
@@ -213,7 +213,7 @@ RSpec.describe IsoDoc do
|
|
213
213
|
</ul></div>
|
214
214
|
|
215
215
|
<p class="Source">[SOURCE:
|
216
|
-
|
216
|
+
ISO 7301:2011, 3.1, modified –
|
217
217
|
The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p>
|
218
218
|
<p class="TermNum" id="paddy">1.2</p>
|
219
219
|
<p class="Terms" style="text-align:left;"><b>paddy</b></p>
|
@@ -228,7 +228,7 @@ RSpec.describe IsoDoc do
|
|
228
228
|
</div>
|
229
229
|
<div id='_671a1994-4783-40d0-bc81-987d06ffb74e' class="Note"><p class="Note">Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
|
230
230
|
<div id='_671a1994-4783-40d0-bc81-987d06ffb74f' class="Note"><p class="Note">Note 2 to entry: <ul><li>A</li></ul><p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></p></div>
|
231
|
-
<p class="Source">[SOURCE:
|
231
|
+
<p class="Source">[SOURCE: ISO 7301:2011, 3.1]</p>
|
232
232
|
<p class='TermNum' id='A'>1.3</p>
|
233
233
|
<p class='Terms' style='text-align:left;'><b>term1</b></p>
|
234
234
|
term1 definition
|