metanorma-iso 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/html2doc/lists.rb +142 -10
- data/lib/isodoc/iso/base_convert.rb +10 -0
- data/lib/isodoc/iso/html/html_iso_titlepage.html +2 -0
- data/lib/isodoc/iso/html/isodoc-dis.css +170 -252
- data/lib/isodoc/iso/html/isodoc-dis.scss +170 -245
- data/lib/isodoc/iso/html/isodoc.css +38 -13
- data/lib/isodoc/iso/html/isodoc.scss +38 -12
- data/lib/isodoc/iso/html/style-human.css +14 -1
- data/lib/isodoc/iso/html/style-human.scss +10 -1
- data/lib/isodoc/iso/html/style-iso.css +35 -23
- data/lib/isodoc/iso/html/style-iso.scss +31 -23
- data/lib/isodoc/iso/html/word_iso_intro-dis.html +1 -6
- data/lib/isodoc/iso/html/word_iso_titlepage-dis.html +24 -13
- data/lib/isodoc/iso/html/word_iso_titlepage-prf.html +58 -0
- data/lib/isodoc/iso/html/word_iso_titlepage.html +6 -2
- data/lib/isodoc/iso/html_convert.rb +5 -0
- data/lib/isodoc/iso/i18n-en.yaml +32 -4
- data/lib/isodoc/iso/i18n-fr.yaml +29 -3
- data/lib/isodoc/iso/i18n-ru.yaml +32 -4
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +32 -3
- data/lib/isodoc/iso/i18n.rb +1 -1
- data/lib/isodoc/iso/iso.amendment.xsl +332 -187
- data/lib/isodoc/iso/iso.international-standard.xsl +332 -187
- data/lib/isodoc/iso/metadata.rb +63 -63
- data/lib/isodoc/iso/presentation_bibdata.rb +74 -0
- data/lib/isodoc/iso/presentation_xml_convert.rb +14 -3
- data/lib/isodoc/iso/presentation_xref.rb +8 -2
- data/lib/isodoc/iso/sections.rb +1 -1
- data/lib/isodoc/iso/word_cleanup.rb +3 -0
- data/lib/isodoc/iso/word_convert.rb +6 -3
- data/lib/isodoc/iso/word_dis_cleanup.rb +235 -0
- data/lib/isodoc/iso/word_dis_convert.rb +47 -108
- data/lib/isodoc/iso/xref.rb +34 -6
- data/lib/metanorma/iso/base.rb +20 -1
- data/lib/metanorma/iso/biblio.rng +32 -34
- data/lib/metanorma/iso/boilerplate-fr.xml +3 -0
- data/lib/metanorma/iso/boilerplate-ru.xml +3 -0
- data/lib/metanorma/iso/boilerplate.xml +3 -0
- data/lib/metanorma/iso/cleanup.rb +28 -1
- data/lib/metanorma/iso/front.rb +31 -6
- data/lib/metanorma/iso/front_id.rb +2 -0
- data/lib/metanorma/iso/isodoc.rng +9 -0
- data/lib/metanorma/iso/isostandard.rng +30 -12
- data/lib/metanorma/iso/macros.rb +29 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/spec/isodoc/amd_spec.rb +4 -30
- data/spec/isodoc/blocks_spec.rb +499 -2
- data/spec/isodoc/i18n_spec.rb +145 -80
- data/spec/isodoc/iso_spec.rb +50 -169
- data/spec/isodoc/metadata_spec.rb +224 -83
- data/spec/isodoc/postproc_spec.rb +41 -5
- data/spec/isodoc/section_spec.rb +12 -6
- data/spec/isodoc/word_dis_spec.rb +1273 -147
- data/spec/isodoc/xref_spec.rb +87 -13
- data/spec/metanorma/amd_spec.rb +53 -1
- data/spec/metanorma/base_spec.rb +185 -10
- data/spec/metanorma/blocks_spec.rb +54 -0
- data/spec/metanorma/lists_spec.rb +2 -2
- data/spec/metanorma/section_spec.rb +2 -2
- data/spec/spec_helper.rb +13 -4
- data/spec/vcr_cassettes/withdrawn_iso.yml +27 -27
- metadata +7 -8
- data/docs/asciiiso-syntax.adoc +0 -307
- data/docs/guidance.adoc +0 -487
- data/docs/navigation.adoc +0 -23
- data/docs/quickstart.adoc +0 -179
- data/lib/isodoc/iso/presentation_inline.rb +0 -90
data/spec/isodoc/xref_spec.rb
CHANGED
@@ -153,7 +153,7 @@ RSpec.describe IsoDoc do
|
|
153
153
|
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
154
154
|
end
|
155
155
|
|
156
|
-
it "cross-references figures
|
156
|
+
it "cross-references figures" do
|
157
157
|
input = <<~INPUT
|
158
158
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
159
159
|
<preface>
|
@@ -299,7 +299,7 @@ RSpec.describe IsoDoc do
|
|
299
299
|
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
300
300
|
end
|
301
301
|
|
302
|
-
it "cross-references subfigures
|
302
|
+
it "cross-references subfigures" do
|
303
303
|
input = <<~INPUT
|
304
304
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
305
305
|
<preface>
|
@@ -1501,12 +1501,12 @@ RSpec.describe IsoDoc do
|
|
1501
1501
|
<preface>
|
1502
1502
|
<foreword displayorder='1'>
|
1503
1503
|
<p>
|
1504
|
-
<xref target='N'>
|
1505
|
-
<xref target='note1'>3.1 List 1 a)</xref>
|
1506
|
-
<xref target='note2'>3.1 List 2 a)</xref>
|
1504
|
+
<xref target='N'>1 a)</xref>
|
1505
|
+
<xref target='note1'>3.1, List 1 a)</xref>
|
1506
|
+
<xref target='note2'>3.1, List 2 a)</xref>
|
1507
1507
|
<xref target='AN'>A.1 a)</xref>
|
1508
|
-
<xref target='Anote1'>A.2 List 1 a)</xref>
|
1509
|
-
<xref target='Anote2'>A.2 List 2 a)</xref>
|
1508
|
+
<xref target='Anote1'>A.2, List 1 a)</xref>
|
1509
|
+
<xref target='Anote2'>A.2, List 2 a)</xref>
|
1510
1510
|
</p>
|
1511
1511
|
</foreword>
|
1512
1512
|
</preface>
|
@@ -1621,12 +1621,12 @@ RSpec.describe IsoDoc do
|
|
1621
1621
|
<preface>
|
1622
1622
|
<foreword displayorder='1'>
|
1623
1623
|
<p>
|
1624
|
-
<xref target='N'>
|
1625
|
-
<xref target='note1'>
|
1626
|
-
<xref target='note2'>
|
1627
|
-
<xref target='AN'>
|
1628
|
-
<xref target='Anote1'>
|
1629
|
-
<xref target='Anote2'>
|
1624
|
+
<xref target='N'>1 a)</xref>
|
1625
|
+
<xref target='note1'>1 a) 1)</xref>
|
1626
|
+
<xref target='note2'>1 a) 1) i)</xref>
|
1627
|
+
<xref target='AN'>1 a) 1) i) A)</xref>
|
1628
|
+
<xref target='Anote1'>1 a) 1) i) A) I)</xref>
|
1629
|
+
<xref target='Anote2'>1 a) 1) i) A) I) a)</xref>
|
1630
1630
|
</p>
|
1631
1631
|
</foreword>
|
1632
1632
|
</preface>
|
@@ -1670,4 +1670,78 @@ RSpec.describe IsoDoc do
|
|
1670
1670
|
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
|
1671
1671
|
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
1672
1672
|
end
|
1673
|
+
|
1674
|
+
it "conflates cross-references to a split list" do
|
1675
|
+
input = <<~INPUT
|
1676
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1677
|
+
<preface>
|
1678
|
+
<foreword>
|
1679
|
+
<p><xref target="Na"/></p>
|
1680
|
+
</foreword>
|
1681
|
+
</preface>
|
1682
|
+
<sections>
|
1683
|
+
<clause id="scope" type="scope">
|
1684
|
+
<title>Scope</title>
|
1685
|
+
<ol id="N1">
|
1686
|
+
<li id="Na"><p>A</p></li>
|
1687
|
+
<li id="Na1"><p>A</p></li>
|
1688
|
+
</ol>
|
1689
|
+
<ol id="N2" start="3">
|
1690
|
+
<li id="Nb"><p>A</p></li>
|
1691
|
+
<li id="Nb1"><p>A</p></li>
|
1692
|
+
</ol>
|
1693
|
+
<ol id="N3" start="5">
|
1694
|
+
<li id="Nc"><p>A</p></li>
|
1695
|
+
<li id="Nc1"><p>A</p></li>
|
1696
|
+
</ol>
|
1697
|
+
</clause>
|
1698
|
+
</sections>
|
1699
|
+
</iso-standard>
|
1700
|
+
INPUT
|
1701
|
+
output = <<~OUTPUT
|
1702
|
+
<foreword displayorder='1'>
|
1703
|
+
<p><xref target='Na'>1 a)</xref></p>
|
1704
|
+
</foreword>
|
1705
|
+
OUTPUT
|
1706
|
+
expect(xmlpp(Nokogiri::XML(IsoDoc::Iso::PresentationXMLConvert.new({})
|
1707
|
+
.convert("test", input, true))
|
1708
|
+
.at("//xmlns:foreword").to_xml))
|
1709
|
+
.to be_equivalent_to xmlpp(output)
|
1710
|
+
|
1711
|
+
input = <<~INPUT
|
1712
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1713
|
+
<preface>
|
1714
|
+
<foreword>
|
1715
|
+
<p><xref target="Na"/></p>
|
1716
|
+
</foreword>
|
1717
|
+
</preface>
|
1718
|
+
<sections>
|
1719
|
+
<clause id="scope" type="scope">
|
1720
|
+
<title>Scope</title>
|
1721
|
+
<ol id="N1">
|
1722
|
+
<li id="Na"><p>A</p></li>
|
1723
|
+
<li id="Na1"><p>A</p></li>
|
1724
|
+
</ol>
|
1725
|
+
<ol id="N2" start="3">
|
1726
|
+
<li id="Nb"><p>A</p></li>
|
1727
|
+
<li id="Nb1"><p>A</p></li>
|
1728
|
+
</ol>
|
1729
|
+
<ol id="N3" start="6">
|
1730
|
+
<li id="Nc"><p>A</p></li>
|
1731
|
+
<li id="Nc1"><p>A</p></li>
|
1732
|
+
</ol>
|
1733
|
+
</clause>
|
1734
|
+
</sections>
|
1735
|
+
</iso-standard>
|
1736
|
+
INPUT
|
1737
|
+
output = <<~OUTPUT
|
1738
|
+
<foreword displayorder='1'>
|
1739
|
+
<p><xref target='Na'>Clause 1, List 1 a)</xref></p>
|
1740
|
+
</foreword>
|
1741
|
+
OUTPUT
|
1742
|
+
expect(xmlpp(Nokogiri::XML(IsoDoc::Iso::PresentationXMLConvert.new({})
|
1743
|
+
.convert("test", input, true))
|
1744
|
+
.at("//xmlns:foreword").to_xml))
|
1745
|
+
.to be_equivalent_to xmlpp(output)
|
1746
|
+
end
|
1673
1747
|
end
|
data/spec/metanorma/amd_spec.rb
CHANGED
@@ -55,7 +55,7 @@ RSpec.describe Metanorma::ISO do
|
|
55
55
|
=== Bibliography Subsection
|
56
56
|
INPUT
|
57
57
|
output = <<~OUTPUT
|
58
|
-
#{BLANK_HDR.sub(%r{<doctype>
|
58
|
+
#{BLANK_HDR.sub(%r{<doctype>standard</doctype>}, '<doctype>amendment</doctype>')}
|
59
59
|
<sections>
|
60
60
|
<clause id="_" obligation="normative">
|
61
61
|
<title>Foreword</title>
|
@@ -255,6 +255,7 @@ RSpec.describe Metanorma::ISO do
|
|
255
255
|
<ext>
|
256
256
|
<doctype>amendment</doctype>
|
257
257
|
<editorialgroup>
|
258
|
+
<agency>ISO</agency>
|
258
259
|
<technical-committee number="1" type="A">TC</technical-committee>
|
259
260
|
<technical-committee number="11" type="A1">TC1</technical-committee>
|
260
261
|
<subcommittee number="2" type="B">SC</subcommittee>
|
@@ -263,6 +264,15 @@ RSpec.describe Metanorma::ISO do
|
|
263
264
|
<workgroup number="31" type="C1">WG1</workgroup>
|
264
265
|
<secretariat>SECRETARIAT</secretariat>
|
265
266
|
</editorialgroup>
|
267
|
+
<approvalgroup>
|
268
|
+
<agency>ISO</agency>
|
269
|
+
<technical-committee number="1" type="A">TC</technical-committee>
|
270
|
+
<technical-committee number="11" type="A1">TC1</technical-committee>
|
271
|
+
<subcommittee number="2" type="B">SC</subcommittee>
|
272
|
+
<subcommittee number="21" type="B1">SC1</subcommittee>
|
273
|
+
<workgroup number="3" type="C">WG</workgroup>
|
274
|
+
<workgroup number="31" type="C1">WG1</workgroup>
|
275
|
+
</approvalgroup>
|
266
276
|
<ics>
|
267
277
|
<code>1</code>
|
268
278
|
</ics>
|
@@ -341,10 +351,17 @@ RSpec.describe Metanorma::ISO do
|
|
341
351
|
<ext>
|
342
352
|
<doctype>amendment</doctype>
|
343
353
|
<editorialgroup>
|
354
|
+
<agency>ISO</agency>
|
344
355
|
<technical-committee/>
|
345
356
|
<subcommittee/>
|
346
357
|
<workgroup/>
|
347
358
|
</editorialgroup>
|
359
|
+
<approvalgroup>
|
360
|
+
<agency>ISO</agency>
|
361
|
+
<technical-committee/>
|
362
|
+
<subcommittee/>
|
363
|
+
<workgroup/>
|
364
|
+
</approvalgroup>
|
348
365
|
<structuredidentifier>
|
349
366
|
<project-number amendment="1" part="1">17301</project-number>
|
350
367
|
</structuredidentifier>
|
@@ -413,10 +430,17 @@ RSpec.describe Metanorma::ISO do
|
|
413
430
|
<ext>
|
414
431
|
<doctype>amendment</doctype>
|
415
432
|
<editorialgroup>
|
433
|
+
<agency>ISO</agency>
|
416
434
|
<technical-committee/>
|
417
435
|
<subcommittee/>
|
418
436
|
<workgroup/>
|
419
437
|
</editorialgroup>
|
438
|
+
<approvalgroup>
|
439
|
+
<agency>ISO</agency>
|
440
|
+
<technical-committee/>
|
441
|
+
<subcommittee/>
|
442
|
+
<workgroup/>
|
443
|
+
</approvalgroup>
|
420
444
|
<structuredidentifier>
|
421
445
|
<project-number amendment="1" part="1">17301</project-number>
|
422
446
|
</structuredidentifier>
|
@@ -484,10 +508,17 @@ RSpec.describe Metanorma::ISO do
|
|
484
508
|
<ext>
|
485
509
|
<doctype>amendment</doctype>
|
486
510
|
<editorialgroup>
|
511
|
+
<agency>ISO</agency>
|
487
512
|
<technical-committee/>
|
488
513
|
<subcommittee/>
|
489
514
|
<workgroup/>
|
490
515
|
</editorialgroup>
|
516
|
+
<approvalgroup>
|
517
|
+
<agency>ISO</agency>
|
518
|
+
<technical-committee/>
|
519
|
+
<subcommittee/>
|
520
|
+
<workgroup/>
|
521
|
+
</approvalgroup>
|
491
522
|
<structuredidentifier>
|
492
523
|
<project-number amendment="1" part="1">17301</project-number>
|
493
524
|
</structuredidentifier>
|
@@ -556,10 +587,17 @@ RSpec.describe Metanorma::ISO do
|
|
556
587
|
<ext>
|
557
588
|
<doctype>technical-corrigendum</doctype>
|
558
589
|
<editorialgroup>
|
590
|
+
<agency>ISO</agency>
|
559
591
|
<technical-committee/>
|
560
592
|
<subcommittee/>
|
561
593
|
<workgroup/>
|
562
594
|
</editorialgroup>
|
595
|
+
<approvalgroup>
|
596
|
+
<agency>ISO</agency>
|
597
|
+
<technical-committee/>
|
598
|
+
<subcommittee/>
|
599
|
+
<workgroup/>
|
600
|
+
</approvalgroup>
|
563
601
|
<structuredidentifier>
|
564
602
|
<project-number corrigendum="3" part="1">17301</project-number>
|
565
603
|
</structuredidentifier>
|
@@ -628,10 +666,17 @@ RSpec.describe Metanorma::ISO do
|
|
628
666
|
<ext>
|
629
667
|
<doctype>technical-corrigendum</doctype>
|
630
668
|
<editorialgroup>
|
669
|
+
<agency>ISO</agency>
|
631
670
|
<technical-committee/>
|
632
671
|
<subcommittee/>
|
633
672
|
<workgroup/>
|
634
673
|
</editorialgroup>
|
674
|
+
<approvalgroup>
|
675
|
+
<agency>ISO</agency>
|
676
|
+
<technical-committee/>
|
677
|
+
<subcommittee/>
|
678
|
+
<workgroup/>
|
679
|
+
</approvalgroup>
|
635
680
|
<structuredidentifier>
|
636
681
|
<project-number part='1' corrigendum='3'>17301</project-number>
|
637
682
|
</structuredidentifier>
|
@@ -699,10 +744,17 @@ RSpec.describe Metanorma::ISO do
|
|
699
744
|
<ext>
|
700
745
|
<doctype>technical-corrigendum</doctype>
|
701
746
|
<editorialgroup>
|
747
|
+
<agency>ISO</agency>
|
702
748
|
<technical-committee/>
|
703
749
|
<subcommittee/>
|
704
750
|
<workgroup/>
|
705
751
|
</editorialgroup>
|
752
|
+
<approvalgroup>
|
753
|
+
<agency>ISO</agency>
|
754
|
+
<technical-committee/>
|
755
|
+
<subcommittee/>
|
756
|
+
<workgroup/>
|
757
|
+
</approvalgroup>
|
706
758
|
<structuredidentifier>
|
707
759
|
<project-number corrigendum="3" part="1">17301</project-number>
|
708
760
|
</structuredidentifier>
|
data/spec/metanorma/base_spec.rb
CHANGED
@@ -37,6 +37,25 @@ RSpec.describe Metanorma::ISO do
|
|
37
37
|
:workgroup-number_2: 31
|
38
38
|
:workgroup-type_2: C1
|
39
39
|
:secretariat: SECRETARIAT
|
40
|
+
:approval-technical-committee: TCa
|
41
|
+
:approval-technical-committee-number: 1a
|
42
|
+
:approval-technical-committee-type: Aa
|
43
|
+
:approval-subcommittee: SCa
|
44
|
+
:approval-subcommittee-number: 2a
|
45
|
+
:approval-subcommittee-type: Ba
|
46
|
+
:approval-workgroup: WGa
|
47
|
+
:approval-workgroup-number: 3a
|
48
|
+
:approval-workgroup-type: Ca
|
49
|
+
:approval-technical-committee_2: TC1a
|
50
|
+
:approval-technical-committee-number_2: 11a
|
51
|
+
:approval-technical-committee-type_2: A1a
|
52
|
+
:approval-subcommittee_2: SC1a
|
53
|
+
:approval-subcommittee-number_2: 21a
|
54
|
+
:approval-subcommittee-type_2: B1a
|
55
|
+
:approval-workgroup_2: WG1a
|
56
|
+
:approval-workgroup-number_2: 31a
|
57
|
+
:approval-workgroup-type_2: C1a
|
58
|
+
:approval-agency: ISO/IEC
|
40
59
|
:docstage: 20
|
41
60
|
:docsubstage: 20
|
42
61
|
:iteration: 3
|
@@ -105,9 +124,10 @@ RSpec.describe Metanorma::ISO do
|
|
105
124
|
</owner>
|
106
125
|
</copyright>
|
107
126
|
<ext>
|
108
|
-
<doctype>
|
127
|
+
<doctype>standard</doctype>
|
109
128
|
<horizontal>true</horizontal>
|
110
129
|
<editorialgroup>
|
130
|
+
<agency>ISO</agency>
|
111
131
|
<technical-committee number="1" type="A">TC</technical-committee>
|
112
132
|
<technical-committee number="11" type="A1">TC1</technical-committee>
|
113
133
|
<subcommittee number="2" type="B">SC</subcommittee>
|
@@ -116,6 +136,16 @@ RSpec.describe Metanorma::ISO do
|
|
116
136
|
<workgroup number="31" type="C1">WG1</workgroup>
|
117
137
|
<secretariat>SECRETARIAT</secretariat>
|
118
138
|
</editorialgroup>
|
139
|
+
<approvalgroup>
|
140
|
+
<agency>ISO</agency>
|
141
|
+
<agency>IEC</agency>
|
142
|
+
<technical-committee number="1a" type="Aa">TCa</technical-committee>
|
143
|
+
<technical-committee number="11a" type="A1a">TC1a</technical-committee>
|
144
|
+
<subcommittee number="2a" type="Ba">SCa</subcommittee>
|
145
|
+
<subcommittee number="21a" type="B1a">SC1a</subcommittee>
|
146
|
+
<workgroup number="3a" type="Ca">WGa</workgroup>
|
147
|
+
<workgroup number="31a" type="C1a">WG1a</workgroup>
|
148
|
+
</approvalgroup>
|
119
149
|
<ics>
|
120
150
|
<code>1</code>
|
121
151
|
</ics>
|
@@ -161,6 +191,15 @@ RSpec.describe Metanorma::ISO do
|
|
161
191
|
:pub-uri: http://www.example.com
|
162
192
|
:docstage:
|
163
193
|
:docsubstage:
|
194
|
+
:technical-committee: TC
|
195
|
+
:technical-committee-number: 1
|
196
|
+
:technical-committee-type: A
|
197
|
+
:subcommittee: SC
|
198
|
+
:subcommittee-number: 2
|
199
|
+
:subcommittee-type: B
|
200
|
+
:workgroup: WG
|
201
|
+
:workgroup-number: 3
|
202
|
+
:workgroup-type: C
|
164
203
|
INPUT
|
165
204
|
expect(xmlpp(output.sub(%r{<boilerplate>.*</boilerplate>}m, "")))
|
166
205
|
.to be_equivalent_to xmlpp(<<~"OUTPUT")
|
@@ -274,11 +313,20 @@ RSpec.describe Metanorma::ISO do
|
|
274
313
|
</copyright>
|
275
314
|
<ext>
|
276
315
|
<doctype>technical-report</doctype>
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
316
|
+
<editorialgroup>
|
317
|
+
<agency>IEC</agency>
|
318
|
+
<agency>IETF</agency>
|
319
|
+
<agency>ISO</agency>
|
320
|
+
<technical-committee number='1' type='A'>TC</technical-committee>
|
321
|
+
<subcommittee number='2' type='B'>SC</subcommittee>
|
322
|
+
<workgroup number='3' type='C'>WG</workgroup>
|
323
|
+
</editorialgroup>
|
324
|
+
<approvalgroup>
|
325
|
+
<agency>ISO</agency>
|
326
|
+
<technical-committee number='1' type='A'>TC</technical-committee>
|
327
|
+
<subcommittee number='2' type='B'>SC</subcommittee>
|
328
|
+
<workgroup number='3' type='C'>WG</workgroup>
|
329
|
+
</approvalgroup>
|
282
330
|
<structuredidentifier>
|
283
331
|
<project-number part="1" subpart="1">IEC/IETF/ISO 1000</project-number>
|
284
332
|
</structuredidentifier>
|
@@ -290,6 +338,84 @@ RSpec.describe Metanorma::ISO do
|
|
290
338
|
OUTPUT
|
291
339
|
end
|
292
340
|
|
341
|
+
it "processes tech specification identifier" do
|
342
|
+
output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
343
|
+
= Document title
|
344
|
+
Author
|
345
|
+
:docfile: test.adoc
|
346
|
+
:nodoc:
|
347
|
+
:novalid:
|
348
|
+
:no-isobib:
|
349
|
+
:docnumber: 1000
|
350
|
+
:partnumber: 1-1
|
351
|
+
:copyright-year: 2001
|
352
|
+
:doctype: technical-specification
|
353
|
+
:docstage: 50
|
354
|
+
:docsubstage:
|
355
|
+
INPUT
|
356
|
+
expect(xmlpp(output.sub(%r{<boilerplate>.*</boilerplate>}m, "")))
|
357
|
+
.to be_equivalent_to xmlpp(<<~"OUTPUT")
|
358
|
+
<iso-standard xmlns='https://www.metanorma.org/ns/iso' type='semantic' version="#{Metanorma::ISO::VERSION}">
|
359
|
+
<bibdata type='standard'>
|
360
|
+
<docidentifier type='ISO'>ISO/FDTS 1000-1-1</docidentifier>
|
361
|
+
<docidentifier type='iso-undated'>ISO/FDTS 1000-1-1</docidentifier>
|
362
|
+
<docidentifier type='iso-with-lang'>ISO/FDTS 1000-1-1(E)</docidentifier>
|
363
|
+
<docidentifier type='iso-reference'>ISO/FDTS 1000-1-1:2001(E)</docidentifier>
|
364
|
+
<docnumber>1000</docnumber>
|
365
|
+
<contributor>
|
366
|
+
<role type='author'/>
|
367
|
+
<organization>
|
368
|
+
<name>International Organization for Standardization</name>
|
369
|
+
<abbreviation>ISO</abbreviation>
|
370
|
+
</organization>
|
371
|
+
</contributor>
|
372
|
+
<contributor>
|
373
|
+
<role type='publisher'/>
|
374
|
+
<organization>
|
375
|
+
<name>International Organization for Standardization</name>
|
376
|
+
<abbreviation>ISO</abbreviation>
|
377
|
+
</organization>
|
378
|
+
</contributor>
|
379
|
+
<language>en</language>
|
380
|
+
<script>Latn</script>
|
381
|
+
<status>
|
382
|
+
<stage abbreviation='FDTS TS'>50</stage>
|
383
|
+
<substage>00</substage>
|
384
|
+
</status>
|
385
|
+
<copyright>
|
386
|
+
<from>2001</from>
|
387
|
+
<owner>
|
388
|
+
<organization>
|
389
|
+
<name>International Organization for Standardization</name>
|
390
|
+
<abbreviation>ISO</abbreviation>
|
391
|
+
</organization>
|
392
|
+
</owner>
|
393
|
+
</copyright>
|
394
|
+
<ext>
|
395
|
+
<doctype>technical-specification</doctype>
|
396
|
+
<editorialgroup>
|
397
|
+
<agency>ISO</agency>
|
398
|
+
<technical-committee/>
|
399
|
+
<subcommittee/>
|
400
|
+
<workgroup/>
|
401
|
+
</editorialgroup>
|
402
|
+
<approvalgroup>
|
403
|
+
<agency>ISO</agency>
|
404
|
+
<technical-committee/>
|
405
|
+
<subcommittee/>
|
406
|
+
<workgroup/>
|
407
|
+
</approvalgroup>
|
408
|
+
<structuredidentifier>
|
409
|
+
<project-number part='1' subpart='1'>ISO 1000</project-number>
|
410
|
+
</structuredidentifier>
|
411
|
+
<stagename>Final draft</stagename>
|
412
|
+
</ext>
|
413
|
+
</bibdata>
|
414
|
+
<sections> </sections>
|
415
|
+
</iso-standard>
|
416
|
+
OUTPUT
|
417
|
+
end
|
418
|
+
|
293
419
|
it "processes Russian titles" do
|
294
420
|
output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
295
421
|
= Document title
|
@@ -381,13 +507,20 @@ RSpec.describe Metanorma::ISO do
|
|
381
507
|
</owner>
|
382
508
|
</copyright>
|
383
509
|
<ext>
|
384
|
-
<doctype>
|
510
|
+
<doctype>standard</doctype>
|
385
511
|
<horizontal>true</horizontal>
|
386
512
|
<editorialgroup>
|
513
|
+
<agency>ISO</agency>
|
387
514
|
<technical-committee/>
|
388
515
|
<subcommittee/>
|
389
516
|
<workgroup/>
|
390
517
|
</editorialgroup>
|
518
|
+
<approvalgroup>
|
519
|
+
<agency>ISO</agency>
|
520
|
+
<technical-committee/>
|
521
|
+
<subcommittee/>
|
522
|
+
<workgroup/>
|
523
|
+
</approvalgroup>
|
391
524
|
<structuredidentifier>
|
392
525
|
<project-number part='1'>ISO 1000</project-number>
|
393
526
|
</structuredidentifier>
|
@@ -491,10 +624,17 @@ RSpec.describe Metanorma::ISO do
|
|
491
624
|
<ext>
|
492
625
|
<doctype>this-is-a-doctype</doctype>
|
493
626
|
<editorialgroup>
|
627
|
+
<agency>SD</agency>
|
494
628
|
<technical-committee/>
|
495
629
|
<subcommittee/>
|
496
630
|
<workgroup/>
|
497
631
|
</editorialgroup>
|
632
|
+
<approvalgroup>
|
633
|
+
<agency>ISO</agency>
|
634
|
+
<technical-committee/>
|
635
|
+
<subcommittee/>
|
636
|
+
<workgroup/>
|
637
|
+
</approvalgroup>
|
498
638
|
<structuredidentifier>
|
499
639
|
<project-number part="1" subpart="1">SD 1000</project-number>
|
500
640
|
</structuredidentifier>
|
@@ -562,10 +702,17 @@ RSpec.describe Metanorma::ISO do
|
|
562
702
|
<ext>
|
563
703
|
<doctype>international-standard</doctype>
|
564
704
|
<editorialgroup>
|
705
|
+
<agency>ISO</agency>
|
565
706
|
<technical-committee/>
|
566
707
|
<subcommittee/>
|
567
708
|
<workgroup/>
|
568
709
|
</editorialgroup>
|
710
|
+
<approvalgroup>
|
711
|
+
<agency>ISO</agency>
|
712
|
+
<technical-committee/>
|
713
|
+
<subcommittee/>
|
714
|
+
<workgroup/>
|
715
|
+
</approvalgroup>
|
569
716
|
<structuredidentifier>
|
570
717
|
<project-number>ISO 1000</project-number>
|
571
718
|
</structuredidentifier>
|
@@ -629,12 +776,19 @@ RSpec.describe Metanorma::ISO do
|
|
629
776
|
</owner>
|
630
777
|
</copyright>
|
631
778
|
<ext>
|
632
|
-
<doctype>
|
779
|
+
<doctype>standard</doctype>
|
633
780
|
<editorialgroup>
|
781
|
+
<agency>ISO</agency>
|
634
782
|
<technical-committee/>
|
635
783
|
<subcommittee/>
|
636
784
|
<workgroup/>
|
637
785
|
</editorialgroup>
|
786
|
+
<approvalgroup>
|
787
|
+
<agency>ISO</agency>
|
788
|
+
<technical-committee/>
|
789
|
+
<subcommittee/>
|
790
|
+
<workgroup/>
|
791
|
+
</approvalgroup>
|
638
792
|
<structuredidentifier>
|
639
793
|
<project-number>ISO 1000</project-number>
|
640
794
|
</structuredidentifier>
|
@@ -698,12 +852,19 @@ RSpec.describe Metanorma::ISO do
|
|
698
852
|
</owner>
|
699
853
|
</copyright>
|
700
854
|
<ext>
|
701
|
-
<doctype>
|
855
|
+
<doctype>standard</doctype>
|
702
856
|
<editorialgroup>
|
857
|
+
<agency>ISO</agency>
|
703
858
|
<technical-committee/>
|
704
859
|
<subcommittee/>
|
705
860
|
<workgroup/>
|
706
861
|
</editorialgroup>
|
862
|
+
<approvalgroup>
|
863
|
+
<agency>ISO</agency>
|
864
|
+
<technical-committee/>
|
865
|
+
<subcommittee/>
|
866
|
+
<workgroup/>
|
867
|
+
</approvalgroup>
|
707
868
|
<structuredidentifier>
|
708
869
|
<project-number>ISO 1000</project-number>
|
709
870
|
</structuredidentifier>
|
@@ -768,10 +929,17 @@ RSpec.describe Metanorma::ISO do
|
|
768
929
|
<ext>
|
769
930
|
<doctype>directive</doctype>
|
770
931
|
<editorialgroup>
|
932
|
+
<agency>ISO</agency>
|
771
933
|
<technical-committee/>
|
772
934
|
<subcommittee/>
|
773
935
|
<workgroup/>
|
774
936
|
</editorialgroup>
|
937
|
+
<approvalgroup>
|
938
|
+
<agency>ISO</agency>
|
939
|
+
<technical-committee/>
|
940
|
+
<subcommittee/>
|
941
|
+
<workgroup/>
|
942
|
+
</approvalgroup>
|
775
943
|
<structuredidentifier>
|
776
944
|
<project-number>ISO 1000</project-number>
|
777
945
|
</structuredidentifier>
|
@@ -1142,12 +1310,19 @@ RSpec.describe Metanorma::ISO do
|
|
1142
1310
|
</bibitem>
|
1143
1311
|
</relation>
|
1144
1312
|
<ext>
|
1145
|
-
<doctype>
|
1313
|
+
<doctype>standard</doctype>
|
1146
1314
|
<editorialgroup>
|
1315
|
+
<agency>ISO</agency>
|
1147
1316
|
<technical-committee/>
|
1148
1317
|
<subcommittee/>
|
1149
1318
|
<workgroup/>
|
1150
1319
|
</editorialgroup>
|
1320
|
+
<approvalgroup>
|
1321
|
+
<agency>ISO</agency>
|
1322
|
+
<technical-committee/>
|
1323
|
+
<subcommittee/>
|
1324
|
+
<workgroup/>
|
1325
|
+
</approvalgroup>
|
1151
1326
|
<stagename>International standard</stagename>
|
1152
1327
|
</ext>
|
1153
1328
|
</bibdata>
|
@@ -228,6 +228,27 @@ RSpec.describe Metanorma::ISO do
|
|
228
228
|
.to be_equivalent_to xmlpp(output)
|
229
229
|
end
|
230
230
|
|
231
|
+
it "processes editorial notes" do
|
232
|
+
input = <<~INPUT
|
233
|
+
#{ASCIIDOC_BLANK_HDR}
|
234
|
+
[IMPORTANT,type=editorial]
|
235
|
+
====
|
236
|
+
Editorial note
|
237
|
+
====
|
238
|
+
INPUT
|
239
|
+
output = <<~OUTPUT
|
240
|
+
#{BLANK_HDR}
|
241
|
+
<sections>
|
242
|
+
<admonition id="_" type="editorial">
|
243
|
+
<p id="_">Editorial note</p>
|
244
|
+
</admonition>
|
245
|
+
</sections>
|
246
|
+
</iso-standard>
|
247
|
+
OUTPUT
|
248
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
249
|
+
.to be_equivalent_to xmlpp(output)
|
250
|
+
end
|
251
|
+
|
231
252
|
it "processes complex admonitions with non-Asciidoc names" do
|
232
253
|
input = <<~INPUT
|
233
254
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -600,4 +621,37 @@ RSpec.describe Metanorma::ISO do
|
|
600
621
|
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
601
622
|
.to be_equivalent_to xmlpp(output)
|
602
623
|
end
|
624
|
+
|
625
|
+
it "processes the macro for editorial notes" do
|
626
|
+
input = <<~INPUT
|
627
|
+
#{ASCIIDOC_BLANK_HDR}
|
628
|
+
EDITOR: Note1
|
629
|
+
|
630
|
+
[EDITOR]
|
631
|
+
====
|
632
|
+
Note2
|
633
|
+
====
|
634
|
+
|
635
|
+
[EDITOR]
|
636
|
+
Note3
|
637
|
+
INPUT
|
638
|
+
output = <<~OUTPUT
|
639
|
+
#{BLANK_HDR}
|
640
|
+
<sections>
|
641
|
+
<admonition id='_' type='editorial'>
|
642
|
+
<p id='_'>Note1</p>
|
643
|
+
</admonition>
|
644
|
+
<admonition id='_' type='editorial'>
|
645
|
+
<p id='_'>Note2</p>
|
646
|
+
</admonition>
|
647
|
+
<admonition id='_' type='editorial'>
|
648
|
+
<p id='_'>Note3</p>
|
649
|
+
</admonition>
|
650
|
+
</sections>
|
651
|
+
</iso-standard>
|
652
|
+
OUTPUT
|
653
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
654
|
+
.to be_equivalent_to xmlpp(output)
|
655
|
+
end
|
656
|
+
|
603
657
|
end
|
@@ -73,7 +73,7 @@ RSpec.describe Metanorma::ISO do
|
|
73
73
|
[loweralpha]
|
74
74
|
. First
|
75
75
|
. Second
|
76
|
-
[upperalpha]
|
76
|
+
[upperalpha,start=4]
|
77
77
|
.. Third
|
78
78
|
.. Fourth
|
79
79
|
. Fifth
|
@@ -117,7 +117,7 @@ RSpec.describe Metanorma::ISO do
|
|
117
117
|
</li>
|
118
118
|
<li>
|
119
119
|
<p id="_">Second</p>
|
120
|
-
<ol id=
|
120
|
+
<ol id='_' start='4'>
|
121
121
|
<li>
|
122
122
|
<p id="_">Third</p>
|
123
123
|
</li>
|