isodoc 1.7.4 → 1.7.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1778,4 +1778,129 @@ RSpec.describe IsoDoc do
1778
1778
  expect(xmlpp(IsoDoc::HtmlConvert.new({})
1779
1779
  .convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
1780
1780
  end
1781
+
1782
+ it "processes annexes containing one, or more than one special sections" do
1783
+ input = <<~INPUT
1784
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
1785
+ <annex id='PP' obligation='normative'>
1786
+ <title>Glossary</title>
1787
+ <terms id='PP1' obligation='normative'>
1788
+ <term id='term-glossary'>
1789
+ <preferred>Glossary</preferred>
1790
+ </term>
1791
+ </terms>
1792
+ </annex>
1793
+ <annex id='QQ' obligation='normative'>
1794
+ <title>Glossary</title>
1795
+ <terms id='QQ1' obligation='normative'>
1796
+ <title>Term Collection</title>
1797
+ <term id='term-term-1'>
1798
+ <preferred>Term</preferred>
1799
+ </term>
1800
+ </terms>
1801
+ <terms id='QQ2' obligation='normative'>
1802
+ <title>Term Collection 2</title>
1803
+ <term id='term-term-2'>
1804
+ <preferred>Term</preferred>
1805
+ </term>
1806
+ </terms>
1807
+ </annex>
1808
+ <annex id='RR' obligation='normative'>
1809
+ <title>Glossary</title>
1810
+ <terms id='RR1' obligation='normative'>
1811
+ <title>Term Collection</title>
1812
+ <term id='term-term-3'>
1813
+ <preferred>Term</preferred>
1814
+ </term>
1815
+ </terms>
1816
+ <references id='RR2' obligation='normative'>
1817
+ <title>References</title>
1818
+ </terms>
1819
+ </annex>
1820
+ </iso-standard>
1821
+ INPUT
1822
+ presxml = <<~OUTPUT
1823
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
1824
+ <annex id='PP' obligation='normative' displayorder='1'>
1825
+ <title>
1826
+ <strong>Annex A</strong>
1827
+ <br/>
1828
+ (normative)
1829
+ <br/>
1830
+ <br/>
1831
+ <strong>Glossary</strong>
1832
+ </title>
1833
+ <terms id='PP1' obligation='normative'>
1834
+ <title>A.</title>
1835
+ <term id='term-glossary'>
1836
+ <name>A.1.</name>
1837
+ <preferred>Glossary</preferred>
1838
+ </term>
1839
+ </terms>
1840
+ </annex>
1841
+ <annex id='QQ' obligation='normative' displayorder='2'>
1842
+ <title>
1843
+ <strong>Annex B</strong>
1844
+ <br/>
1845
+ (normative)
1846
+ <br/>
1847
+ <br/>
1848
+ <strong>Glossary</strong>
1849
+ </title>
1850
+ <terms id='QQ1' obligation='normative'>
1851
+ <title depth='2'>
1852
+ B.1.
1853
+ <tab/>
1854
+ Term Collection
1855
+ </title>
1856
+ <term id='term-term-1'>
1857
+ <name>B.1.1.</name>
1858
+ <preferred>Term</preferred>
1859
+ </term>
1860
+ </terms>
1861
+ <terms id='QQ2' obligation='normative'>
1862
+ <title depth='2'>
1863
+ B.2.
1864
+ <tab/>
1865
+ Term Collection 2
1866
+ </title>
1867
+ <term id='term-term-2'>
1868
+ <name>B.2.1.</name>
1869
+ <preferred>Term</preferred>
1870
+ </term>
1871
+ </terms>
1872
+ </annex>
1873
+ <annex id='RR' obligation='normative' displayorder='3'>
1874
+ <title>
1875
+ <strong>Annex C</strong>
1876
+ <br/>
1877
+ (normative)
1878
+ <br/>
1879
+ <br/>
1880
+ <strong>Glossary</strong>
1881
+ </title>
1882
+ <terms id='RR1' obligation='normative'>
1883
+ <title depth='2'>
1884
+ C.1.
1885
+ <tab/>
1886
+ Term Collection
1887
+ </title>
1888
+ <term id='term-term-3'>
1889
+ <name>C.1.1.</name>
1890
+ <preferred>Term</preferred>
1891
+ </term>
1892
+ </terms>
1893
+ <references id='RR2' obligation='normative'>
1894
+ <title depth='2'>
1895
+ C.2.
1896
+ <tab/>
1897
+ References
1898
+ </title>
1899
+ </references>
1900
+ </annex>
1901
+ </iso-standard>
1902
+ OUTPUT
1903
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
1904
+ .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
1905
+ end
1781
1906
  end
@@ -261,4 +261,120 @@ RSpec.describe IsoDoc do
261
261
  expect(xmlpp(IsoDoc::WordConvert.new({})
262
262
  .convert("test", presxml, true))).to be_equivalent_to xmlpp(word)
263
263
  end
264
+
265
+ it "processes IsoXML term with multiple definitions" do
266
+ input = <<~"INPUT"
267
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
268
+ <sections>
269
+ <terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
270
+ <p>For the purposes of this document, the following terms and definitions apply.</p>
271
+ <term id="paddy1"><preferred>paddy</preferred>
272
+ <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
+ <termsource status="modified">
276
+ <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
277
+ <modification>
278
+ <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
+ </modification>
280
+ </termsource>
281
+ </definition>
282
+ <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" keep-with-next="true" keep-lines-together="true">
283
+ <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
284
+ <ul>
285
+ <li>A</li>
286
+ </ul>
287
+ </termexample>
288
+ <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894">
289
+ <ul>
290
+ <li>A</li>
291
+ </ul>
292
+ </termexample>
293
+ <termsource status='identical'>
294
+ <origin citeas=''>
295
+ <termref base='IEV' target='xyz'>t1</termref>
296
+ </origin>
297
+ </termsource>
298
+ <termsource status='modified'>
299
+ <origin citeas=''>
300
+ <termref base='IEV' target='xyz'/>
301
+ </origin>
302
+ <modification>
303
+ <p id='_'>with adjustments</p>
304
+ </modification>
305
+ </termsource>
306
+ </term>
307
+ INPUT
308
+ presxml = <<~PRESXML
309
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
310
+ <sections>
311
+ <terms id='_terms_and_definitions' obligation='normative' displayorder='1'>
312
+ <title depth='1'>
313
+ 1.
314
+ <tab/>
315
+ Terms and Definitions
316
+ </title>
317
+ <p>For the purposes of this document, the following terms and definitions apply.</p>
318
+ <term id='paddy1'>
319
+ <name>1.1.</name>
320
+ <preferred>paddy</preferred>
321
+ <domain>rice</domain>
322
+ <definition>
323
+ <ol>
324
+ <li>
325
+ <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
326
+ </li>
327
+ <li>
328
+ <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747e'>rice retaining its husk after threshing, mark 2</p>
329
+ <termsource status='modified'>
330
+ <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'>
331
+ <locality type='clause'>
332
+ <referenceFrom>3.1</referenceFrom>
333
+ </locality>
334
+ ISO 7301:2011, Clause 3.1
335
+ </origin>
336
+ <modification>
337
+ <p id='_e73a417d-ad39-417d-a4c8-20e4e2529489'>
338
+ The term "cargo rice" is shown as deprecated, and Note 1 to
339
+ entry is not included here
340
+ </p>
341
+ </modification>
342
+ </termsource>
343
+ </li>
344
+ </ol>
345
+ </definition>
346
+ <termexample id='_bd57bbf1-f948-4bae-b0ce-73c00431f892' keep-with-next='true' keep-lines-together='true'>
347
+ <name>EXAMPLE 1</name>
348
+ <p id='_65c9a509-9a89-4b54-a890-274126aeb55c'>Foreign seeds, husks, bran, sand, dust.</p>
349
+ <ul>
350
+ <li>A</li>
351
+ </ul>
352
+ </termexample>
353
+ <termexample id='_bd57bbf1-f948-4bae-b0ce-73c00431f894'>
354
+ <name>EXAMPLE 2</name>
355
+ <ul>
356
+ <li>A</li>
357
+ </ul>
358
+ </termexample>
359
+ <termsource status='identical'>
360
+ <origin citeas=''>
361
+ <termref base='IEV' target='xyz'>t1</termref>
362
+ </origin>
363
+ </termsource>
364
+ <termsource status='modified'>
365
+ <origin citeas=''>
366
+ <termref base='IEV' target='xyz'/>
367
+ </origin>
368
+ <modification>
369
+ <p id='_'>with adjustments</p>
370
+ </modification>
371
+ </termsource>
372
+ </term>
373
+ </terms>
374
+ </sections>
375
+ </iso-standard>
376
+ PRESXML
377
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
378
+ .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
379
+ end
264
380
  end
@@ -5,7 +5,7 @@ RSpec.describe IsoDoc do
5
5
  convert = IsoDoc::XslfoPdfConvert.new(
6
6
  {
7
7
  datauriimage: false,
8
- }
8
+ },
9
9
  )
10
10
 
11
11
  expect(convert.pdf_options(nil)).to eq("")
@@ -18,7 +18,7 @@ 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
24
  expect(convert.pdf_options(nil)).to eq("")
@@ -31,9 +31,21 @@ RSpec.describe IsoDoc do
31
31
  IsoDoc::XslfoPdfConvert::MN2PDF_OPTIONS => {
32
32
  IsoDoc::XslfoPdfConvert::MN2PDF_FONT_MANIFEST => "/tmp/manifest.yml",
33
33
  },
34
- }
34
+ },
35
35
  )
