isodoc 1.7.2 → 1.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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.2
4
+ version: 1.7.5
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-02 00:00:00.000000000 Z
11
+ date: 2021-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciimath
@@ -150,6 +150,34 @@ dependencies:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: mathml2asciimath
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: metanorma-utils
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
153
181
  - !ruby/object:Gem::Dependency
154
182
  name: byebug
155
183
  requirement: !ruby/object:Gem::Requirement
@@ -381,6 +409,7 @@ files:
381
409
  - lib/isodoc/function/references.rb
382
410
  - lib/isodoc/function/reqt.rb
383
411
  - lib/isodoc/function/section.rb
412
+ - lib/isodoc/function/section_titles.rb
384
413
  - lib/isodoc/function/table.rb
385
414
  - lib/isodoc/function/terms.rb
386
415
  - lib/isodoc/function/to_word_html.rb