isodoc 1.7.5 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/isodoc.gemspec +8 -7
- data/lib/isodoc/class_utils.rb +25 -2
- data/lib/isodoc/convert.rb +2 -0
- data/lib/isodoc/function/cleanup.rb +4 -0
- data/lib/isodoc/function/to_word_html.rb +2 -1
- data/lib/isodoc/function/utils.rb +34 -14
- data/lib/isodoc/html_function/comments.rb +107 -111
- data/lib/isodoc/html_function/footnotes.rb +68 -67
- data/lib/isodoc/html_function/html.rb +113 -103
- data/lib/isodoc/presentation_function/block.rb +1 -69
- data/lib/isodoc/presentation_function/image.rb +112 -0
- data/lib/isodoc/presentation_function/inline.rb +16 -78
- data/lib/isodoc/presentation_function/terms.rb +179 -0
- data/lib/isodoc/presentation_xml_convert.rb +11 -4
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/body.rb +176 -174
- data/lib/isodoc/word_function/comments.rb +117 -112
- data/lib/isodoc/word_function/footnotes.rb +88 -86
- data/lib/isodoc/word_function/inline.rb +42 -67
- data/lib/isodoc/word_function/postprocess.rb +184 -176
- data/lib/isodoc/word_function/postprocess_cover.rb +121 -110
- data/lib/isodoc/xref/xref_gen.rb +153 -150
- data/lib/isodoc/xref/xref_sect_gen.rb +134 -129
- data/lib/isodoc/xslfo_convert.rb +11 -7
- data/lib/isodoc-yaml/i18n-ar.yaml +22 -0
- data/lib/isodoc-yaml/i18n-de.yaml +20 -0
- data/lib/isodoc-yaml/i18n-en.yaml +20 -0
- data/lib/isodoc-yaml/i18n-es.yaml +20 -0
- data/lib/isodoc-yaml/i18n-fr.yaml +20 -0
- data/lib/isodoc-yaml/i18n-ru.yaml +21 -1
- data/lib/isodoc-yaml/i18n-zh-Hans.yaml +21 -0
- data/lib/metanorma/output/xslfo.rb +4 -11
- data/spec/assets/i18n.yaml +3 -1
- data/spec/assets/odf.svg +1 -4
- data/spec/isodoc/blocks_spec.rb +229 -157
- data/spec/isodoc/i18n_spec.rb +8 -8
- data/spec/isodoc/inline_spec.rb +285 -32
- data/spec/isodoc/postproc_spec.rb +38 -0
- data/spec/isodoc/presentation_xml_spec.rb +60 -0
- data/spec/isodoc/section_spec.rb +11 -10
- data/spec/isodoc/terms_spec.rb +354 -34
- data/spec/isodoc/xref_spec.rb +4 -4
- data/spec/isodoc/xslfo_convert_spec.rb +34 -9
- metadata +49 -33
data/spec/isodoc/terms_spec.rb
CHANGED
@@ -7,9 +7,16 @@ RSpec.describe IsoDoc do
|
|
7
7
|
<sections>
|
8
8
|
<terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
|
9
9
|
<p>For the purposes of this document, the following terms and definitions apply.</p>
|
10
|
-
<term id="paddy1"><preferred>paddy</
|
10
|
+
<term id="paddy1"><preferred><expression><name>paddy</name></expression>
|
11
|
+
<termsource status="modified">
|
12
|
+
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
|
13
|
+
<modification>
|
14
|
+
<p id="_e73a417d-ad39-417d-a4c8-20e4e2529489">The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</p>
|
15
|
+
</modification>
|
16
|
+
</termsource>
|
17
|
+
</preferred>
|
11
18
|
<domain>rice</domain>
|
12
|
-
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
19
|
+
<definition><verbaldefinition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbaldefinition></definition>
|
13
20
|
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" keep-with-next="true" keep-lines-together="true">
|
14
21
|
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
15
22
|
<ul>
|
@@ -21,12 +28,6 @@ RSpec.describe IsoDoc do
|
|
21
28
|
<li>A</li>
|
22
29
|
</ul>
|
23
30
|
</termexample>
|
24
|
-
<termsource status="modified">
|
25
|
-
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
|
26
|
-
<modification>
|
27
|
-
<p id="_e73a417d-ad39-417d-a4c8-20e4e2529489">The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</p>
|
28
|
-
</modification>
|
29
|
-
</termsource>
|
30
31
|
<termsource status='identical'>
|
31
32
|
<origin citeas=''>
|
32
33
|
<termref base='IEV' target='xyz'>t1</termref>
|
@@ -41,10 +42,11 @@ RSpec.describe IsoDoc do
|
|
41
42
|
</modification>
|
42
43
|
</termsource>
|
43
44
|
</term>
|
44
|
-
<term id="paddy"><preferred>paddy</preferred
|
45
|
-
<admitted>
|
46
|
-
<
|
47
|
-
<
|
45
|
+
<term id="paddy"><preferred><expression><name>paddy</name></expression></preferred>
|
46
|
+
<admitted><letter-symbol><name>paddy rice</name></letter-symbol></admitted>
|
47
|
+
<admitted><expression><name>rough rice</name></expression></admitted>
|
48
|
+
<deprecates><expression><name>cargo rice</name></expression></deprecates>
|
49
|
+
<definition><verbaldefinition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbaldefinition></definition>
|
48
50
|
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
|
49
51
|
<ul>
|
50
52
|
<li>A</li>
|
@@ -78,6 +80,17 @@ RSpec.describe IsoDoc do
|
|
78
80
|
<p>For the purposes of this document, the following terms and definitions apply.</p>
|
79
81
|
<term id='paddy1'><name>1.1.</name>
|
80
82
|
<preferred>paddy</preferred>
|
83
|
+
<termsource status='modified'>
|
84
|
+
<origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'>
|
85
|
+
<referenceFrom>3.1</referenceFrom>
|
86
|
+
</locality>ISO 7301:2011, Clause 3.1</origin>
|
87
|
+
<modification>
|
88
|
+
<p id='_e73a417d-ad39-417d-a4c8-20e4e2529489'>
|
89
|
+
The term "cargo rice" is shown as deprecated, and Note 1 to entry
|
90
|
+
is not included here
|
91
|
+
</p>
|
92
|
+
</modification>
|
93
|
+
</termsource>
|
81
94
|
<domain>rice</domain>
|
82
95
|
<definition>
|
83
96
|
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
|
@@ -95,17 +108,6 @@ RSpec.describe IsoDoc do
|
|
95
108
|
<li>A</li>
|
96
109
|
</ul>
|
97
110
|
</termexample>
|
98
|
-
<termsource status='modified'>
|
99
|
-
<origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'>
|
100
|
-
<referenceFrom>3.1</referenceFrom>
|
101
|
-
</locality>ISO 7301:2011, Clause 3.1</origin>
|
102
|
-
<modification>
|
103
|
-
<p id='_e73a417d-ad39-417d-a4c8-20e4e2529489'>
|
104
|
-
The term "cargo rice" is shown as deprecated, and Note 1 to entry
|
105
|
-
is not included here
|
106
|
-
</p>
|
107
|
-
</modification>
|
108
|
-
</termsource>
|
109
111
|
<termsource status='identical'>
|
110
112
|
<origin citeas=''>
|
111
113
|
<termref base='IEV' target='xyz'>t1</termref>
|
@@ -173,6 +175,10 @@ RSpec.describe IsoDoc do
|
|
173
175
|
<p>For the purposes of this document,
|
174
176
|
the following terms and definitions apply.</p>
|
175
177
|
<p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
|
178
|
+
<p>[TERMREF]
|
179
|
+
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
180
|
+
[MODIFICATION] The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
181
|
+
[/TERMREF]</p>
|
176
182
|
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p>
|
177
183
|
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example" style='page-break-after: avoid;page-break-inside: avoid;'><p class="example-title">EXAMPLE 1</p>
|
178
184
|
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
@@ -185,10 +191,6 @@ RSpec.describe IsoDoc do
|
|
185
191
|
<li>A</li>
|
186
192
|
</ul>
|
187
193
|
</div>
|
188
|
-
<p>[TERMREF]
|
189
|
-
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
190
|
-
[MODIFICATION] The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
191
|
-
[/TERMREF]</p>
|
192
194
|
<p>[TERMREF] t1 [/TERMREF]</p>
|
193
195
|
<p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
|
194
196
|
<p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
|
@@ -217,6 +219,10 @@ RSpec.describe IsoDoc do
|
|
217
219
|
<div id="_terms_and_definitions"><h1>1.<span style="mso-tab-count:1">  </span>Terms and Definitions</h1><p>For the purposes of this document,
|
218
220
|
the following terms and definitions apply.</p>
|
219
221
|
<p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
|
222
|
+
<p>[TERMREF]
|
223
|
+
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
224
|
+
[MODIFICATION] The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
225
|
+
[/TERMREF]</p>
|
220
226
|
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p>
|
221
227
|
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example" style='page-break-after: avoid;page-break-inside: avoid;'><p class="example-title">EXAMPLE 1</p>
|
222
228
|
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
@@ -229,10 +235,6 @@ RSpec.describe IsoDoc do
|
|
229
235
|
<li>A</li>
|
230
236
|
</ul>
|
231
237
|
</div>
|
232
|
-
<p>[TERMREF]
|
233
|
-
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
234
|
-
[MODIFICATION] The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
235
|
-
[/TERMREF]</p>
|
236
238
|
<p>[TERMREF] t1 [/TERMREF]</p>
|
237
239
|
<p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
|
238
240
|
<p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
|
@@ -268,16 +270,17 @@ RSpec.describe IsoDoc do
|
|
268
270
|
<sections>
|
269
271
|
<terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
|
270
272
|
<p>For the purposes of this document, the following terms and definitions apply.</p>
|
271
|
-
<term id="paddy1"><preferred>paddy</preferred>
|
273
|
+
<term id="paddy1"><preferred><expression><name>paddy</name></expression></preferred>
|
272
274
|
<domain>rice</domain>
|
273
|
-
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
274
|
-
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747e">rice retaining its husk after threshing, mark 2</p>
|
275
|
+
<definition><verbaldefinition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbaldefinition></definition>
|
276
|
+
<definition><verbaldefinition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747e">rice retaining its husk after threshing, mark 2</p>
|
275
277
|
<termsource status="modified">
|
276
278
|
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
|
277
279
|
<modification>
|
278
280
|
<p id="_e73a417d-ad39-417d-a4c8-20e4e2529489">The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</p>
|
279
281
|
</modification>
|
280
282
|
</termsource>
|
283
|
+
</verbaldefinition>
|
281
284
|
</definition>
|
282
285
|
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" keep-with-next="true" keep-lines-together="true">
|
283
286
|
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
@@ -377,4 +380,321 @@ RSpec.describe IsoDoc do
|
|
377
380
|
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
378
381
|
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
379
382
|
end
|
383
|
+
|
384
|
+
it "processes IsoXML term with multiple preferred terms" do
|
385
|
+
input = <<~"INPUT"
|
386
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
387
|
+
<sections>
|
388
|
+
<terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
|
389
|
+
<term id="paddy1">
|
390
|
+
<preferred><expression><name>paddy</name></expression></preferred>
|
391
|
+
<preferred><expression><name>muddy rice</name></expression></preferred>
|
392
|
+
<domain>rice</domain>
|
393
|
+
<definition><verbaldefinition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbaldefinition></definition>
|
394
|
+
</term>
|
395
|
+
</terms>
|
396
|
+
</sections>
|
397
|
+
</iso-standard>
|
398
|
+
INPUT
|
399
|
+
presxml = <<~PRESXML
|
400
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
401
|
+
<sections>
|
402
|
+
<terms id='_terms_and_definitions' obligation='normative' displayorder='1'>
|
403
|
+
<title depth='1'>
|
404
|
+
1.
|
405
|
+
<tab/>
|
406
|
+
Terms and Definitions
|
407
|
+
</title>
|
408
|
+
<term id='paddy1'>
|
409
|
+
<name>1.1.</name>
|
410
|
+
<preferred>paddy; muddy rice</preferred>
|
411
|
+
<domain>rice</domain>
|
412
|
+
<definition>
|
413
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
|
414
|
+
</definition>
|
415
|
+
</term>
|
416
|
+
</terms>
|
417
|
+
</sections>
|
418
|
+
</iso-standard>
|
419
|
+
PRESXML
|
420
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
421
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
422
|
+
end
|
423
|
+
|
424
|
+
it "processes IsoXML term with grammatical information" do
|
425
|
+
input = <<~"INPUT"
|
426
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
427
|
+
<sections>
|
428
|
+
<terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
|
429
|
+
<term id="paddy1">
|
430
|
+
<preferred><expression><name>paddy</name>
|
431
|
+
<grammar>
|
432
|
+
<gender>masculine</gender>
|
433
|
+
<gender>feminine</gender>
|
434
|
+
<isPreposition>false</isPreposition>
|
435
|
+
<isNoun>true</isNoun>
|
436
|
+
<grammarValue>irregular declension</grammarValue>
|
437
|
+
</grammar>
|
438
|
+
</expression></preferred>
|
439
|
+
<preferred><expression><name>muddy rice</name>
|
440
|
+
<grammar>
|
441
|
+
<gender>neuter</gender>
|
442
|
+
<isNoun>true</isNoun>
|
443
|
+
<grammarValue>irregular declension</grammarValue>
|
444
|
+
</grammar>
|
445
|
+
</expression></preferred>
|
446
|
+
<domain>rice</domain>
|
447
|
+
<definition><verbaldefinition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbaldefinition></definition>
|
448
|
+
</term>
|
449
|
+
</terms>
|
450
|
+
</sections>
|
451
|
+
</iso-standard>
|
452
|
+
INPUT
|
453
|
+
presxml = <<~PRESXML
|
454
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
455
|
+
<sections>
|
456
|
+
<terms id='_terms_and_definitions' obligation='normative' displayorder='1'>
|
457
|
+
<title depth='1'>
|
458
|
+
1.
|
459
|
+
<tab/>
|
460
|
+
Terms and Definitions
|
461
|
+
</title>
|
462
|
+
<term id='paddy1'>
|
463
|
+
<name>1.1.</name>
|
464
|
+
<preferred>paddy masc, fem, n; muddy rice neut, n</preferred>
|
465
|
+
<domain>rice</domain>
|
466
|
+
<definition>
|
467
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
|
468
|
+
</definition>
|
469
|
+
</term>
|
470
|
+
</terms>
|
471
|
+
</sections>
|
472
|
+
</iso-standard>
|
473
|
+
PRESXML
|
474
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
475
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
476
|
+
end
|
477
|
+
|
478
|
+
it "processes IsoXML term with empty or graphical designations" do
|
479
|
+
input = <<~"INPUT"
|
480
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
481
|
+
<sections>
|
482
|
+
<terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
|
483
|
+
<term id="paddy1">
|
484
|
+
<preferred><expression><name/></expression></preferred>
|
485
|
+
<preferred isInternational='true'><graphical-symbol><figure id='_'><pre id='_'><LITERAL> FIGURATIVE</pre></figure>
|
486
|
+
</graphical-symbol>
|
487
|
+
</preferred>
|
488
|
+
<domain>rice</domain>
|
489
|
+
<definition><verbaldefinition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbaldefinition></definition>
|
490
|
+
</term>
|
491
|
+
</terms>
|
492
|
+
</sections>
|
493
|
+
</iso-standard>
|
494
|
+
INPUT
|
495
|
+
presxml = <<~PRESXML
|
496
|
+
<?xml version='1.0'?>
|
497
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
498
|
+
<sections>
|
499
|
+
<terms id='_terms_and_definitions' obligation='normative' displayorder='1'>
|
500
|
+
<title depth='1'>1.<tab/>Terms and Definitions</title>
|
501
|
+
<term id='paddy1'>
|
502
|
+
<name>1.1.</name>
|
503
|
+
<preferred>; <figure id='_'>
|
504
|
+
<name>Figure 1</name>
|
505
|
+
<pre id='_'><LITERAL> FIGURATIVE</pre>
|
506
|
+
</figure>
|
507
|
+
</preferred>
|
508
|
+
<domain>rice</domain>
|
509
|
+
<definition>
|
510
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
|
511
|
+
</definition>
|
512
|
+
</term>
|
513
|
+
</terms>
|
514
|
+
</sections>
|
515
|
+
</iso-standard>
|
516
|
+
PRESXML
|
517
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
518
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
519
|
+
end
|
520
|
+
|
521
|
+
it "processes IsoXML term with nonverbal definitions" do
|
522
|
+
input = <<~"INPUT"
|
523
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
524
|
+
<sections>
|
525
|
+
<terms id='A' obligation='normative'>
|
526
|
+
<title>Terms and definitions</title>
|
527
|
+
<p id='B'>For the purposes of this document, the following terms and definitions apply.</p>
|
528
|
+
<term id='term-term'>
|
529
|
+
<preferred>
|
530
|
+
<expression>
|
531
|
+
<name>Term</name>
|
532
|
+
</expression>
|
533
|
+
</preferred>
|
534
|
+
<definition>
|
535
|
+
<verbaldefinition>
|
536
|
+
<p id='C'>Definition</p>
|
537
|
+
<termsource status='identical' type='authoritative'>
|
538
|
+
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
539
|
+
<localityStack>
|
540
|
+
<locality type='section'>
|
541
|
+
<referenceFrom>1</referenceFrom>
|
542
|
+
</locality>
|
543
|
+
</localityStack>
|
544
|
+
</origin>
|
545
|
+
</termsource>
|
546
|
+
</verbaldefinition>
|
547
|
+
<nonverbalrepresentation>
|
548
|
+
<table id='D'>
|
549
|
+
<thead>
|
550
|
+
<tr>
|
551
|
+
<th valign='top' align='left'>A</th>
|
552
|
+
<th valign='top' align='left'>B</th>
|
553
|
+
</tr>
|
554
|
+
</thead>
|
555
|
+
<tbody>
|
556
|
+
<tr>
|
557
|
+
<td valign='top' align='left'>C</td>
|
558
|
+
<td valign='top' align='left'>D</td>
|
559
|
+
</tr>
|
560
|
+
</tbody>
|
561
|
+
</table>
|
562
|
+
</nonverbalrepresentation>
|
563
|
+
</definition>
|
564
|
+
<termsource status='identical' type='authoritative'>
|
565
|
+
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
566
|
+
<localityStack>
|
567
|
+
<locality type='section'>
|
568
|
+
<referenceFrom>2</referenceFrom>
|
569
|
+
</locality>
|
570
|
+
</localityStack>
|
571
|
+
</origin>
|
572
|
+
</termsource>
|
573
|
+
</term>
|
574
|
+
<term id='term-term-2'>
|
575
|
+
<preferred>
|
576
|
+
<expression>
|
577
|
+
<name>Term 2</name>
|
578
|
+
</expression>
|
579
|
+
</preferred>
|
580
|
+
<definition>
|
581
|
+
<nonverbalrepresentation>
|
582
|
+
<figure id='E'>
|
583
|
+
<pre id='F'>Literal</pre>
|
584
|
+
</figure>
|
585
|
+
<formula id='G'>
|
586
|
+
<stem type='MathML'>
|
587
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
588
|
+
<mi>x</mi>
|
589
|
+
<mo>=</mo>
|
590
|
+
<mi>y</mi>
|
591
|
+
</math>
|
592
|
+
</stem>
|
593
|
+
</formula>
|
594
|
+
<termsource status='identical' type='authoritative'>
|
595
|
+
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
596
|
+
<localityStack>
|
597
|
+
<locality type='section'>
|
598
|
+
<referenceFrom>3</referenceFrom>
|
599
|
+
</locality>
|
600
|
+
</localityStack>
|
601
|
+
</origin>
|
602
|
+
</termsource>
|
603
|
+
</nonverbalrepresentation>
|
604
|
+
</definition>
|
605
|
+
</term>
|
606
|
+
</terms>
|
607
|
+
</sections>
|
608
|
+
</iso-standard>
|
609
|
+
INPUT
|
610
|
+
presxml = <<~PRESXML
|
611
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
612
|
+
<sections>
|
613
|
+
<terms id='A' obligation='normative' displayorder='1'>
|
614
|
+
<title depth='1'>
|
615
|
+
1.
|
616
|
+
<tab/>
|
617
|
+
Terms and definitions
|
618
|
+
</title>
|
619
|
+
<p id='B'>For the purposes of this document, the following terms and definitions apply.</p>
|
620
|
+
<term id='term-term'>
|
621
|
+
<name>1.1.</name>
|
622
|
+
<preferred>Term</preferred>
|
623
|
+
<definition>
|
624
|
+
<p id='C'>Definition</p>
|
625
|
+
<termsource status='identical' type='authoritative'>
|
626
|
+
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
627
|
+
<localityStack>
|
628
|
+
<locality type='section'>
|
629
|
+
<referenceFrom>1</referenceFrom>
|
630
|
+
</locality>
|
631
|
+
</localityStack>
|
632
|
+
, Section 1
|
633
|
+
</origin>
|
634
|
+
</termsource>
|
635
|
+
<table id='D'>
|
636
|
+
<name>Table 1</name>
|
637
|
+
<thead>
|
638
|
+
<tr>
|
639
|
+
<th valign='top' align='left'>A</th>
|
640
|
+
<th valign='top' align='left'>B</th>
|
641
|
+
</tr>
|
642
|
+
</thead>
|
643
|
+
<tbody>
|
644
|
+
<tr>
|
645
|
+
<td valign='top' align='left'>C</td>
|
646
|
+
<td valign='top' align='left'>D</td>
|
647
|
+
</tr>
|
648
|
+
</tbody>
|
649
|
+
</table>
|
650
|
+
</definition>
|
651
|
+
<termsource status='identical' type='authoritative'>
|
652
|
+
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
653
|
+
<localityStack>
|
654
|
+
<locality type='section'>
|
655
|
+
<referenceFrom>2</referenceFrom>
|
656
|
+
</locality>
|
657
|
+
</localityStack>
|
658
|
+
, Section 2
|
659
|
+
</origin>
|
660
|
+
</termsource>
|
661
|
+
</term>
|
662
|
+
<term id='term-term-2'>
|
663
|
+
<name>1.2.</name>
|
664
|
+
<preferred>Term 2</preferred>
|
665
|
+
<definition>
|
666
|
+
<figure id='E'>
|
667
|
+
<name>Figure 1</name>
|
668
|
+
<pre id='F'>Literal</pre>
|
669
|
+
</figure>
|
670
|
+
<formula id='G'>
|
671
|
+
<name>1</name>
|
672
|
+
<stem type='MathML'>
|
673
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
674
|
+
<mi>x</mi>
|
675
|
+
<mo>=</mo>
|
676
|
+
<mi>y</mi>
|
677
|
+
</math>
|
678
|
+
<!-- x = y -->
|
679
|
+
</stem>
|
680
|
+
</formula>
|
681
|
+
<termsource status='identical' type='authoritative'>
|
682
|
+
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
683
|
+
<localityStack>
|
684
|
+
<locality type='section'>
|
685
|
+
<referenceFrom>3</referenceFrom>
|
686
|
+
</locality>
|
687
|
+
</localityStack>
|
688
|
+
, Section 3
|
689
|
+
</origin>
|
690
|
+
</termsource>
|
691
|
+
</definition>
|
692
|
+
</term>
|
693
|
+
</terms>
|
694
|
+
</sections>
|
695
|
+
</iso-standard>
|
696
|
+
PRESXML
|
697
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
698
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
699
|
+
end
|
380
700
|
end
|
data/spec/isodoc/xref_spec.rb
CHANGED
@@ -1831,11 +1831,11 @@ RSpec.describe IsoDoc do
|
|
1831
1831
|
<clause id="scope" type="scope"><title>Scope</title>
|
1832
1832
|
</clause>
|
1833
1833
|
<terms id="terms">
|
1834
|
-
<term id="_waxy_rice"><preferred>waxy rice</preferred>
|
1834
|
+
<term id="_waxy_rice"><preferred><expression><name>waxy rice</name></expression></preferred>
|
1835
1835
|
<termnote id="note1">
|
1836
1836
|
<p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
|
1837
1837
|
</termnote></term>
|
1838
|
-
<term id="_nonwaxy_rice"><preferred>nonwaxy rice</preferred>
|
1838
|
+
<term id="_nonwaxy_rice"><preferred><expression><name>nonwaxy rice</name></expression></preferred>
|
1839
1839
|
<termnote id="note2">
|
1840
1840
|
<p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
|
1841
1841
|
</termnote>
|
@@ -1945,7 +1945,7 @@ RSpec.describe IsoDoc do
|
|
1945
1945
|
<terms id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
1946
1946
|
<title>Normal Terms</title>
|
1947
1947
|
<term id="J">
|
1948
|
-
<preferred>Term2</preferred>
|
1948
|
+
<preferred><expression><name>Term2</name></expression></preferred>
|
1949
1949
|
</term>
|
1950
1950
|
</terms>
|
1951
1951
|
<definitions id="K">
|
@@ -2779,7 +2779,7 @@ RSpec.describe IsoDoc do
|
|
2779
2779
|
<title>Terms and definitions</title>
|
2780
2780
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
2781
2781
|
<term id='S4' number='4bis'>
|
2782
|
-
<preferred>Term1</preferred>
|
2782
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
2783
2783
|
</term>
|
2784
2784
|
</terms>
|
2785
2785
|
<definitions id='S12' number='12bis' type='abbreviated_terms' obligation='normative'>
|
@@ -5,10 +5,10 @@ RSpec.describe IsoDoc do
|
|
5
5
|
convert = IsoDoc::XslfoPdfConvert.new(
|
6
6
|
{
|
7
7
|
datauriimage: false,
|
8
|
-
}
|
8
|
+
},
|
9
9
|
)
|
10
10
|
|
11
|
-
expect(convert.pdf_options(nil)).to eq(
|
11
|
+
expect(convert.pdf_options(nil)).to eq({})
|
12
12
|
end
|
13
13
|
|
14
14
|
it "test empty pdf_options for nil font_manifest_file" do
|
@@ -18,22 +18,47 @@ RSpec.describe IsoDoc do
|
|
18
18
|
IsoDoc::XslfoPdfConvert::MN2PDF_OPTIONS => {
|
19
19
|
IsoDoc::XslfoPdfConvert::MN2PDF_FONT_MANIFEST => nil,
|
20
20
|
},
|
21
|
-
}
|
21
|
+
},
|
22
22
|
)
|
23
23
|
|
24
|
-
expect(convert.pdf_options(nil)).to eq(
|
24
|
+
expect(convert.pdf_options(nil)).to eq({})
|
25
25
|
end
|
26
26
|
|
27
27
|
it "test --font-manifest pdf_options" do
|
28
|
+
mn2pdf_opts = {
|
29
|
+
IsoDoc::XslfoPdfConvert::MN2PDF_FONT_MANIFEST => "/tmp/manifest.yml",
|
30
|
+
}
|
28
31
|
convert = IsoDoc::XslfoPdfConvert.new(
|
29
32
|
{
|
30
33
|
datauriimage: false,
|
31
|
-
IsoDoc::XslfoPdfConvert::MN2PDF_OPTIONS =>
|
32
|
-
|
33
|
-
|
34
|
-
|
34
|
+
IsoDoc::XslfoPdfConvert::MN2PDF_OPTIONS => mn2pdf_opts,
|
35
|
+
},
|
36
|
+
)
|
37
|
+
|
38
|
+
expect(convert.pdf_options(nil)).to eq(mn2pdf_opts)
|
39
|
+
end
|
40
|
+
|
41
|
+
it "test --param align-cross-elements pdf_options" do
|
42
|
+
convert = IsoDoc::XslfoPdfConvert.new(
|
43
|
+
{
|
44
|
+
datauriimage: false,
|
45
|
+
aligncrosselements: "clause table note",
|
46
|
+
},
|
47
|
+
)
|
48
|
+
|
49
|
+
expect(convert.pdf_options(nil))
|
50
|
+
.to eq({ "--param align-cross-elements=" => "clause table note" })
|
51
|
+
end
|
52
|
+
|
53
|
+
it "test --baseassetpath pdf_options" do
|
54
|
+
convert = IsoDoc::XslfoPdfConvert.new(
|
55
|
+
{
|
56
|
+
datauriimage: false,
|
57
|
+
baseassetpath: "ABC",
|
58
|
+
},
|
35
59
|
)
|
36
60
|
|
37
|
-
expect(convert.pdf_options(nil))
|
61
|
+
expect(convert.pdf_options(nil))
|
62
|
+
.to eq({ "--param baseassetpath=" => "ABC" })
|
38
63
|
end
|
39
64
|
end
|