metanorma-iso 2.2.2 → 2.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/iso/html/header-dis.html +111 -29
- data/lib/isodoc/iso/html/isodoc-dis.css +65 -64
- data/lib/isodoc/iso/html/isodoc-dis.scss +65 -64
- data/lib/isodoc/iso/html/style-human.css +7 -2
- data/lib/isodoc/iso/html/style-human.scss +0 -1
- data/lib/isodoc/iso/html/style-iso.css +7 -2
- data/lib/isodoc/iso/html/style-iso.scss +0 -1
- data/lib/isodoc/iso/html/wordstyle-dis.css +160 -4
- data/lib/isodoc/iso/html/wordstyle-dis.scss +154 -4
- data/lib/isodoc/iso/html/wordstyle.css +150 -0
- data/lib/isodoc/iso/html/wordstyle.scss +144 -0
- data/lib/isodoc/iso/i18n-en.yaml +4 -4
- data/lib/isodoc/iso/iso.amendment.xsl +1649 -1199
- data/lib/isodoc/iso/iso.international-standard.xsl +1649 -1199
- data/lib/isodoc/iso/presentation_bibdata.rb +13 -9
- data/lib/isodoc/iso/presentation_xml_convert.rb +5 -3
- data/lib/isodoc/iso/word_convert.rb +6 -4
- data/lib/isodoc/iso/word_dis_cleanup.rb +30 -8
- data/lib/isodoc/iso/word_dis_convert.rb +5 -2
- data/lib/metanorma/iso/base.rb +2 -1
- data/lib/metanorma/iso/biblio.rng +5 -0
- data/lib/metanorma/iso/isodoc.rng +47 -13
- data/lib/metanorma/iso/validate.rb +2 -2
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +5 -2
- metadata +4 -87
- data/.github/workflows/automerge.yml +0 -31
- data/.github/workflows/rake.yml +0 -15
- data/.github/workflows/release.yml +0 -24
- data/.github/workflows/ubuntu.yml +0 -41
- data/Rakefile +0 -8
- data/bin/rspec +0 -17
- data/spec/assets/header.html +0 -7
- data/spec/assets/html.css +0 -2
- data/spec/assets/htmlcover.html +0 -4
- data/spec/assets/htmlintro.html +0 -5
- data/spec/assets/i18n.yaml +0 -2
- data/spec/assets/iso.adoc +0 -10
- data/spec/assets/iso.headless.html +0 -33
- data/spec/assets/iso.xml +0 -71
- data/spec/assets/rice_image1.png +0 -0
- data/spec/assets/scripts.html +0 -3
- data/spec/assets/std.css +0 -2
- data/spec/assets/word.css +0 -2
- data/spec/assets/wordcover.html +0 -3
- data/spec/assets/wordintro.html +0 -4
- data/spec/examples/103_01_02.html +0 -247
- data/spec/examples/english.yaml +0 -69
- data/spec/examples/iso_123_.xml +0 -45
- data/spec/examples/iso_123_all_parts.xml +0 -45
- data/spec/examples/iso_123_no_year_note.xml +0 -46
- data/spec/examples/iso_124_.xml +0 -41
- data/spec/examples/iso_216_.xml +0 -47
- data/spec/examples/iso_iec_12382_.xml +0 -48
- data/spec/examples/rice.adoc +0 -714
- data/spec/examples/rice.preview.html +0 -1870
- data/spec/examples/rice.sh +0 -4
- data/spec/examples/rice_img/1000-1_ed2amd3fig1a.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig1b.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig2.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig3.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig4.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig5_f.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figA.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figA1.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figA2.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figTab1.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figTab2.png +0 -0
- data/spec/examples/rice_img/1001_ed2amd3fig1.png +0 -0
- data/spec/examples/rice_img/ISO_1213_1.png +0 -0
- data/spec/examples/rice_img/SL1000-1_ed2amd3fig1.png +0 -0
- data/spec/examples/rice_img/rice_image1.png +0 -0
- data/spec/examples/rice_img/rice_image2.png +0 -0
- data/spec/examples/rice_img/rice_image3_1.png +0 -0
- data/spec/examples/rice_img/rice_image3_2.png +0 -0
- data/spec/examples/rice_img/rice_image3_3.png +0 -0
- data/spec/isodoc/amd_spec.rb +0 -986
- data/spec/isodoc/blocks_spec.rb +0 -1174
- data/spec/isodoc/i18n_spec.rb +0 -1579
- data/spec/isodoc/inline_spec.rb +0 -1060
- data/spec/isodoc/iso_spec.rb +0 -255
- data/spec/isodoc/metadata_spec.rb +0 -701
- data/spec/isodoc/postproc_spec.rb +0 -1089
- data/spec/isodoc/ref_spec.rb +0 -439
- data/spec/isodoc/section_spec.rb +0 -998
- data/spec/isodoc/table_spec.rb +0 -420
- data/spec/isodoc/terms_spec.rb +0 -314
- data/spec/isodoc/word_dis_spec.rb +0 -2064
- data/spec/isodoc/xref_spec.rb +0 -1747
- data/spec/metanorma/amd_spec.rb +0 -724
- data/spec/metanorma/base_spec.rb +0 -1384
- data/spec/metanorma/blank_spec.rb +0 -38
- data/spec/metanorma/blocks_spec.rb +0 -624
- data/spec/metanorma/cleanup_spec.rb +0 -1645
- data/spec/metanorma/inline_spec.rb +0 -203
- data/spec/metanorma/lists_spec.rb +0 -197
- data/spec/metanorma/macros_spec.rb +0 -99
- data/spec/metanorma/processor_spec.rb +0 -161
- data/spec/metanorma/refs_spec.rb +0 -672
- data/spec/metanorma/section_spec.rb +0 -492
- data/spec/metanorma/table_spec.rb +0 -329
- data/spec/metanorma/validate_spec.rb +0 -2153
- data/spec/relaton/render_spec.rb +0 -568
- data/spec/requirements/requirement_components_spec.rb +0 -610
- data/spec/requirements/requirements_spec.rb +0 -1596
- data/spec/requirements/xref_spec.rb +0 -1211
- data/spec/spec_helper.rb +0 -313
- data/spec/vcr_cassettes/docrels.yml +0 -385
- data/spec/vcr_cassettes/withdrawn_iso.yml +0 -295
@@ -1,38 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe Metanorma::ISO do
|
4
|
-
it "processes a blank document" do
|
5
|
-
input = <<~INPUT
|
6
|
-
#{ASCIIDOC_BLANK_HDR}
|
7
|
-
INPUT
|
8
|
-
output = <<~OUTPUT
|
9
|
-
#{BLANK_HDR}
|
10
|
-
<sections/>
|
11
|
-
</iso-standard>
|
12
|
-
OUTPUT
|
13
|
-
expect(xmlpp(Asciidoctor.convert(input, *OPTIONS)))
|
14
|
-
.to be_equivalent_to xmlpp(output)
|
15
|
-
end
|
16
|
-
|
17
|
-
it "converts a blank document" do
|
18
|
-
input = <<~INPUT
|
19
|
-
= Document title
|
20
|
-
Author
|
21
|
-
:docfile: test.adoc
|
22
|
-
:novalid:
|
23
|
-
:no-isobib:
|
24
|
-
INPUT
|
25
|
-
output = <<~OUTPUT
|
26
|
-
#{BLANK_HDR}
|
27
|
-
<sections/>
|
28
|
-
</iso-standard>
|
29
|
-
OUTPUT
|
30
|
-
expect(xmlpp(Asciidoctor.convert(input, *OPTIONS)))
|
31
|
-
.to be_equivalent_to xmlpp(output)
|
32
|
-
expect(File.exist?("test_alt.html")).to be true
|
33
|
-
expect(File.exist?("test.html")).to be true
|
34
|
-
expect(File.exist?("test.doc")).to be true
|
35
|
-
expect(File.exist?("test.pdf")).to be true
|
36
|
-
expect(File.exist?("htmlstyle.css")).to be false
|
37
|
-
end
|
38
|
-
end
|
@@ -1,624 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe Metanorma::ISO do
|
4
|
-
it "processes open blocks" do
|
5
|
-
input = <<~INPUT
|
6
|
-
#{ASCIIDOC_BLANK_HDR}
|
7
|
-
--
|
8
|
-
x
|
9
|
-
|
10
|
-
y
|
11
|
-
|
12
|
-
z
|
13
|
-
--
|
14
|
-
INPUT
|
15
|
-
output = <<~OUTPUT
|
16
|
-
#{BLANK_HDR}
|
17
|
-
<sections>
|
18
|
-
<p id="_">x</p>
|
19
|
-
<p id="_">y</p>
|
20
|
-
<p id="_">z</p>
|
21
|
-
</sections>
|
22
|
-
</iso-standard>
|
23
|
-
OUTPUT
|
24
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
25
|
-
.to be_equivalent_to xmlpp(output)
|
26
|
-
end
|
27
|
-
|
28
|
-
it "processes stem blocks" do
|
29
|
-
input = <<~INPUT
|
30
|
-
#{ASCIIDOC_BLANK_HDR}
|
31
|
-
[stem]
|
32
|
-
++++
|
33
|
-
r = 1 %
|
34
|
-
r = 1 %
|
35
|
-
++++
|
36
|
-
|
37
|
-
[stem]
|
38
|
-
++++
|
39
|
-
<mml:math><mml:msub xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"> <mml:mrow> <mml:mrow> <mml:mi mathvariant="bold-italic">F</mml:mi> </mml:mrow> </mml:mrow> <mml:mrow> <mml:mrow> <mml:mi mathvariant="bold-italic">Α</mml:mi> </mml:mrow> </mml:mrow> </mml:msub> </mml:math>
|
40
|
-
++++
|
41
|
-
INPUT
|
42
|
-
output = <<~OUTPUT
|
43
|
-
#{BLANK_HDR}
|
44
|
-
<sections>
|
45
|
-
<formula id="_">
|
46
|
-
<stem type="MathML">
|
47
|
-
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
48
|
-
<mi>r</mi>
|
49
|
-
<mo>=</mo>
|
50
|
-
<mn>1</mn>
|
51
|
-
<mo>%</mo>
|
52
|
-
<mi>r</mi>
|
53
|
-
<mo>=</mo>
|
54
|
-
<mn>1</mn>
|
55
|
-
<mo>%</mo>
|
56
|
-
</math>
|
57
|
-
</stem>
|
58
|
-
</formula>
|
59
|
-
<formula id="_">
|
60
|
-
<stem type="MathML">
|
61
|
-
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
62
|
-
<msub>
|
63
|
-
<mrow>
|
64
|
-
<mrow>
|
65
|
-
<mi mathvariant="bold-italic">F</mi>
|
66
|
-
</mrow>
|
67
|
-
</mrow>
|
68
|
-
<mrow>
|
69
|
-
<mrow>
|
70
|
-
<mi mathvariant="bold-italic">Α</mi>
|
71
|
-
</mrow>
|
72
|
-
</mrow>
|
73
|
-
</msub>
|
74
|
-
</math>
|
75
|
-
</stem>
|
76
|
-
</formula>
|
77
|
-
</sections>
|
78
|
-
</iso-standard>
|
79
|
-
OUTPUT
|
80
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
81
|
-
.to be_equivalent_to xmlpp(output)
|
82
|
-
end
|
83
|
-
|
84
|
-
it "ignores review blocks unless document is in draft mode" do
|
85
|
-
input = <<~INPUT
|
86
|
-
#{ASCIIDOC_BLANK_HDR}
|
87
|
-
[[foreword]]
|
88
|
-
.Foreword
|
89
|
-
Foreword
|
90
|
-
|
91
|
-
[reviewer=ISO,date=20170101,from=foreword,to=foreword]
|
92
|
-
****
|
93
|
-
A Foreword shall appear in each document. The generic text is shown here. It does not contain requirements, recommendations or permissions.
|
94
|
-
|
95
|
-
For further information on the Foreword, see *ISO/IEC Directives, Part 2, 2016, Clause 12.*
|
96
|
-
****
|
97
|
-
INPUT
|
98
|
-
output = <<~OUTPUT
|
99
|
-
#{BLANK_HDR}
|
100
|
-
<sections>
|
101
|
-
<p id="foreword">Foreword</p>
|
102
|
-
</sections>
|
103
|
-
</iso-standard>
|
104
|
-
OUTPUT
|
105
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
106
|
-
.to be_equivalent_to xmlpp(output)
|
107
|
-
end
|
108
|
-
|
109
|
-
it "processes review blocks if document is in draft mode" do
|
110
|
-
input = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
111
|
-
= Document title
|
112
|
-
Author
|
113
|
-
:docfile: test.adoc
|
114
|
-
:nodoc:
|
115
|
-
:novalid:
|
116
|
-
:draft: 1.2
|
117
|
-
:no-isobib:
|
118
|
-
|
119
|
-
[[foreword]]
|
120
|
-
.Foreword
|
121
|
-
Foreword
|
122
|
-
|
123
|
-
[reviewer=ISO,date=20170101,from=foreword,to=foreword]
|
124
|
-
****
|
125
|
-
A Foreword shall appear in each document. The generic text is shown here. It does not contain requirements, recommendations or permissions.
|
126
|
-
|
127
|
-
For further information on the Foreword, see *ISO/IEC Directives, Part 2, 2016, Clause 12.*
|
128
|
-
****
|
129
|
-
INPUT
|
130
|
-
output = <<~OUTPUT
|
131
|
-
<iso-standard>
|
132
|
-
<sections>
|
133
|
-
<p id="foreword">Foreword</p>
|
134
|
-
<review date="20170101T00:00:00Z" from="foreword" id="_" reviewer="ISO" to="foreword">
|
135
|
-
<p id="_">A Foreword shall appear in each document. The generic text is shown here. It does not contain requirements, recommendations or permissions.</p>
|
136
|
-
<p id="_">For further information on the Foreword, see
|
137
|
-
<strong>ISO/IEC Directives, Part 2, 2016, Clause 12.</strong></p>
|
138
|
-
</review>
|
139
|
-
</sections>
|
140
|
-
</iso-standard>
|
141
|
-
OUTPUT
|
142
|
-
expect(xmlpp(strip_guid(input)
|
143
|
-
.sub(/^.+<sections>/m, "<iso-standard><sections>")))
|
144
|
-
.to be_equivalent_to xmlpp(output)
|
145
|
-
end
|
146
|
-
|
147
|
-
it "processes term notes" do
|
148
|
-
input = <<~INPUT
|
149
|
-
#{ASCIIDOC_BLANK_HDR}
|
150
|
-
== Terms and Definitions
|
151
|
-
|
152
|
-
=== Term1
|
153
|
-
|
154
|
-
NOTE: This is a note
|
155
|
-
INPUT
|
156
|
-
output = <<~OUTPUT
|
157
|
-
#{BLANK_HDR}
|
158
|
-
<sections>
|
159
|
-
<terms id="_" obligation="normative">
|
160
|
-
<title>Terms and definitions</title>
|
161
|
-
#{TERM_BOILERPLATE}
|
162
|
-
<term id="term-Term1">
|
163
|
-
<preferred><expression><name>Term1</name></expression></preferred>
|
164
|
-
<termnote id="_">
|
165
|
-
<p id="_">This is a note</p></termnote>
|
166
|
-
</term>
|
167
|
-
</terms>
|
168
|
-
</sections>
|
169
|
-
</iso-standard>
|
170
|
-
OUTPUT
|
171
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
172
|
-
.to be_equivalent_to xmlpp(output)
|
173
|
-
end
|
174
|
-
|
175
|
-
it "processes notes" do
|
176
|
-
input = <<~INPUT
|
177
|
-
#{ASCIIDOC_BLANK_HDR}
|
178
|
-
NOTE: This is a note
|
179
|
-
INPUT
|
180
|
-
output = <<~OUTPUT
|
181
|
-
#{BLANK_HDR}
|
182
|
-
<sections>
|
183
|
-
<note id="_">
|
184
|
-
<p id="_">This is a note</p>
|
185
|
-
</note>
|
186
|
-
</sections>
|
187
|
-
</iso-standard>
|
188
|
-
OUTPUT
|
189
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
190
|
-
.to be_equivalent_to xmlpp(output)
|
191
|
-
end
|
192
|
-
|
193
|
-
it "processes literals" do
|
194
|
-
input = <<~INPUT
|
195
|
-
#{ASCIIDOC_BLANK_HDR}
|
196
|
-
....
|
197
|
-
LITERAL
|
198
|
-
....
|
199
|
-
INPUT
|
200
|
-
output = <<~OUTPUT
|
201
|
-
#{BLANK_HDR}
|
202
|
-
<sections>
|
203
|
-
<figure id="_">
|
204
|
-
<pre id="_">LITERAL</pre>
|
205
|
-
</figure>
|
206
|
-
</sections>
|
207
|
-
</iso-standard>
|
208
|
-
OUTPUT
|
209
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
210
|
-
.to be_equivalent_to xmlpp(output)
|
211
|
-
end
|
212
|
-
|
213
|
-
it "processes simple admonitions with Asciidoc names" do
|
214
|
-
input = <<~INPUT
|
215
|
-
#{ASCIIDOC_BLANK_HDR}
|
216
|
-
CAUTION: Only use paddy or parboiled rice for the determination of husked rice yield.
|
217
|
-
INPUT
|
218
|
-
output = <<~OUTPUT
|
219
|
-
#{BLANK_HDR}
|
220
|
-
<sections>
|
221
|
-
<admonition id="_" type="caution">
|
222
|
-
<p id="_">Only use paddy or parboiled rice for the determination of husked rice yield.</p>
|
223
|
-
</admonition>
|
224
|
-
</sections>
|
225
|
-
</iso-standard>
|
226
|
-
OUTPUT
|
227
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
228
|
-
.to be_equivalent_to xmlpp(output)
|
229
|
-
end
|
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
|
-
|
252
|
-
it "processes complex admonitions with non-Asciidoc names" do
|
253
|
-
input = <<~INPUT
|
254
|
-
#{ASCIIDOC_BLANK_HDR}
|
255
|
-
[CAUTION,type=Safety Precautions]
|
256
|
-
.Safety Precautions
|
257
|
-
====
|
258
|
-
While werewolves are hardy community members, keep in mind the following dietary concerns:
|
259
|
-
|
260
|
-
. They are allergic to cinnamon.
|
261
|
-
. More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.
|
262
|
-
. Celery makes them sad.
|
263
|
-
====
|
264
|
-
INPUT
|
265
|
-
output = <<~OUTPUT
|
266
|
-
#{BLANK_HDR}
|
267
|
-
<sections>
|
268
|
-
<admonition id="_" type="safety precautions">
|
269
|
-
<name>Safety Precautions</name>
|
270
|
-
<p id="_">While werewolves are hardy community members, keep in mind the following dietary concerns:</p>
|
271
|
-
<ol id="_">
|
272
|
-
<li>
|
273
|
-
<p id="_">They are allergic to cinnamon.</p>
|
274
|
-
</li>
|
275
|
-
<li>
|
276
|
-
<p id="_">More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.</p>
|
277
|
-
</li>
|
278
|
-
<li>
|
279
|
-
<p id="_">Celery makes them sad.</p>
|
280
|
-
</li>
|
281
|
-
</ol>
|
282
|
-
</admonition>
|
283
|
-
</sections>
|
284
|
-
</iso-standard>
|
285
|
-
OUTPUT
|
286
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
287
|
-
.to be_equivalent_to xmlpp(output)
|
288
|
-
end
|
289
|
-
|
290
|
-
it "processes term examples" do
|
291
|
-
input = <<~INPUT
|
292
|
-
#{ASCIIDOC_BLANK_HDR}
|
293
|
-
== Terms and Definitions
|
294
|
-
|
295
|
-
=== Term1
|
296
|
-
|
297
|
-
[example]
|
298
|
-
This is an example
|
299
|
-
INPUT
|
300
|
-
output = <<~OUTPUT
|
301
|
-
#{BLANK_HDR}
|
302
|
-
<sections>
|
303
|
-
<terms id="_" obligation="normative">
|
304
|
-
<title>Terms and definitions</title>
|
305
|
-
#{TERM_BOILERPLATE}
|
306
|
-
<term id="term-Term1">
|
307
|
-
<preferred><expression><name>Term1</name></expression></preferred>
|
308
|
-
<termexample id="_">
|
309
|
-
<p id="_">This is an example</p></termexample>
|
310
|
-
</term>
|
311
|
-
</terms>
|
312
|
-
</sections>
|
313
|
-
</iso-standard>
|
314
|
-
OUTPUT
|
315
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
316
|
-
.to be_equivalent_to xmlpp(output)
|
317
|
-
end
|
318
|
-
|
319
|
-
it "processes examples" do
|
320
|
-
input = <<~INPUT
|
321
|
-
#{ASCIIDOC_BLANK_HDR}
|
322
|
-
[example]
|
323
|
-
====
|
324
|
-
This is an example
|
325
|
-
|
326
|
-
Amen
|
327
|
-
====
|
328
|
-
INPUT
|
329
|
-
output = <<~OUTPUT
|
330
|
-
#{BLANK_HDR}
|
331
|
-
<sections>
|
332
|
-
<example id="_">
|
333
|
-
<p id="_">This is an example</p>
|
334
|
-
<p id="_">Amen</p>
|
335
|
-
</example>
|
336
|
-
</sections>
|
337
|
-
</iso-standard>
|
338
|
-
OUTPUT
|
339
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
340
|
-
.to be_equivalent_to xmlpp(output)
|
341
|
-
end
|
342
|
-
|
343
|
-
it "processes preambles" do
|
344
|
-
input = <<~INPUT
|
345
|
-
#{ASCIIDOC_BLANK_HDR}
|
346
|
-
This is a preamble
|
347
|
-
|
348
|
-
== Section 1
|
349
|
-
INPUT
|
350
|
-
output = <<~OUTPUT
|
351
|
-
#{BLANK_HDR}
|
352
|
-
<preface>
|
353
|
-
<foreword id="_" obligation="informative">
|
354
|
-
<title>Foreword</title>
|
355
|
-
<p id="_">This is a preamble</p>
|
356
|
-
</foreword>
|
357
|
-
</preface>
|
358
|
-
<sections>
|
359
|
-
<clause id="_" inline-header="false" obligation="normative">
|
360
|
-
<title>Section 1</title>
|
361
|
-
</clause>
|
362
|
-
</sections>
|
363
|
-
</iso-standard>
|
364
|
-
OUTPUT
|
365
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
366
|
-
.to be_equivalent_to xmlpp(output)
|
367
|
-
end
|
368
|
-
|
369
|
-
it "processes images" do
|
370
|
-
input = <<~INPUT
|
371
|
-
#{ASCIIDOC_BLANK_HDR}
|
372
|
-
.Split-it-right sample divider
|
373
|
-
image::spec/examples/rice_images/rice_image1.png[]
|
374
|
-
|
375
|
-
INPUT
|
376
|
-
output = <<~OUTPUT
|
377
|
-
#{BLANK_HDR}
|
378
|
-
<sections>
|
379
|
-
<figure id="_">
|
380
|
-
<name>Split-it-right sample divider</name>
|
381
|
-
<image height="auto" id="_" mimetype="image/png" src="spec/examples/rice_images/rice_image1.png" width="auto"/>
|
382
|
-
</figure>
|
383
|
-
</sections>
|
384
|
-
</iso-standard>
|
385
|
-
OUTPUT
|
386
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
387
|
-
.to be_equivalent_to xmlpp(output)
|
388
|
-
end
|
389
|
-
|
390
|
-
it "accepts width and height attributes on images" do
|
391
|
-
input = <<~INPUT
|
392
|
-
#{ASCIIDOC_BLANK_HDR}
|
393
|
-
[height=4,width=3]
|
394
|
-
image::spec/examples/rice_images/rice_image1.png[]
|
395
|
-
|
396
|
-
INPUT
|
397
|
-
output = <<~OUTPUT
|
398
|
-
#{BLANK_HDR}
|
399
|
-
<sections>
|
400
|
-
<figure id="_">
|
401
|
-
<image height="4" id="_" mimetype="image/png" src="spec/examples/rice_images/rice_image1.png" width="3"/>
|
402
|
-
</figure>
|
403
|
-
</sections>
|
404
|
-
</iso-standard>
|
405
|
-
OUTPUT
|
406
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
407
|
-
.to be_equivalent_to xmlpp(output)
|
408
|
-
end
|
409
|
-
|
410
|
-
it "accepts auto for width and height attributes on images" do
|
411
|
-
input = <<~INPUT
|
412
|
-
#{ASCIIDOC_BLANK_HDR}
|
413
|
-
[height=4,width=auto]
|
414
|
-
image::spec/examples/rice_images/rice_image1.png[]
|
415
|
-
|
416
|
-
INPUT
|
417
|
-
output = <<~OUTPUT
|
418
|
-
#{BLANK_HDR}
|
419
|
-
<sections>
|
420
|
-
<figure id="_">
|
421
|
-
<image height="4" id="_" mimetype="image/png" src="spec/examples/rice_images/rice_image1.png" width="auto"/>
|
422
|
-
</figure>
|
423
|
-
</sections>
|
424
|
-
</iso-standard>
|
425
|
-
OUTPUT
|
426
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
427
|
-
.to be_equivalent_to xmlpp(output)
|
428
|
-
end
|
429
|
-
|
430
|
-
it "accepts alignment attribute on paragraphs" do
|
431
|
-
input = <<~INPUT
|
432
|
-
#{ASCIIDOC_BLANK_HDR}
|
433
|
-
[align=right]
|
434
|
-
This para is right-aligned.
|
435
|
-
INPUT
|
436
|
-
output = <<~OUTPUT
|
437
|
-
#{BLANK_HDR}
|
438
|
-
<sections>
|
439
|
-
<p align="right" id="_">This para is right-aligned.</p>
|
440
|
-
</sections>
|
441
|
-
</iso-standard>
|
442
|
-
OUTPUT
|
443
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
444
|
-
.to be_equivalent_to xmlpp(output)
|
445
|
-
end
|
446
|
-
|
447
|
-
it "processes blockquotes" do
|
448
|
-
input = <<~INPUT
|
449
|
-
#{ASCIIDOC_BLANK_HDR}
|
450
|
-
[quote, ISO, "ISO7301,section 1"]
|
451
|
-
____
|
452
|
-
Block quotation
|
453
|
-
____
|
454
|
-
INPUT
|
455
|
-
output = <<~OUTPUT
|
456
|
-
#{BLANK_HDR}
|
457
|
-
<sections>
|
458
|
-
<quote id="_">
|
459
|
-
<source bibitemid="ISO7301" citeas="" type="inline">
|
460
|
-
<localityStack>
|
461
|
-
<locality type="section">
|
462
|
-
<referenceFrom>1</referenceFrom>
|
463
|
-
</locality>
|
464
|
-
</localityStack>
|
465
|
-
</source>
|
466
|
-
<author>ISO</author>
|
467
|
-
<p id="_">Block quotation</p>
|
468
|
-
</quote>
|
469
|
-
</sections>
|
470
|
-
</iso-standard>
|
471
|
-
OUTPUT
|
472
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
473
|
-
.to be_equivalent_to xmlpp(output)
|
474
|
-
end
|
475
|
-
|
476
|
-
it "processes source code" do
|
477
|
-
input = <<~INPUT
|
478
|
-
#{ASCIIDOC_BLANK_HDR}
|
479
|
-
[source,ruby]
|
480
|
-
--
|
481
|
-
puts "Hello, world."
|
482
|
-
%w{a b c}.each do |x|
|
483
|
-
puts x
|
484
|
-
end
|
485
|
-
--
|
486
|
-
INPUT
|
487
|
-
output = <<~OUTPUT
|
488
|
-
#{BLANK_HDR}
|
489
|
-
<sections>
|
490
|
-
<sourcecode id="_" lang="ruby">
|
491
|
-
puts "Hello, world."
|
492
|
-
%w{a b c}.each do |x|
|
493
|
-
puts x
|
494
|
-
end
|
495
|
-
</sourcecode>
|
496
|
-
</sections>
|
497
|
-
</iso-standard>
|
498
|
-
OUTPUT
|
499
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
500
|
-
.to be_equivalent_to xmlpp(output)
|
501
|
-
end
|
502
|
-
|
503
|
-
it "processes callouts" do
|
504
|
-
input = <<~INPUT
|
505
|
-
#{ASCIIDOC_BLANK_HDR}
|
506
|
-
[source,ruby]
|
507
|
-
--
|
508
|
-
puts "Hello, world." <1>
|
509
|
-
%w{a b c}.each do |x|
|
510
|
-
puts x <2>
|
511
|
-
end
|
512
|
-
--
|
513
|
-
<1> This is one callout
|
514
|
-
<2> This is another callout
|
515
|
-
INPUT
|
516
|
-
output = <<~OUTPUT
|
517
|
-
#{BLANK_HDR}
|
518
|
-
<sections>
|
519
|
-
<sourcecode id="_" lang="ruby">
|
520
|
-
puts "Hello, world." <callout target="_">1</callout>
|
521
|
-
%w{a b c}.each do |x|
|
522
|
-
puts x <callout target="_">2</callout>
|
523
|
-
end
|
524
|
-
<annotation id="_">
|
525
|
-
<p id="_">This is one callout</p>
|
526
|
-
</annotation>
|
527
|
-
<annotation id="_">
|
528
|
-
<p id="_">This is another callout</p>
|
529
|
-
</annotation>
|
530
|
-
</sourcecode>
|
531
|
-
</sections>
|
532
|
-
</iso-standard>
|
533
|
-
OUTPUT
|
534
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
535
|
-
.to be_equivalent_to xmlpp(output)
|
536
|
-
end
|
537
|
-
|
538
|
-
it "processes unmodified term sources" do
|
539
|
-
input = <<~INPUT
|
540
|
-
#{ASCIIDOC_BLANK_HDR}
|
541
|
-
== Terms and Definitions
|
542
|
-
|
543
|
-
=== Term1
|
544
|
-
|
545
|
-
Definition
|
546
|
-
|
547
|
-
[.source]
|
548
|
-
<<ISO2191,section=1>>
|
549
|
-
INPUT
|
550
|
-
output = <<~OUTPUT
|
551
|
-
#{BLANK_HDR}
|
552
|
-
<sections>
|
553
|
-
<terms id="_" obligation="normative">
|
554
|
-
<title>Terms and definitions</title>
|
555
|
-
#{TERM_BOILERPLATE}
|
556
|
-
<term id="term-Term1">
|
557
|
-
<preferred><expression><name>Term1</name></expression></preferred>
|
558
|
-
<definition>
|
559
|
-
<verbal-definition>
|
560
|
-
<p id='_'>Definition</p>
|
561
|
-
</verbal-definition>
|
562
|
-
</definition>
|
563
|
-
<termsource status='identical' type='authoritative'>
|
564
|
-
<origin bibitemid="ISO2191" citeas="" type="inline">
|
565
|
-
<localityStack>
|
566
|
-
<locality type="section">
|
567
|
-
<referenceFrom>1</referenceFrom></locality>
|
568
|
-
</localityStack>
|
569
|
-
</origin>
|
570
|
-
</termsource>
|
571
|
-
</term>
|
572
|
-
</terms>
|
573
|
-
</sections>
|
574
|
-
</iso-standard>
|
575
|
-
OUTPUT
|
576
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
577
|
-
.to be_equivalent_to xmlpp(output)
|
578
|
-
end
|
579
|
-
|
580
|
-
it "processes modified term sources" do
|
581
|
-
input = <<~INPUT
|
582
|
-
#{ASCIIDOC_BLANK_HDR}
|
583
|
-
== Terms and Definitions
|
584
|
-
|
585
|
-
=== Term1
|
586
|
-
|
587
|
-
Definition
|
588
|
-
|
589
|
-
[.source]
|
590
|
-
<<ISO2191,section=1>>, with adjustments
|
591
|
-
INPUT
|
592
|
-
output = <<~OUTPUT
|
593
|
-
#{BLANK_HDR}
|
594
|
-
<sections>
|
595
|
-
<terms id="_" obligation="normative">
|
596
|
-
<title>Terms and definitions</title>
|
597
|
-
#{TERM_BOILERPLATE}
|
598
|
-
<term id="term-Term1">
|
599
|
-
<preferred><expression><name>Term1</name></expression></preferred>
|
600
|
-
<definition>
|
601
|
-
<verbal-definition>
|
602
|
-
<p id='_'>Definition</p>
|
603
|
-
</verbal-definition>
|
604
|
-
</definition>
|
605
|
-
<termsource status='modified' type='authoritative'>
|
606
|
-
<origin bibitemid="ISO2191" citeas="" type="inline">
|
607
|
-
<localityStack>
|
608
|
-
<locality type="section">
|
609
|
-
<referenceFrom>1</referenceFrom></locality>
|
610
|
-
</localityStack>
|
611
|
-
</origin>
|
612
|
-
<modification>
|
613
|
-
<p id="_">with adjustments</p>
|
614
|
-
</modification>
|
615
|
-
</termsource>
|
616
|
-
</term>
|
617
|
-
</terms>
|
618
|
-
</sections>
|
619
|
-
</iso-standard>
|
620
|
-
OUTPUT
|
621
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
622
|
-
.to be_equivalent_to xmlpp(output)
|
623
|
-
end
|
624
|
-
end
|