metanorma-iso 1.4.3 → 1.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ubuntu.yml +1 -1
- data/lib/asciidoctor/iso/base.rb +9 -20
- data/lib/asciidoctor/iso/cleanup.rb +2 -3
- data/lib/asciidoctor/iso/front.rb +6 -7
- data/lib/asciidoctor/iso/front_id.rb +6 -6
- data/lib/asciidoctor/iso/isodoc.rng +16 -7
- data/lib/asciidoctor/iso/section.rb +5 -11
- data/lib/asciidoctor/iso/term_lookup_cleanup.rb +0 -1
- data/lib/asciidoctor/iso/validate_section.rb +40 -44
- data/lib/isodoc/iso/base_convert.rb +3 -64
- data/lib/isodoc/iso/html/wordstyle.css +10 -9
- data/lib/isodoc/iso/html/wordstyle.scss +15 -9
- data/lib/isodoc/iso/html_convert.rb +2 -1
- data/lib/{asciidoctor → isodoc}/iso/i18n-en.yaml +0 -1
- data/lib/{asciidoctor → isodoc}/iso/i18n-fr.yaml +0 -0
- data/lib/{asciidoctor → isodoc}/iso/i18n-zh-Hans.yaml +0 -0
- data/lib/isodoc/iso/i18n.rb +19 -0
- data/lib/isodoc/iso/init.rb +33 -0
- data/lib/isodoc/iso/iso.amendment.xsl +1403 -1719
- data/lib/isodoc/iso/iso.international-standard.xsl +1403 -1719
- data/lib/isodoc/iso/metadata.rb +1 -1
- data/lib/isodoc/iso/presentation_xml_convert.rb +99 -1
- data/lib/isodoc/iso/sections.rb +3 -8
- data/lib/isodoc/iso/word_convert.rb +19 -14
- data/lib/isodoc/iso/xref.rb +2 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +2 -2
- data/spec/asciidoctor-iso/base_spec.rb +3 -11
- data/spec/asciidoctor-iso/cleanup_spec.rb +31 -7
- data/spec/asciidoctor-iso/inline_spec.rb +8 -2
- data/spec/asciidoctor-iso/refs_spec.rb +3 -3
- data/spec/asciidoctor-iso/section_spec.rb +9 -6
- data/spec/asciidoctor-iso/table_spec.rb +7 -1
- data/spec/asciidoctor-iso/validate_spec.rb +100 -21
- data/spec/isodoc/amd_spec.rb +309 -153
- data/spec/isodoc/blocks_spec.rb +362 -28
- data/spec/isodoc/i18n_spec.rb +468 -108
- data/spec/isodoc/inline_spec.rb +99 -31
- data/spec/isodoc/iso_spec.rb +95 -29
- data/spec/isodoc/postproc_spec.rb +190 -150
- data/spec/isodoc/ref_spec.rb +175 -3
- data/spec/isodoc/section_spec.rb +148 -82
- data/spec/isodoc/table_spec.rb +142 -5
- data/spec/isodoc/terms_spec.rb +78 -53
- data/spec/isodoc/xref_spec.rb +831 -658
- data/spec/metanorma/processor_spec.rb +2 -1
- metadata +11 -9
@@ -150,7 +150,13 @@ RSpec.describe Asciidoctor::ISO do
|
|
150
150
|
<tr>
|
151
151
|
<th rowspan="2" align="left">Defect</th>
|
152
152
|
<th colspan="4" align="center">Maximum permissible mass fraction of defects in husked rice<br/>
|
153
|
-
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><
|
153
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mrow>
|
154
|
+
<mi>w</mi>
|
155
|
+
</mrow>
|
156
|
+
<mrow>
|
157
|
+
<mo>max</mo>
|
158
|
+
</mrow>
|
159
|
+
</msub></math></stem></th>
|
154
160
|
</tr>
|
155
161
|
<tr>
|
156
162
|
<th align="left">in husked rice</th>
|
@@ -3,6 +3,93 @@ require "fileutils"
|
|
3
3
|
|
4
4
|
RSpec.describe Asciidoctor::ISO do
|
5
5
|
|
6
|
+
it "Warns of missing scope" do
|
7
|
+
FileUtils.rm_f "test.err"
|
8
|
+
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
9
|
+
= Document title
|
10
|
+
Author
|
11
|
+
:docfile: test.adoc
|
12
|
+
:nodoc:
|
13
|
+
:no-isobib:
|
14
|
+
:doctype: pizza
|
15
|
+
|
16
|
+
text
|
17
|
+
INPUT
|
18
|
+
expect(File.read("test.err")).to include "Scope clause missing"
|
19
|
+
FileUtils.rm_f "test.err"
|
20
|
+
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
21
|
+
= Document title
|
22
|
+
Author
|
23
|
+
:docfile: test.adoc
|
24
|
+
:nodoc:
|
25
|
+
:no-isobib:
|
26
|
+
:doctype: pizza
|
27
|
+
|
28
|
+
== Scope
|
29
|
+
INPUT
|
30
|
+
expect(File.read("test.err")).not_to include "Scope clause missing"
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
it "Warns of missing normative references" do
|
35
|
+
FileUtils.rm_f "test.err"
|
36
|
+
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
37
|
+
= Document title
|
38
|
+
Author
|
39
|
+
:docfile: test.adoc
|
40
|
+
:nodoc:
|
41
|
+
:no-isobib:
|
42
|
+
:doctype: pizza
|
43
|
+
|
44
|
+
text
|
45
|
+
INPUT
|
46
|
+
expect(File.read("test.err")).to include "Normative references missing"
|
47
|
+
FileUtils.rm_f "test.err"
|
48
|
+
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
49
|
+
= Document title
|
50
|
+
Author
|
51
|
+
:docfile: test.adoc
|
52
|
+
:nodoc:
|
53
|
+
:no-isobib:
|
54
|
+
:doctype: pizza
|
55
|
+
|
56
|
+
[bibliography]
|
57
|
+
== Normative references
|
58
|
+
INPUT
|
59
|
+
expect(File.read("test.err")).not_to include "Normative references missing"
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
it "Warns of missing terms & definitions" do
|
64
|
+
FileUtils.rm_f "test.err"
|
65
|
+
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
66
|
+
= Document title
|
67
|
+
Author
|
68
|
+
:docfile: test.adoc
|
69
|
+
:nodoc:
|
70
|
+
:no-isobib:
|
71
|
+
:doctype: pizza
|
72
|
+
|
73
|
+
text
|
74
|
+
INPUT
|
75
|
+
expect(File.read("test.err")).to include "Terms & definitions missing"
|
76
|
+
FileUtils.rm_f "test.err"
|
77
|
+
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
78
|
+
= Document title
|
79
|
+
Author
|
80
|
+
:docfile: test.adoc
|
81
|
+
:nodoc:
|
82
|
+
:no-isobib:
|
83
|
+
:doctype: pizza
|
84
|
+
|
85
|
+
== Terms and definitions
|
86
|
+
=== Term 1
|
87
|
+
INPUT
|
88
|
+
expect(File.read("test.err")).not_to include "Terms & definitions missing"
|
89
|
+
|
90
|
+
end
|
91
|
+
|
92
|
+
|
6
93
|
it "Warns of illegal doctype" do
|
7
94
|
FileUtils.rm_f "test.err"
|
8
95
|
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
@@ -527,7 +614,7 @@ it "Style warning if Symbols and Abbreviated Terms contains extraneous matter" d
|
|
527
614
|
expect(File.read("test.err")).to include "Symbols and Abbreviated Terms can only contain a definition list"
|
528
615
|
end
|
529
616
|
|
530
|
-
it "Warning if
|
617
|
+
it "Warning if missing foreword" do
|
531
618
|
FileUtils.rm_f "test.err"
|
532
619
|
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
533
620
|
#{VALIDATING_BLANK_HDR}
|
@@ -536,19 +623,15 @@ it "Warning if do not start with scope or introduction" do
|
|
536
623
|
|
537
624
|
Paragraph
|
538
625
|
INPUT
|
539
|
-
expect(File.read("test.err")).to include "
|
626
|
+
expect(File.read("test.err")).to include "Initial section must be (content) Foreword"
|
540
627
|
end
|
541
628
|
|
542
|
-
it "Warning if
|
629
|
+
it "Warning if do not start with scope or introduction" do
|
543
630
|
FileUtils.rm_f "test.err"
|
544
631
|
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
545
632
|
#{VALIDATING_BLANK_HDR}
|
546
|
-
|
547
|
-
.Foreword
|
548
633
|
Foreword
|
549
634
|
|
550
|
-
== Introduction
|
551
|
-
|
552
635
|
== Symbols and Abbreviated Terms
|
553
636
|
|
554
637
|
Paragraph
|
@@ -556,7 +639,7 @@ it "Warning if introduction not followed by scope" do
|
|
556
639
|
expect(File.read("test.err")).to include "Prefatory material must be followed by (clause) Scope"
|
557
640
|
end
|
558
641
|
|
559
|
-
it "Warning if
|
642
|
+
it "Warning if introduction not followed by scope" do
|
560
643
|
FileUtils.rm_f "test.err"
|
561
644
|
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
562
645
|
#{VALIDATING_BLANK_HDR}
|
@@ -564,19 +647,16 @@ it "Warning if normative references not followed by terms and definitions" do
|
|
564
647
|
.Foreword
|
565
648
|
Foreword
|
566
649
|
|
567
|
-
==
|
568
|
-
|
569
|
-
[bibliography]
|
570
|
-
== Normative References
|
650
|
+
== Introduction
|
571
651
|
|
572
652
|
== Symbols and Abbreviated Terms
|
573
653
|
|
574
654
|
Paragraph
|
575
655
|
INPUT
|
576
|
-
expect(File.read("test.err")).to include "
|
656
|
+
expect(File.read("test.err")).to include "Prefatory material must be followed by (clause) Scope"
|
577
657
|
end
|
578
658
|
|
579
|
-
it "Warning if
|
659
|
+
it "Warning if normative references not followed by terms and definitions" do
|
580
660
|
FileUtils.rm_f "test.err"
|
581
661
|
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
582
662
|
#{VALIDATING_BLANK_HDR}
|
@@ -589,20 +669,19 @@ it "Warning if there are no clauses in the document" do
|
|
589
669
|
[bibliography]
|
590
670
|
== Normative References
|
591
671
|
|
592
|
-
== Terms and Definitions
|
593
|
-
|
594
672
|
== Symbols and Abbreviated Terms
|
595
673
|
|
674
|
+
Paragraph
|
596
675
|
INPUT
|
597
|
-
expect(File.read("test.err")).to include "
|
676
|
+
expect(File.read("test.err")).to include "Normative References must be followed by Terms and Definitions"
|
598
677
|
end
|
599
678
|
|
600
|
-
it "Warning if
|
679
|
+
it "Warning if there are no clauses in the document" do
|
601
680
|
FileUtils.rm_f "test.err"
|
602
681
|
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
603
682
|
#{VALIDATING_BLANK_HDR}
|
604
683
|
|
605
|
-
.Foreword
|
684
|
+
.Foreword
|
606
685
|
Foreword
|
607
686
|
|
608
687
|
== Scope
|
@@ -612,10 +691,10 @@ it "Warning if scope occurs after Terms and Definitions" do
|
|
612
691
|
|
613
692
|
== Terms and Definitions
|
614
693
|
|
615
|
-
==
|
694
|
+
== Symbols and Abbreviated Terms
|
616
695
|
|
617
696
|
INPUT
|
618
|
-
expect(File.read("test.err")).to include "
|
697
|
+
expect(File.read("test.err")).to include "Document must contain at least one clause"
|
619
698
|
end
|
620
699
|
|
621
700
|
it "Warning if scope occurs after Terms and Definitions" do
|
data/spec/isodoc/amd_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe IsoDoc do
|
4
4
|
it "cross-references notes in amendments" do
|
5
|
-
expect(xmlpp(IsoDoc::Iso::
|
5
|
+
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
6
6
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
7
7
|
<bibdata> <ext> <doctype>amendment</doctype> </ext> </bibdata>
|
8
8
|
<preface>
|
@@ -56,66 +56,104 @@ RSpec.describe IsoDoc do
|
|
56
56
|
</annex>
|
57
57
|
</iso-standard>
|
58
58
|
INPUT
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
<
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
59
|
+
<?xml version='1.0'?>
|
60
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
61
|
+
<bibdata>
|
62
|
+
<ext>
|
63
|
+
<doctype>amendment</doctype>
|
64
|
+
</ext>
|
65
|
+
</bibdata>
|
66
|
+
<preface>
|
67
|
+
<foreword>
|
68
|
+
<p>
|
69
|
+
<xref target='N'>[N]</xref>
|
70
|
+
<xref target='note1'>[note1]</xref>
|
71
|
+
<xref target='note2'>[note2]</xref>
|
72
|
+
<xref target='AN'>A.1, Note</xref>
|
73
|
+
<xref target='Anote1'>A.2, Note 1</xref>
|
74
|
+
<xref target='Anote2'>A.2, Note 2</xref>
|
75
|
+
</p>
|
76
|
+
</foreword>
|
77
|
+
</preface>
|
78
|
+
<sections>
|
79
|
+
<clause id='scope'>
|
80
|
+
<title depth="1">Scope</title>
|
81
|
+
<note id='N'>
|
82
|
+
<name>NOTE</name>
|
83
|
+
<p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
|
84
|
+
These results are based on a study carried out on three different
|
85
|
+
types of kernel.
|
86
|
+
</p>
|
87
|
+
</note>
|
88
|
+
<p>
|
89
|
+
<xref target='N'>[n]</xref>
|
90
|
+
</p>
|
91
|
+
</clause>
|
92
|
+
<terms id='terms'/>
|
93
|
+
<clause id='widgets'>
|
94
|
+
<title depth="1">Widgets</title>
|
95
|
+
<clause id='widgets1' inline-header="true">
|
96
|
+
<note id='note1'>
|
97
|
+
<name>NOTE</name>
|
98
|
+
<p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
|
99
|
+
These results are based on a study carried out on three different
|
100
|
+
types of kernel.
|
101
|
+
</p>
|
102
|
+
</note>
|
103
|
+
<note id='note2'>
|
104
|
+
<name>NOTE</name>
|
105
|
+
<p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
|
106
|
+
These results are based on a study carried out on three different
|
107
|
+
types of kernel.
|
108
|
+
</p>
|
109
|
+
</note>
|
110
|
+
<p>
|
111
|
+
<xref target='note1'>[note1]</xref>
|
112
|
+
<xref target='note2'>[note2]</xref>
|
113
|
+
</p>
|
114
|
+
</clause>
|
115
|
+
</clause>
|
116
|
+
</sections>
|
117
|
+
<annex id='annex1'>
|
118
|
+
<title>
|
119
|
+
<strong>Annex A</strong>
|
97
120
|
<br/>
|
98
121
|
(informative)
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
122
|
+
</title>
|
123
|
+
<clause id='annex1a' inline-header='true'>
|
124
|
+
<title>A.1</title>
|
125
|
+
<note id='AN'>
|
126
|
+
<name>NOTE</name>
|
127
|
+
<p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
|
128
|
+
These results are based on a study carried out on three different
|
129
|
+
types of kernel.
|
130
|
+
</p>
|
131
|
+
</note>
|
132
|
+
</clause>
|
133
|
+
<clause id='annex1b' inline-header="true">
|
134
|
+
<title>A.2</title>
|
135
|
+
<note id='Anote1'>
|
136
|
+
<name>NOTE 1</name>
|
137
|
+
<p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
|
138
|
+
These results are based on a study carried out on three different
|
139
|
+
types of kernel.
|
140
|
+
</p>
|
141
|
+
</note>
|
142
|
+
<note id='Anote2'>
|
143
|
+
<name>NOTE 2</name>
|
144
|
+
<p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
|
145
|
+
These results are based on a study carried out on three different
|
146
|
+
types of kernel.
|
147
|
+
</p>
|
148
|
+
</note>
|
149
|
+
</clause>
|
150
|
+
</annex>
|
151
|
+
</iso-standard>
|
114
152
|
OUTPUT
|
115
153
|
end
|
116
154
|
|
117
155
|
it "cross-references sections" do
|
118
|
-
expect(xmlpp(IsoDoc::Iso::
|
156
|
+
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
119
157
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
120
158
|
<bibdata> <ext> <doctype>amendment</doctype> </ext> </bibdata>
|
121
159
|
<preface>
|
@@ -145,7 +183,7 @@ RSpec.describe IsoDoc do
|
|
145
183
|
</clause>
|
146
184
|
<clause id="C1" inline-header="false" obligation="informative">Text</clause>
|
147
185
|
</introduction></preface><sections>
|
148
|
-
<clause id="D" obligation="normative">
|
186
|
+
<clause id="D" obligation="normative" type="scope">
|
149
187
|
<title>Scope</title>
|
150
188
|
<p id="E">Text</p>
|
151
189
|
</clause>
|
@@ -179,85 +217,107 @@ RSpec.describe IsoDoc do
|
|
179
217
|
</bibliography>
|
180
218
|
</iso-standard>
|
181
219
|
INPUT
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
<
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
</
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
220
|
+
<?xml version='1.0'?>
|
221
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
222
|
+
<bibdata>
|
223
|
+
<ext>
|
224
|
+
<doctype>amendment</doctype>
|
225
|
+
</ext>
|
226
|
+
</bibdata>
|
227
|
+
<preface>
|
228
|
+
<foreword obligation='informative'>
|
229
|
+
<title>Foreword</title>
|
230
|
+
<p id='A'>
|
231
|
+
This is a preamble
|
232
|
+
<xref target='C'>[C]</xref>
|
233
|
+
<xref target='C1'>[C1]</xref>
|
234
|
+
<xref target='D'>[D]</xref>
|
235
|
+
<xref target='H'>[H]</xref>
|
236
|
+
<xref target='I'>[I]</xref>
|
237
|
+
<xref target='J'>[J]</xref>
|
238
|
+
<xref target='K'>[K]</xref>
|
239
|
+
<xref target='L'>[L]</xref>
|
240
|
+
<xref target='M'>[M]</xref>
|
241
|
+
<xref target='N'>[N]</xref>
|
242
|
+
<xref target='O'>[O]</xref>
|
243
|
+
<xref target='P'>Annex A</xref>
|
244
|
+
<xref target='Q'>A.1</xref>
|
245
|
+
<xref target='Q1'>A.1.1</xref>
|
246
|
+
<xref target='Q2'>Annex A, Appendix 1</xref>
|
247
|
+
<xref target='R'>[R]</xref>
|
248
|
+
</p>
|
249
|
+
</foreword>
|
250
|
+
<introduction id='B' obligation='informative'>
|
251
|
+
<title depth="1">Introduction</title>
|
252
|
+
<clause id='C' inline-header='false' obligation='informative'>
|
253
|
+
<title depth="1">Introduction Subsection</title>
|
254
|
+
</clause>
|
255
|
+
<clause id='C1' inline-header='true' obligation='informative'>Text</clause>
|
256
|
+
</introduction>
|
257
|
+
</preface>
|
258
|
+
<sections>
|
259
|
+
<clause id='D' obligation='normative' type="scope">
|
260
|
+
<title depth="1">Scope</title>
|
261
|
+
<p id='E'>Text</p>
|
262
|
+
</clause>
|
263
|
+
<clause id='M' inline-header='false' obligation='normative'>
|
264
|
+
<title depth="1">Clause 4</title>
|
265
|
+
<clause id='N' inline-header='false' obligation='normative'>
|
266
|
+
<title depth="1">Introduction</title>
|
267
|
+
</clause>
|
268
|
+
<clause id='O' inline-header='false' obligation='normative'>
|
269
|
+
<title depth="1">Clause 4.2</title>
|
270
|
+
</clause>
|
271
|
+
</clause>
|
272
|
+
</sections>
|
273
|
+
<annex id='P' inline-header='false' obligation='normative'>
|
274
|
+
<title>
|
275
|
+
<strong>Annex A</strong>
|
276
|
+
<br/>
|
277
|
+
(normative)
|
278
|
+
<br/>
|
279
|
+
<br/>
|
280
|
+
<strong>Annex</strong>
|
281
|
+
</title>
|
282
|
+
<clause id='Q' inline-header='false' obligation='normative'>
|
283
|
+
<title depth='2'>
|
284
|
+
A.1
|
285
|
+
<tab/>
|
286
|
+
Annex A.1
|
287
|
+
</title>
|
288
|
+
<clause id='Q1' inline-header='false' obligation='normative'>
|
289
|
+
<title depth='3'>
|
290
|
+
A.1.1
|
291
|
+
<tab/>
|
292
|
+
Annex A.1a
|
293
|
+
</title>
|
294
|
+
</clause>
|
295
|
+
</clause>
|
296
|
+
<appendix id='Q2' inline-header='false' obligation='normative'>
|
297
|
+
<title depth='2'>
|
298
|
+
Appendix 1
|
299
|
+
<tab/>
|
300
|
+
An Appendix
|
301
|
+
</title>
|
302
|
+
</appendix>
|
303
|
+
</annex>
|
304
|
+
<bibliography>
|
305
|
+
<references id='R' obligation='informative' normative='true'>
|
306
|
+
<title depth="1">Normative References</title>
|
307
|
+
</references>
|
308
|
+
<clause id='S' obligation='informative'>
|
309
|
+
<title depth="1">Bibliography</title>
|
310
|
+
<references id='T' obligation='informative' normative='false'>
|
311
|
+
<title depth="2">Bibliography Subsection</title>
|
312
|
+
</references>
|
313
|
+
</clause>
|
314
|
+
</bibliography>
|
315
|
+
</iso-standard>
|
256
316
|
OUTPUT
|
257
317
|
end
|
258
318
|
|
259
319
|
it "processes section names" do
|
260
|
-
|
320
|
+
input = <<~INPUT
|
261
321
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
262
322
|
<bibdata> <ext> <doctype>amendment</doctype> </ext> </bibdata>
|
263
323
|
<boilerplate>
|
@@ -284,7 +344,7 @@ Text</div>
|
|
284
344
|
</boilerplate>
|
285
345
|
<preface>
|
286
346
|
<abstract obligation="informative">
|
287
|
-
<title>
|
347
|
+
<title>Abstract</title>
|
288
348
|
</abstract>
|
289
349
|
<foreword obligation="informative">
|
290
350
|
<title>Foreword</title>
|
@@ -300,11 +360,6 @@ Text</div>
|
|
300
360
|
<title>Acknowledgements</title>
|
301
361
|
</acknowledgements>
|
302
362
|
</preface><sections>
|
303
|
-
<clause id="D" obligation="normative">
|
304
|
-
<title>Scope</title>
|
305
|
-
<p id="E">Text</p>
|
306
|
-
</clause>
|
307
|
-
|
308
363
|
<clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
|
309
364
|
<title>Introduction</title>
|
310
365
|
</clause>
|
@@ -314,7 +369,10 @@ Text</div>
|
|
314
369
|
<clause id="O1" inline-header="false" obligation="normative">
|
315
370
|
</clause>
|
316
371
|
</clause>
|
317
|
-
|
372
|
+
<clause id="D" obligation="normative">
|
373
|
+
<title>Scope</title>
|
374
|
+
<p id="E">Text</p>
|
375
|
+
</clause>
|
318
376
|
</sections><annex id="P" inline-header="false" obligation="normative">
|
319
377
|
<title>Annex</title>
|
320
378
|
<clause id="Q" inline-header="false" obligation="normative">
|
@@ -322,7 +380,6 @@ Text</div>
|
|
322
380
|
<clause id="Q1" inline-header="false" obligation="normative">
|
323
381
|
<title>Annex A.1a</title>
|
324
382
|
</clause>
|
325
|
-
<references id="Q2" normative="false"><title>Annex Bibliography</title></references>
|
326
383
|
</clause>
|
327
384
|
</annex>
|
328
385
|
<annex id="P1" inline-header="false" obligation="normative">
|
@@ -338,6 +395,112 @@ Text</div>
|
|
338
395
|
</bibliography>
|
339
396
|
</iso-standard>
|
340
397
|
INPUT
|
398
|
+
presxml = <<~OUTPUT
|
399
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
400
|
+
<bibdata>
|
401
|
+
<ext>
|
402
|
+
<doctype>amendment</doctype>
|
403
|
+
</ext>
|
404
|
+
</bibdata>
|
405
|
+
<boilerplate>
|
406
|
+
<copyright-statement>
|
407
|
+
<clause>
|
408
|
+
<title depth="1">Copyright</title>
|
409
|
+
</clause>
|
410
|
+
</copyright-statement>
|
411
|
+
<license-statement>
|
412
|
+
<clause>
|
413
|
+
<title depth="1">License</title>
|
414
|
+
</clause>
|
415
|
+
</license-statement>
|
416
|
+
<legal-statement>
|
417
|
+
<clause>
|
418
|
+
<title depth="1">Legal</title>
|
419
|
+
</clause>
|
420
|
+
</legal-statement>
|
421
|
+
<feedback-statement>
|
422
|
+
<clause>
|
423
|
+
<title depth="1">Feedback</title>
|
424
|
+
</clause>
|
425
|
+
</feedback-statement>
|
426
|
+
</boilerplate>
|
427
|
+
<preface>
|
428
|
+
<abstract obligation='informative'>
|
429
|
+
<title>Abstract</title>
|
430
|
+
</abstract>
|
431
|
+
<foreword obligation='informative'>
|
432
|
+
<title>Foreword</title>
|
433
|
+
<p id='A'>This is a preamble</p>
|
434
|
+
</foreword>
|
435
|
+
<introduction id='B' obligation='informative'>
|
436
|
+
<title depth='1'>Introduction</title>
|
437
|
+
<clause id='C' inline-header='false' obligation='informative'>
|
438
|
+
<title depth='1'>Introduction Subsection</title>
|
439
|
+
</clause>
|
440
|
+
</introduction>
|
441
|
+
<clause id='B1'>
|
442
|
+
<title depth='1'>Dedication</title>
|
443
|
+
</clause>
|
444
|
+
<clause id='B2'>
|
445
|
+
<title depth='1'>Note to reader</title>
|
446
|
+
</clause>
|
447
|
+
<acknowledgements obligation='informative'>
|
448
|
+
<title>Acknowledgements</title>
|
449
|
+
</acknowledgements>
|
450
|
+
</preface>
|
451
|
+
<sections>
|
452
|
+
<clause id='M' inline-header='false' obligation='normative'>
|
453
|
+
<title depth='1'>Clause 4</title>
|
454
|
+
<clause id='N' inline-header='false' obligation='normative'>
|
455
|
+
<title depth='1'>Introduction</title>
|
456
|
+
</clause>
|
457
|
+
<clause id='O' inline-header='false' obligation='normative'>
|
458
|
+
<title depth='1'>Clause 4.2</title>
|
459
|
+
</clause>
|
460
|
+
<clause id='O1' inline-header='true' obligation='normative'> </clause>
|
461
|
+
</clause>
|
462
|
+
<clause id='D' obligation='normative'>
|
463
|
+
<title depth='1'>Scope</title>
|
464
|
+
<p id='E'>Text</p>
|
465
|
+
</clause>
|
466
|
+
</sections>
|
467
|
+
<annex id='P' inline-header='false' obligation='normative'>
|
468
|
+
<title>
|
469
|
+
<strong>Annex A</strong>
|
470
|
+
<br/>
|
471
|
+
(normative)
|
472
|
+
<br/>
|
473
|
+
<br/>
|
474
|
+
<strong>Annex</strong>
|
475
|
+
</title>
|
476
|
+
<clause id='Q' inline-header='false' obligation='normative'>
|
477
|
+
<title depth='2'>A.1<tab/>Annex A.1</title>
|
478
|
+
<clause id='Q1' inline-header='false' obligation='normative'>
|
479
|
+
<title depth='3'>A.1.1<tab/>Annex A.1a</title>
|
480
|
+
</clause>
|
481
|
+
</clause>
|
482
|
+
</annex>
|
483
|
+
<annex id='P1' inline-header='false' obligation='normative'>
|
484
|
+
<title>
|
485
|
+
<strong>Annex B</strong>
|
486
|
+
<br/>
|
487
|
+
(normative)
|
488
|
+
</title>
|
489
|
+
</annex>
|
490
|
+
<bibliography>
|
491
|
+
<references id='R' obligation='informative' normative='true'>
|
492
|
+
<title depth='1'>Normative References</title>
|
493
|
+
</references>
|
494
|
+
<clause id='S' obligation='informative'>
|
495
|
+
<title depth='1'>Bibliography</title>
|
496
|
+
<references id='T' obligation='informative' normative='false'>
|
497
|
+
<title depth='2'>Bibliography Subsection</title>
|
498
|
+
</references>
|
499
|
+
</clause>
|
500
|
+
</bibliography>
|
501
|
+
</iso-standard>
|
502
|
+
OUTPUT
|
503
|
+
html = <<~OUTPUT
|
341
504
|
<html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
|
342
505
|
<head/>
|
343
506
|
<body lang='en'>
|
@@ -401,12 +564,8 @@ Text</div>
|
|
401
564
|
<h1 class='IntroTitle'>Acknowledgements</h1>
|
402
565
|
</div>
|
403
566
|
<p class='zzSTDTitle1'/>
|
404
|
-
<div id='D'>
|
405
|
-
<h1>Scope</h1>
|
406
|
-
<p id='E'>Text</p>
|
407
|
-
</div>
|
408
567
|
<div>
|
409
|
-
<h1>Normative
|
568
|
+
<h1>Normative References</h1>
|
410
569
|
</div>
|
411
570
|
<div id='M'>
|
412
571
|
<h1>Clause 4</h1>
|
@@ -417,11 +576,12 @@ Text</div>
|
|
417
576
|
<h1>Clause 4.2</h1>
|
418
577
|
</div>
|
419
578
|
<div id='O1'>
|
420
|
-
<span class='zzMoveToFollowing'>
|
421
|
-
<b/>
|
422
|
-
</span>
|
423
579
|
</div>
|
424
580
|
</div>
|
581
|
+
<div id='D'>
|
582
|
+
<h1>Scope</h1>
|
583
|
+
<p id='E'>Text</p>
|
584
|
+
</div>
|
425
585
|
<br/>
|
426
586
|
<div id='P' class='Section3'>
|
427
587
|
<h1 class='Annex'>
|
@@ -437,9 +597,6 @@ Text</div>
|
|
437
597
|
<div id='Q1'>
|
438
598
|
<h3>A.1.1  Annex A.1a</h3>
|
439
599
|
</div>
|
440
|
-
<div>
|
441
|
-
<h3>A.1.2  Annex Bibliography</h3>
|
442
|
-
</div>
|
443
600
|
</div>
|
444
601
|
</div>
|
445
602
|
<br/>
|
@@ -448,9 +605,6 @@ Text</div>
|
|
448
605
|
<b>Annex B</b>
|
449
606
|
<br/>
|
450
607
|
(normative)
|
451
|
-
<br/>
|
452
|
-
<br/>
|
453
|
-
<b/>
|
454
608
|
</h1>
|
455
609
|
</div>
|
456
610
|
<br/>
|
@@ -464,6 +618,8 @@ Text</div>
|
|
464
618
|
</body>
|
465
619
|
</html>
|
466
620
|
OUTPUT
|
621
|
+
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
622
|
+
expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
467
623
|
end
|
468
624
|
|
469
625
|
it "processes IsoXML metadata" do
|