metanorma-iso 1.10.2 → 1.10.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +3 -33
  3. data/.github/workflows/ubuntu.yml +1 -1
  4. data/Gemfile +1 -1
  5. data/lib/asciidoctor/iso/base.rb +1 -1
  6. data/lib/asciidoctor/iso/basicdoc.rng +1 -11
  7. data/lib/asciidoctor/iso/biblio.rng +0 -2
  8. data/lib/asciidoctor/iso/front.rb +17 -4
  9. data/lib/asciidoctor/iso/front_id.rb +20 -17
  10. data/lib/asciidoctor/iso/isodoc.rng +61 -19
  11. data/lib/asciidoctor/iso/isostandard-amd.rng +1 -1
  12. data/lib/asciidoctor/iso/isostandard.rng +15 -3
  13. data/lib/asciidoctor/iso/reqt.rng +1 -1
  14. data/lib/asciidoctor/iso/section.rb +1 -1
  15. data/lib/asciidoctor/iso/validate.rb +1 -1
  16. data/lib/asciidoctor/iso/validate_image.rb +1 -1
  17. data/lib/asciidoctor/iso/validate_section.rb +1 -1
  18. data/lib/isodoc/iso/base_convert.rb +14 -31
  19. data/lib/isodoc/iso/html/isodoc.scss +0 -1
  20. data/lib/isodoc/iso/html/style-human.scss +36 -9
  21. data/lib/isodoc/iso/html/style-iso.scss +31 -6
  22. data/lib/isodoc/iso/html/wordstyle.scss +10 -8
  23. data/lib/isodoc/iso/html_convert.rb +81 -22
  24. data/lib/isodoc/iso/index.rb +53 -45
  25. data/lib/isodoc/iso/iso.amendment.xsl +406 -122
  26. data/lib/isodoc/iso/iso.international-standard.xsl +406 -122
  27. data/lib/isodoc/iso/isosts_convert.rb +6 -2
  28. data/lib/isodoc/iso/metadata.rb +27 -22
  29. data/lib/isodoc/iso/presentation_xml_convert.rb +60 -25
  30. data/lib/isodoc/iso/sts_convert.rb +3 -2
  31. data/lib/isodoc/iso/word_convert.rb +0 -2
  32. data/lib/metanorma/iso/processor.rb +2 -2
  33. data/lib/metanorma/iso/version.rb +1 -1
  34. data/metanorma-iso.gemspec +3 -3
  35. data/spec/asciidoctor/base_spec.rb +398 -546
  36. data/spec/asciidoctor/blocks_spec.rb +4 -4
  37. data/spec/asciidoctor/cleanup_spec.rb +15 -12
  38. data/spec/asciidoctor/refs_spec.rb +87 -84
  39. data/spec/isodoc/amd_spec.rb +261 -250
  40. data/spec/isodoc/i18n_spec.rb +7 -7
  41. data/spec/isodoc/inline_spec.rb +242 -216
  42. data/spec/isodoc/iso_spec.rb +3 -1
  43. data/spec/isodoc/postproc_spec.rb +111 -28
  44. data/spec/isodoc/section_spec.rb +4 -4
  45. data/spec/isodoc/terms_spec.rb +34 -41
  46. data/spec/isodoc/xref_spec.rb +3 -3
  47. data/spec/metanorma/processor_spec.rb +110 -14
  48. data/spec/vcr_cassettes/docrels.yml +37 -427
  49. metadata +11 -16
  50. data/lib/isodoc/iso/html/htmlstyle.css +0 -47
  51. data/lib/isodoc/iso/html/isodoc.css +0 -1328
  52. data/lib/isodoc/iso/html/style-human.css +0 -979
  53. data/lib/isodoc/iso/html/style-iso.css +0 -1007
  54. data/lib/isodoc/iso/html/wordstyle.css +0 -1699
@@ -535,9 +535,9 @@ RSpec.describe Asciidoctor::ISO do
535
535
  <term id="term-term1">
536
536
  <preferred><expression><name>Term1</name></expression></preferred>
537
537
  <definition>
538
- <verbaldefinition>
538
+ <verbal-definition>
539
539
  <p id='_'>Definition</p>
540
- </verbaldefinition>
540
+ </verbal-definition>
541
541
  </definition>
542
542
  <termsource status='identical' type='authoritative'>
543
543
  <origin bibitemid="ISO2191" citeas="" type="inline">
