metanorma-iso 1.10.4 → 1.10.5
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/front.rb +15 -2
- data/lib/asciidoctor/iso/front_id.rb +20 -17
- data/lib/asciidoctor/iso/isodoc.rng +6 -2
- data/lib/asciidoctor/iso/validate_image.rb +1 -1
- data/lib/isodoc/iso/base_convert.rb +14 -31
- data/lib/isodoc/iso/html/style-human.css +19 -8
- data/lib/isodoc/iso/html/style-human.scss +10 -8
- data/lib/isodoc/iso/html/style-iso.css +14 -5
- data/lib/isodoc/iso/html/style-iso.scss +5 -5
- data/lib/isodoc/iso/html/wordstyle.css +10 -8
- data/lib/isodoc/iso/html/wordstyle.scss +10 -8
- data/lib/isodoc/iso/index.rb +53 -45
- data/lib/isodoc/iso/iso.amendment.xsl +54 -2
- data/lib/isodoc/iso/iso.international-standard.xsl +54 -2
- data/lib/isodoc/iso/metadata.rb +27 -22
- data/lib/isodoc/iso/presentation_xml_convert.rb +41 -16
- data/lib/isodoc/iso/sts_convert.rb +2 -4
- data/lib/metanorma/iso/version.rb +1 -1
- data/spec/asciidoctor/base_spec.rb +397 -545
- data/spec/isodoc/amd_spec.rb +261 -250
- data/spec/isodoc/inline_spec.rb +238 -212
- data/spec/isodoc/iso_spec.rb +3 -1
- data/spec/isodoc/terms_spec.rb +4 -4
- data/spec/vcr_cassettes/docrels.yml +31 -421
- metadata +2 -2
data/spec/isodoc/inline_spec.rb
CHANGED
@@ -131,27 +131,28 @@ RSpec.describe IsoDoc do
|
|
131
131
|
<sections>
|
132
132
|
</iso-standard>
|
133
133
|
INPUT
|
134
|
-
expect(xmlpp(output
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
134
|
+
expect(xmlpp(output
|
135
|
+
.sub(/<html/, "<html xmlns:m='m'")))
|
136
|
+
.to be_equivalent_to xmlpp(<<~"OUTPUT")
|
137
|
+
#{HTML_HDR.sub(/<html/, "<html xmlns:m='m'")}
|
138
|
+
<br/>
|
139
|
+
<div>
|
140
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
141
|
+
<p>
|
142
|
+
<span class="stem">(#(A)#)</span>
|
143
|
+
<span class="stem">
|
144
|
+
<m:math>
|
145
|
+
<m:row>X</m:row>
|
146
|
+
</m:math>
|
147
|
+
</span>
|
148
|
+
<span class="stem">Latex?</span>
|
149
|
+
</p>
|
150
|
+
</div>
|
151
|
+
<p class="zzSTDTitle1"/>
|
152
|
+
</div>
|
153
|
+
</body>
|
154
|
+
</html>
|
155
|
+
OUTPUT
|
155
156
|
end
|
156
157
|
|
157
158
|
it "overrides AsciiMath delimiters" do
|
@@ -233,165 +234,166 @@ RSpec.describe IsoDoc do
|
|
233
234
|
end
|
234
235
|
|
235
236
|
it "processes eref content" do
|
236
|
-
output = IsoDoc::Iso::PresentationXMLConvert.new({})
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
expect(xmlpp(output)
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
237
|
+
output = IsoDoc::Iso::PresentationXMLConvert.new({})
|
238
|
+
.convert("test", <<~"INPUT", true)
|
239
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
240
|
+
<preface>
|
241
|
+
<foreword>
|
242
|
+
<p>
|
243
|
+
<eref bibitemid="IEV" citeas="IEV" type="inline">
|
244
|
+
<locality type="clause">
|
245
|
+
<referenceFrom>1-2-3</referenceFrom>
|
246
|
+
</locality>
|
247
|
+
</eref>
|
248
|
+
<eref bibitemid="ISO712" citeas="ISO 712" type="inline"/>
|
249
|
+
<eref bibitemid="ISO712" type="inline"/>
|
250
|
+
<eref bibitemid="ISO712" type="inline">
|
251
|
+
<locality type="table">
|
252
|
+
<referenceFrom>1</referenceFrom>
|
253
|
+
</locality>
|
254
|
+
</eref>
|
255
|
+
<eref bibitemid="ISO712" type="inline">
|
256
|
+
<locality type="table">
|
257
|
+
<referenceFrom>1</referenceFrom>
|
258
|
+
<referenceTo>1</referenceTo>
|
259
|
+
</locality>
|
260
|
+
</eref>
|
261
|
+
<eref bibitemid="ISO712" type="inline">
|
262
|
+
<locality type="clause">
|
263
|
+
<referenceFrom>1</referenceFrom>
|
264
|
+
</locality>
|
265
|
+
<locality type="table">
|
266
|
+
<referenceFrom>1</referenceFrom>
|
267
|
+
</locality>
|
268
|
+
</eref>
|
269
|
+
<eref bibitemid="ISO712" type="inline">
|
270
|
+
<locality type="clause">
|
271
|
+
<referenceFrom>1</referenceFrom>
|
272
|
+
</locality>
|
273
|
+
<locality type="list">
|
274
|
+
<referenceFrom>a</referenceFrom>
|
275
|
+
</locality>
|
276
|
+
</eref>
|
277
|
+
<eref bibitemid="ISO712" type="inline">
|
278
|
+
<locality type="clause">
|
279
|
+
<referenceFrom>1</referenceFrom>
|
280
|
+
</locality>
|
281
|
+
</eref>
|
282
|
+
<eref bibitemid="ISO712" type="inline">
|
283
|
+
<locality type="clause">
|
284
|
+
<referenceFrom>1.5</referenceFrom>
|
285
|
+
</locality>
|
286
|
+
</eref>
|
287
|
+
<eref bibitemid="ISO712" type="inline">
|
288
|
+
<locality type="table">
|
289
|
+
<referenceFrom>1</referenceFrom>
|
290
|
+
</locality>A</eref>
|
291
|
+
<eref bibitemid="ISO712" type="inline">
|
292
|
+
<locality type="whole"/>
|
293
|
+
</eref>
|
294
|
+
<eref bibitemid="ISO712" type="inline">
|
295
|
+
<locality type="locality:prelude">
|
296
|
+
<referenceFrom>7</referenceFrom>
|
297
|
+
</locality>
|
298
|
+
</eref>
|
299
|
+
<eref bibitemid="ISO712" citeas="ISO 712" type="inline">A</eref>
|
300
|
+
</p>
|
301
|
+
</foreword>
|
302
|
+
</preface>
|
303
|
+
<bibliography>
|
304
|
+
<references id="_normative_references" normative="true" obligation="informative">
|
305
|
+
<title>Normative References</title>
|
306
|
+
<bibitem id="ISO712" type="standard">
|
307
|
+
<title format="text/plain">Cereals and cereal products</title>
|
308
|
+
<docidentifier>ISO 712</docidentifier>
|
309
|
+
<contributor>
|
310
|
+
<role type="publisher"/>
|
311
|
+
<organization>
|
312
|
+
<abbreviation>ISO</abbreviation>
|
313
|
+
</organization>
|
314
|
+
</contributor>
|
315
|
+
</bibitem>
|
316
|
+
</references>
|
317
|
+
</bibliography>
|
318
|
+
</iso-standard>
|
319
|
+
INPUT
|
320
|
+
expect(xmlpp(output)
|
321
|
+
.sub(%r{<i18nyaml>.*</i18nyaml>}m, ""))
|
322
|
+
.to be_equivalent_to xmlpp(<<~"OUTPUT")
|
323
|
+
<?xml version='1.0'?>
|
324
|
+
<iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
|
325
|
+
<preface>
|
326
|
+
<foreword displayorder="1">
|
327
|
+
<p>
|
328
|
+
<eref bibitemid="IEV" citeas="IEV" type="inline">
|
329
|
+
<locality type="clause">
|
330
|
+
<referenceFrom>1-2-3</referenceFrom>
|
331
|
+
</locality>IEV, 1-2-3</eref>
|
332
|
+
<eref bibitemid="ISO712" citeas="ISO 712" type="inline">ISO 712</eref>
|
333
|
+
<eref bibitemid="ISO712" type="inline">ISO 712</eref>
|
334
|
+
<eref bibitemid="ISO712" type="inline">
|
335
|
+
<locality type="table">
|
336
|
+
<referenceFrom>1</referenceFrom>
|
337
|
+
</locality>ISO 712, Table 1</eref>
|
338
|
+
<eref bibitemid="ISO712" type="inline">
|
339
|
+
<locality type="table">
|
340
|
+
<referenceFrom>1</referenceFrom>
|
341
|
+
<referenceTo>1</referenceTo>
|
342
|
+
</locality>ISO 712, Table 1–1</eref>
|
343
|
+
<eref bibitemid="ISO712" type="inline">
|
344
|
+
<locality type="clause">
|
345
|
+
<referenceFrom>1</referenceFrom>
|
346
|
+
</locality>
|
347
|
+
<locality type="table">
|
348
|
+
<referenceFrom>1</referenceFrom>
|
349
|
+
</locality>ISO 712, Clause 1, Table 1</eref>
|
350
|
+
<eref bibitemid="ISO712" type="inline">
|
351
|
+
<locality type="clause">
|
352
|
+
<referenceFrom>1</referenceFrom>
|
353
|
+
</locality>
|
354
|
+
<locality type="list">
|
355
|
+
<referenceFrom>a</referenceFrom>
|
356
|
+
</locality>ISO 712, Clause 1 a)</eref>
|
357
|
+
<eref bibitemid="ISO712" type="inline">
|
358
|
+
<locality type="clause">
|
359
|
+
<referenceFrom>1</referenceFrom>
|
360
|
+
</locality>ISO 712, Clause 1</eref>
|
361
|
+
<eref bibitemid="ISO712" type="inline">
|
362
|
+
<locality type="clause">
|
363
|
+
<referenceFrom>1.5</referenceFrom>
|
364
|
+
</locality>ISO 712, 1.5</eref>
|
365
|
+
<eref bibitemid="ISO712" type="inline">
|
366
|
+
<locality type="table">
|
367
|
+
<referenceFrom>1</referenceFrom>
|
368
|
+
</locality>A</eref>
|
369
|
+
<eref bibitemid="ISO712" type="inline">
|
370
|
+
<locality type="whole"/>ISO 712, Whole of text</eref>
|
371
|
+
<eref bibitemid="ISO712" type="inline">
|
372
|
+
<locality type="locality:prelude">
|
373
|
+
<referenceFrom>7</referenceFrom>
|
374
|
+
</locality>ISO 712, Prelude 7</eref>
|
375
|
+
<eref bibitemid="ISO712" citeas="ISO 712" type="inline">A</eref>
|
376
|
+
</p>
|
377
|
+
</foreword>
|
378
|
+
</preface>
|
379
|
+
<bibliography>
|
380
|
+
<references id="_normative_references" normative="true" obligation="informative" displayorder="2">
|
381
|
+
<title depth="1">1<tab/>
|
382
|
+
Normative References</title>
|
383
|
+
<bibitem id="ISO712" type="standard">
|
384
|
+
<title format="text/plain">Cereals and cereal products</title>
|
385
|
+
<docidentifier>ISO 712</docidentifier>
|
386
|
+
<contributor>
|
387
|
+
<role type="publisher"/>
|
388
|
+
<organization>
|
389
|
+
<abbreviation>ISO</abbreviation>
|
390
|
+
</organization>
|
391
|
+
</contributor>
|
392
|
+
</bibitem>
|
393
|
+
</references>
|
394
|
+
</bibliography>
|
395
|
+
</iso-standard>
|
396
|
+
OUTPUT
|
395
397
|
end
|
396
398
|
|
397
399
|
it "processes concept markup" do
|
@@ -726,43 +728,67 @@ RSpec.describe IsoDoc do
|
|
726
728
|
</concept></li>
|
727
729
|
</ul>
|
728
730
|
</term>
|
731
|
+
<term id="clause2">
|
732
|
+
<ul>
|
733
|
+
<li><concept><refterm>term1</refterm>
|
734
|
+
<renderterm>term</renderterm>
|
735
|
+
<xref target='clause1'/>
|
736
|
+
</concept></li>
|
737
|
+
<li><concept><refterm>term1</refterm>
|
738
|
+
<renderterm>term</renderterm>
|
739
|
+
<xref target='clause1'/>
|
740
|
+
</concept></li>
|
741
|
+
</ul>
|
742
|
+
</term>
|
729
743
|
</terms>
|
730
744
|
</sections>
|
731
745
|
</iso-standard>
|
732
746
|
INPUT
|
733
747
|
presxml = <<~OUTPUT
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
748
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
749
|
+
<preface>
|
750
|
+
<foreword id='A' displayorder='1'>
|
751
|
+
<ul>
|
752
|
+
<li>term</li>
|
753
|
+
</ul>
|
754
|
+
</foreword>
|
755
|
+
</preface>
|
756
|
+
<sections>
|
757
|
+
<terms id='Terms' displayorder='2'>
|
758
|
+
<title>1</title>
|
759
|
+
<clause id='A' inline-header='true'>
|
760
|
+
<title>1.1</title>
|
761
|
+
<ul>
|
762
|
+
<li> term </li>
|
763
|
+
</ul>
|
764
|
+
</clause>
|
765
|
+
<term id='clause1'>
|
766
|
+
<name>1.2</name>
|
767
|
+
<ul>
|
768
|
+
<li>
|
769
|
+
<em>term</em>
|
770
|
+
(
|
771
|
+
<xref target='clause1'>1.2</xref>
|
772
|
+
)
|
773
|
+
</li>
|
774
|
+
<li> term </li>
|
775
|
+
</ul>
|
776
|
+
</term>
|
777
|
+
<term id='clause2'>
|
778
|
+
<name>1.3</name>
|
779
|
+
<ul>
|
780
|
+
<li>
|
781
|
+
<em>term</em>
|
782
|
+
(
|
783
|
+
<xref target='clause1'>1.2</xref>
|
784
|
+
)
|
785
|
+
</li>
|
786
|
+
<li> term </li>
|
787
|
+
</ul>
|
788
|
+
</term>
|
789
|
+
</terms>
|
790
|
+
</sections>
|
791
|
+
</iso-standard>
|
766
792
|
OUTPUT
|
767
793
|
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
|
768
794
|
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
data/spec/isodoc/iso_spec.rb
CHANGED
@@ -57,7 +57,9 @@ RSpec.describe IsoDoc::Iso do
|
|
57
57
|
end
|
58
58
|
|
59
59
|
it "processes isodoc as ISO: user nominated fonts" do
|
60
|
-
IsoDoc::Iso::HtmlConvert.new(bodyfont: "Zapf Chancery",
|
60
|
+
IsoDoc::Iso::HtmlConvert.new(bodyfont: "Zapf Chancery",
|
61
|
+
headerfont: "Comic Sans",
|
62
|
+
monospacefont: "Andale Mono")
|
61
63
|
.convert("test", <<~"INPUT", false)
|
62
64
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
63
65
|
<preface>
|
data/spec/isodoc/terms_spec.rb
CHANGED
@@ -39,15 +39,15 @@ RSpec.describe IsoDoc do
|
|
39
39
|
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e">
|
40
40
|
<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>
|
41
41
|
</termnote>
|
42
|
-
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74f">
|
43
|
-
<ul><li>A</li></ul>
|
44
|
-
<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>
|
45
|
-
</termnote>
|
46
42
|
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
|
47
43
|
<ul>
|
48
44
|
<li>A</li>
|
49
45
|
</ul>
|
50
46
|
</termexample>
|
47
|
+
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74f">
|
48
|
+
<ul><li>A</li></ul>
|
49
|
+
<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>
|
50
|
+
</termnote>
|
51
51
|
<termsource status="identical">
|
52
52
|
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
|
53
53
|
</termsource>
|