36
36
 
37
- expect(convert.pdf_options(nil)).to eq("--font-manifest /tmp/manifest.yml")
37
+ expect(convert.pdf_options(nil)).to eq(" --font-manifest /tmp/manifest.yml")
38
+ end
39
+
40
+ it "test --param align-cross-elements pdf_options" do
41
+ convert = IsoDoc::XslfoPdfConvert.new(
42
+ {
43
+ datauriimage: false,
44
+ aligncrosselements: "clause table note",
45
+ },
46
+ )
47
+
48
+ expect(convert.pdf_options(nil))
49
+ .to eq(" --param align-cross-elements = \"clause table note\"")
38
50
  end
39
51
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isodoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.4
4
+ version: 1.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-30 00:00:00.000000000 Z
11
+ date: 2021-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciimath
@@ -67,21 +67,21 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '4'
69
69
  - !ruby/object:Gem::Dependency
70
- name: nokogiri
70
+ name: emf2svg
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 1.11.0
75
+ version: '1'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 1.11.0
82
+ version: '1'
83
83
  - !ruby/object:Gem::Dependency
84
- name: relaton-cli
84
+ name: mathml2asciimath
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -95,7 +95,7 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: roman-numerals
98
+ name: metanorma-utils
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ">="
@@ -109,7 +109,21 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: thread_safe
112
+ name: nokogiri
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 1.12.0
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 1.12.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: relaton-cli
113
127
  requirement: !ruby/object:Gem::Requirement
