isodoc 1.7.3.1 → 1.7.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/isodoc.gemspec +7 -4
  3. data/lib/isodoc/class_utils.rb +2 -2
  4. data/lib/isodoc/convert.rb +2 -0
  5. data/lib/isodoc/function/blocks_example_note.rb +85 -79
  6. data/lib/isodoc/function/cleanup.rb +181 -175
  7. data/lib/isodoc/function/inline.rb +110 -108
  8. data/lib/isodoc/function/inline_simple.rb +55 -55
  9. data/lib/isodoc/function/lists.rb +75 -71
  10. data/lib/isodoc/function/references.rb +165 -160
  11. data/lib/isodoc/function/section.rb +140 -190
  12. data/lib/isodoc/function/section_titles.rb +82 -0
  13. data/lib/isodoc/function/table.rb +90 -87
  14. data/lib/isodoc/function/terms.rb +58 -56
  15. data/lib/isodoc/function/to_word_html.rb +3 -1
  16. data/lib/isodoc/function/utils.rb +34 -14
  17. data/lib/isodoc/html_function/comments.rb +107 -111
  18. data/lib/isodoc/html_function/footnotes.rb +68 -67
  19. data/lib/isodoc/html_function/html.rb +113 -103
  20. data/lib/isodoc/html_function/mathvariant_to_plain.rb +5 -3
  21. data/lib/isodoc/presentation_function/block.rb +73 -78
  22. data/lib/isodoc/presentation_function/concept.rb +68 -0
  23. data/lib/isodoc/presentation_function/image.rb +112 -0
  24. data/lib/isodoc/presentation_function/inline.rb +6 -39
  25. data/lib/isodoc/presentation_function/math.rb +9 -0
  26. data/lib/isodoc/presentation_function/section.rb +12 -1
  27. data/lib/isodoc/presentation_xml_convert.rb +3 -0
  28. data/lib/isodoc/version.rb +1 -1
  29. data/lib/isodoc/word_function/body.rb +176 -174
  30. data/lib/isodoc/word_function/comments.rb +117 -112
  31. data/lib/isodoc/word_function/footnotes.rb +88 -86
  32. data/lib/isodoc/word_function/inline.rb +42 -67
  33. data/lib/isodoc/word_function/postprocess_cover.rb +121 -110
  34. data/lib/isodoc/xref/xref_gen.rb +153 -150
  35. data/lib/isodoc/xslfo_convert.rb +2 -2
  36. data/spec/assets/odf.svg +1 -4
  37. data/spec/isodoc/blocks_spec.rb +187 -32
  38. data/spec/isodoc/inline_spec.rb +300 -116
  39. data/spec/isodoc/postproc_spec.rb +38 -0
  40. data/spec/isodoc/presentation_xml_spec.rb +144 -0
  41. data/spec/isodoc/section_spec.rb +764 -0
  42. data/spec/isodoc/terms_spec.rb +116 -0
  43. metadata +63 -18
@@ -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
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.3.1
4
+ version: 1.7.6.1
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-18 00:00:00.000000000 Z
11
+ date: 2021-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciimath
@@ -66,20 +66,62 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '4'
69
+ - !ruby/object:Gem::Dependency
70
+ name: emf2svg
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1'
83
+ - !ruby/object:Gem::Dependency
84
+ name: mathml2asciimath
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: metanorma-utils
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
69
111
  - !ruby/object:Gem::Dependency
70
112
  name: nokogiri
71
113
  requirement: !ruby/object:Gem::Requirement
72
114
  requirements:
73
115
  - - "~>"
74
116
  - !ruby/object:Gem::Version
75
- version: 1.11.0
117
+ version: 1.12.0
76
118
  type: :runtime
77
119
  prerelease: false
78
120
  version_requirements: !ruby/object:Gem::Requirement
79
121
  requirements:
80
122
  - - "~>"
81
123
  - !ruby/object:Gem::Version
82
- version: 1.11.0
124
+ version: 1.12.0
83
125
  - !ruby/object:Gem::Dependency
84
126
  name: relaton-cli
85
127
  requirement: !ruby/object:Gem::Requirement
@@ -206,6 +248,20 @@ dependencies:
206
248
  - - "~>"
207
249
  - !ruby/object:Gem::Version
208
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'
209
265
  - !ruby/object:Gem::Dependency
210
266
  name: rake
211
267
  requirement: !ruby/object:Gem::Requirement
@@ -290,20 +346,6 @@ dependencies:
290
346
  - - "~>"
291
347
  - !ruby/object:Gem::Version
292
348
  version: '0.15'
293
- - !ruby/object:Gem::Dependency
294
- name: metanorma-iso
295
- requirement: !ruby/object:Gem::Requirement
296
- requirements:
297
- - - ">="
298
- - !ruby/object:Gem::Version
299
- version: '0'
300
- type: :development
301
- prerelease: false
302
- version_requirements: !ruby/object:Gem::Requirement
303
- requirements:
304
- - - ">="
305
- - !ruby/object:Gem::Version
306
- version: '0'
307
349
  - !ruby/object:Gem::Dependency
308
350
  name: timecop
309
351
  requirement: !ruby/object:Gem::Requirement
@@ -381,6 +423,7 @@ files:
381
423
  - lib/isodoc/function/references.rb
382
424
  - lib/isodoc/function/reqt.rb
383
425
  - lib/isodoc/function/section.rb
426
+ - lib/isodoc/function/section_titles.rb
384
427
  - lib/isodoc/function/table.rb
385
428
  - lib/isodoc/function/terms.rb
386
429
  - lib/isodoc/function/to_word_html.rb
@@ -403,6 +446,8 @@ files:
403
446
  - lib/isodoc/pdf_convert.rb
404
447
  - lib/isodoc/presentation_function/bibdata.rb
405
448
  - lib/isodoc/presentation_function/block.rb
449
+ - lib/isodoc/presentation_function/concept.rb
450
+ - lib/isodoc/presentation_function/image.rb
406
451
  - lib/isodoc/presentation_function/inline.rb
407
452
  - lib/isodoc/presentation_function/math.rb
408
453
  - lib/isodoc/presentation_function/section.rb