@@ -577,9 +577,9 @@ RSpec.describe Asciidoctor::ISO do
577
577
  <term id="term-term1">
578
578
  <preferred><expression><name>Term1</name></expression></preferred>
579
579
  <definition>
580
- <verbaldefinition>
580
+ <verbal-definition>
581
581
  <p id='_'>Definition</p>
582
- </verbaldefinition>
582
+ </verbal-definition>
583
583
  </definition>
584
584
  <termsource status='modified' type='authoritative'>
585
585
  <origin bibitemid="ISO2191" citeas="" type="inline">
@@ -66,9 +66,9 @@ RSpec.describe Asciidoctor::ISO do
66
66
  </stem>
67
67
  </name></letter-symbol>
68
68
  </admitted>
69
- <definition><verbaldefinition>
69
+ <definition><verbal-definition>
70
70
  <p id="_">Time</p>
71
- </verbaldefinition></definition>
71
+ </verbal-definition></definition>
72
72
  </term>
73
73
  </terms>
74
74
  </sections>
@@ -96,8 +96,8 @@ RSpec.describe Asciidoctor::ISO do
96
96
  <term id="term-tempus">
97
97
  <preferred><expression><name>Tempus</name></expression></preferred>
98
98
  <domain>relativity</domain>
99
- <definition><verbaldefinition>
100
- <p id="_">Time</p></verbaldefinition></definition>
99
+ <definition><verbal-definition>
100
+ <p id="_">Time</p></verbal-definition></definition>
101
101
  </term>
102
102
  </terms>
103
103
  </sections>
@@ -121,12 +121,15 @@ RSpec.describe Asciidoctor::ISO do
121
121
 
122
122
  === stem:[t_90]
123
123
 
124
+ [.definition]
125
+ --
124
126
  [stem]
125
127
  ++++
126
128
  t_A
127
129
  ++++
128
130
 
129
131
  This paragraph is extraneous
132
+ --
130
133
  INPUT
131
134
  output = <<~OUTPUT
132
135
  #{BLANK_HDR}
@@ -134,7 +137,7 @@ RSpec.describe Asciidoctor::ISO do
134
137
  <terms id="_" obligation="normative">
135
138
  <title>Terms and definitions</title>
136
139
  #{TERM_BOILERPLATE}
137
- <term id="term-t90">
140
+ <term id="term-_-t90-">
138
141
  <preferred>
139
142
  <letter-symbol><name>
140
143
  <stem type="MathML">
@@ -151,8 +154,7 @@ RSpec.describe Asciidoctor::ISO do
151
154
  </name></letter-symbol>
152
155
  </preferred>
153
156
  <definition>
154
- <verbaldefinition><p id="_">This paragraph is extraneous</p></verbaldefinition>
155
- <nonverbalrepresentation>
157
+ <verbal-definition>
156
158
  <formula id="_">
157
159
  <stem type="MathML">
158
160
  <math xmlns="http://www.w3.org/1998/Math/MathML">
@@ -167,7 +169,8 @@ RSpec.describe Asciidoctor::ISO do
167
169
  </math>
168
170
  </stem>
169
171
  </formula>
170
- </nonverbalrepresentation></definition>
172
+ <p id="_">This paragraph is extraneous</p></verbal-definition>
173
+ </definition>
171
174
  </term>
172
175
  </terms>
173
176
  </sections>
@@ -203,9 +206,9 @@ RSpec.describe Asciidoctor::ISO do
203
206
  </ul>
204
207
  <term id="term-time">
205
208
  <preferred><expression><name>Time</name></expression></preferred>
206
- <definition><verbaldefinition>
209
+ <definition><verbal-definition>
207
210
  <p id="_">This paragraph is extraneous</p>
208
- </verbaldefinition></definition>
211
+ </verbal-definition></definition>
209
212
  </term>
210
213
  </terms>
211
214
  </sections>
@@ -454,9 +457,9 @@ RSpec.describe Asciidoctor::ISO do
454
457
  <term id="term-term1">
455
458
  <preferred><expression><name>Term1</name></expression></preferred>
456
459
  <definition>
457
- <verbaldefinition>
460
+ <verbal-definition>
458
461
  <p id='_'>Definition</p>
459
- </verbaldefinition>
462
+ </verbal-definition>
460
463
  </definition>
461
464
  <termsource status='identical' type='authoritative'>