114
128
  requirements:
115
129
  - - ">="
@@ -123,21 +137,21 @@ dependencies:
123
137
  - !ruby/object:Gem::Version
124
138
  version: '0'
125
139
  - !ruby/object:Gem::Dependency
126
- name: twitter_cldr
140
+ name: roman-numerals
127
141
  requirement: !ruby/object:Gem::Requirement
128
142
  requirements:
129
143
  - - ">="
130
144
  - !ruby/object:Gem::Version
131
- version: 6.6.0
145
+ version: '0'
132
146
  type: :runtime
133
147
  prerelease: false
134
148
  version_requirements: !ruby/object:Gem::Requirement
135
149
  requirements:
136
150
  - - ">="
137
151
  - !ruby/object:Gem::Version
138
- version: 6.6.0
152
+ version: '0'
139
153
  - !ruby/object:Gem::Dependency
140
- name: uuidtools
154
+ name: thread_safe
141
155
  requirement: !ruby/object:Gem::Requirement
142
156
  requirements:
143
157
  - - ">="
@@ -151,7 +165,21 @@ dependencies:
151
165
  - !ruby/object:Gem::Version
152
166
  version: '0'
153
167
  - !ruby/object:Gem::Dependency
154
- name: mathml2asciimath
168
+ name: twitter_cldr
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: 6.6.0
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: 6.6.0
181
+ - !ruby/object:Gem::Dependency
182
+ name: uuidtools
155
183
  requirement: !ruby/object:Gem::Requirement
156
184
  requirements:
157
185
  - - ">="
@@ -220,6 +248,20 @@ dependencies:
220
248
  - - "~>"
221
249
  - !ruby/object:Gem::Version
222
250
  version: '4.7'
251
+ - !ruby/object:Gem::Dependency
252
+ name: metanorma-iso
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - ">="
256
+ - !ruby/object:Gem::Version
257
+ version: '0'
258
+ type: :development
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - ">="
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
223
265
  - !ruby/object:Gem::Dependency
224
266
  name: rake
225
267
  requirement: !ruby/object:Gem::Requirement
@@ -304,20 +346,6 @@ dependencies:
304
346
  - - "~>"
305
347
  - !ruby/object:Gem::Version
306
348
  version: '0.15'
307
- - !ruby/object:Gem::Dependency
308
- name: metanorma-iso
309
- requirement: !ruby/object:Gem::Requirement
310
- requirements:
311
- - - ">="
312
- - !ruby/object:Gem::Version
313
- version: '0'
314
- type: :development
315
- prerelease: false
316
- version_requirements: !ruby/object:Gem::Requirement
317
- requirements:
318
- - - ">="
319
- - !ruby/object:Gem::Version
320
- version: '0'
321
349
  - !ruby/object:Gem::Dependency
322
350
  name: timecop
323
351
  requirement: !ruby/object:Gem::Requirement
@@ -418,6 +446,8 @@ files:
418
446
  - lib/isodoc/pdf_convert.rb
419
447
  - lib/isodoc/presentation_function/bibdata.rb
420
448
  - lib/isodoc/presentation_function/block.rb
449
+ - lib/isodoc/presentation_function/concept.rb
450
+ - lib/isodoc/presentation_function/image.rb
421
451
  - lib/isodoc/presentation_function/inline.rb
422
452
  - lib/isodoc/presentation_function/math.rb
423
453
  - lib/isodoc/presentation_function/section.rb