462
465
  <origin bibitemid="ISO2191" citeas="" type="inline">
@@ -364,95 +364,98 @@ RSpec.describe Asciidoctor::ISO do
364
364
 
365
365
  def mock_fdis
366
366
  expect(RelatonIso::IsoBibliography).to receive(:get)
367
- .with("ISO/FDIS 17664-1", nil, lang: "en", title: "Title", usrlbl: nil) do
368
- RelatonIsoBib::XMLParser.from_xml(<<~"OUTPUT")
369
- <bibitem id="x" type="standard">
370
- <fetched>#{Date.today}</fetched>
371
- <title format="text/plain" language="fr" script="Latn" type="title-intro">Traitement de produits de soins de santé</title>
372
- <title format="text/plain" language="fr" script="Latn" type="title-main">Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif</title>
373
- <title format="text/plain" language="fr" script="Latn" type="title-part">Partie 1: Titre manque</title>
374
- <title format="text/plain" language="fr" script="Latn" type="main">Traitement de produits de soins de santé — Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif — Partie 1: Titre manque</title>
375
- <uri type="src">https://www.iso.org/standard/81720.html</uri>
376
- <uri type="rss">https://www.iso.org/contents/data/standard/08/17/81720.detail.rss</uri>
377
- <docidentifier type="ISO">ISO/FDIS 17664-1</docidentifier>
378
- <docidentifier type="URN">urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr</docidentifier>
379
- <docnumber>17664</docnumber>
380
- <contributor>
381
- <role type="publisher"/>
367
+ .with("ISO/FDIS 17664-1", nil, code: "ISO/FDIS 17664-1",
368
+ lang: "en", match: anything, ord: anything,
369
+ process: 1, year: nil,
370
+ title: "Title", usrlbl: nil) do
371
+ RelatonIsoBib::XMLParser.from_xml(<<~"OUTPUT")
372
+ <bibitem id="x" type="standard">
373
+ <fetched>#{Date.today}</fetched>
374
+ <title format="text/plain" language="fr" script="Latn" type="title-intro">Traitement de produits de soins de santé</title>
375
+ <title format="text/plain" language="fr" script="Latn" type="title-main">Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif</title>
376
+ <title format="text/plain" language="fr" script="Latn" type="title-part">Partie 1: Titre manque</title>
377
+ <title format="text/plain" language="fr" script="Latn" type="main">Traitement de produits de soins de santé — Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif — Partie 1: Titre manque</title>
378
+ <uri type="src">https://www.iso.org/standard/81720.html</uri>
379
+ <uri type="rss">https://www.iso.org/contents/data/standard/08/17/81720.detail.rss</uri>
380
+ <docidentifier type="ISO">ISO/FDIS 17664-1</docidentifier>
381
+ <docidentifier type="URN">urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr</docidentifier>
382
+ <docnumber>17664</docnumber>
383
+ <contributor>
384
+ <role type="publisher"/>
385
+ <organization>
386
+ <name>International Organization for Standardization</name>
387
+ <abbreviation>ISO</abbreviation>
388
+ <uri>www.iso.org</uri>
389
+ </organization>
390
+ </contributor>
391
+ <edition>1</edition>
392
+ <language>en</language>
393
+ <language>fr</language>
394
+ <script>Latn</script>
395
+ <status>
396
+ <stage>50</stage>
397
+ <substage>00</substage>
398
+ </status>
399
+ <copyright>
400
+ <from>unknown</from>
401
+ <owner>
382
402
  <organization>
383
- <name>International Organization for Standardization</name>
384
- <abbreviation>ISO</abbreviation>
385
- <uri>www.iso.org</uri>
403
+ <name>ISO/FDIS</name>
386
404
  </organization>
387
- </contributor>
388
- <edition>1</edition>
389
- <language>en</language>
390
- <language>fr</language>
391
- <script>Latn</script>
392
- <status>
393
- <stage>50</stage>
394
- <substage>00</substage>
395
- </status>
396
- <copyright>
397
- <from>unknown</from>
398
- <owner>
405
+ </owner>
406
+ </copyright>
407
+ <relation type="obsoletes">
408
+ <bibitem type="standard">
409
+ <formattedref format="text/plain">ISO 17664:2017</formattedref>
410
+ </bibitem>
411
+ </relation>
412
+ <relation type="instance">
413
+ <bibitem type="standard">
414
+ <fetched>2020-11-03</fetched>
415
+ <title format="text/plain" language="fr" script="Latn" type="title-intro">Traitement de produits de soins de santé</title>
416
+ <title format="text/plain" language="fr" script="Latn" type="title-main">Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif</title>
417
+ <title format="text/plain" language="fr" script="Latn" type="title-part">Partie 1: Titre manque</title>
418
+ <title format="text/plain" language="fr" script="Latn" type="main">Traitement de produits de soins de santé — Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif — Partie 1: Titre manque</title>
419
+ <uri type="src">https://www.iso.org/standard/81720.html</uri>
420
+ <uri type="rss">https://www.iso.org/contents/data/standard/08/17/81720.detail.rss</uri>
421
+ <docidentifier type="ISO">ISO/FDIS 17664-1</docidentifier>
422
+ <docidentifier type="URN">urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr</docidentifier>
423
+ <docnumber>17664</docnumber>
424
+ <contributor>
425
+ <role type="publisher"/>
399
426
  <organization>
400
- <name>ISO/FDIS</name>
427
+ <name>International Organization for Standardization</name>
428
+ <abbreviation>ISO</abbreviation>
429
+ <uri>www.iso.org</uri>
401
430
  </organization>
402
- </owner>
403
- </copyright>
404
- <relation type="obsoletes">
405
- <bibitem type="standard">
406
- <formattedref format="text/plain">ISO 17664:2017</formattedref>
407
- </bibitem>
408
- </relation>
409
- <relation type="instance">
410
- <bibitem type="standard">
411
- <fetched>2020-11-03</fetched>
412
- <title format="text/plain" language="fr" script="Latn" type="title-intro">Traitement de produits de soins de santé</title>
413
- <title format="text/plain" language="fr" script="Latn" type="title-main">Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif</title>
414
- <title format="text/plain" language="fr" script="Latn" type="title-part">Partie 1: Titre manque</title>
415
- <title format="text/plain" language="fr" script="Latn" type="main">Traitement de produits de soins de santé — Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif — Partie 1: Titre manque</title>
416
- <uri type="src">https://www.iso.org/standard/81720.html</uri>
417
- <uri type="rss">https://www.iso.org/contents/data/standard/08/17/81720.detail.rss</uri>
418
- <docidentifier type="ISO">ISO/FDIS 17664-1</docidentifier>
419
- <docidentifier type="URN">urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr</docidentifier>
420
- <docnumber>17664</docnumber>
421
- <contributor>
422
- <role type="publisher"/>
431
+ </contributor>
432
+ <edition>1</edition>
433
+ <language>en</language>
434
+ <language>fr</language>
435
+ <script>Latn</script>
436
+ <status>
437
+ <stage>50</stage>
438
+ <substage>00</substage>
439
+ </status>
440
+ <copyright>
441
+ <from>unknown</from>
442
+ <owner>
423
443
  <organization>
424
- <name>International Organization for Standardization</name>
425
- <abbreviation>ISO</abbreviation>
426
- <uri>www.iso.org</uri>
444
+ <name>ISO/FDIS</name>
427
445
  </organization>
428
- </contributor>
429
- <edition>1</edition>
430
- <language>en</language>
431
- <language>fr</language>
432
- <script>Latn</script>
433
- <status>
434
- <stage>50</stage>
435
- <substage>00</substage>
436
- </status>
437
- <copyright>
438
- <from>unknown</from>
439
- <owner>
440
- <organization>
441
- <name>ISO/FDIS</name>
442
- </organization>
443
- </owner>
444
- </copyright>
445
- <relation type="obsoletes">
446
- <bibitem type="standard">
447
- <formattedref format="text/plain">ISO 17664:2017</formattedref>
448
- </bibitem>
449
- </relation>
450
- <place>Geneva</place>
451
- </bibitem>
452
- </relation>
453
- <place>Geneva</place>
454
- </bibitem>
455
- OUTPUT
456
- end
446
+ </owner>
447
+ </copyright>
448
+ <relation type="obsoletes">
449
+ <bibitem type="standard">
450
+ <formattedref format="text/plain">ISO 17664:2017</formattedref>
451
+ </bibitem>
452
+ </relation>
453
+ <place>Geneva</place>
454
+ </bibitem>
455
+ </relation>
456
+ <place>Geneva</place>
457
+ </bibitem>
458
+ OUTPUT
459
+ end
457
460
  end
458
461
  end