metanorma-iso 2.0.7 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/lib/asciidoctor/iso/base.rb +0 -1
  3. data/lib/asciidoctor/iso/cleanup.rb +0 -1
  4. data/lib/asciidoctor/iso/converter.rb +0 -1
  5. data/lib/asciidoctor/iso/deprecated.rb +4 -2
  6. data/lib/asciidoctor/iso/front.rb +0 -1
  7. data/lib/asciidoctor/iso/front_id.rb +0 -1
  8. data/lib/asciidoctor/iso/section.rb +0 -1
  9. data/lib/asciidoctor/iso/validate.rb +0 -1
  10. data/lib/asciidoctor/iso/validate_image.rb +0 -1
  11. data/lib/asciidoctor/iso/validate_requirements.rb +0 -1
  12. data/lib/asciidoctor/iso/validate_section.rb +0 -1
  13. data/lib/asciidoctor/iso/validate_style.rb +0 -1
  14. data/lib/asciidoctor/iso/validate_title.rb +0 -1
  15. data/lib/html2doc/lists.rb +37 -0
  16. data/lib/isodoc/iso/html/html_iso_titlepage.html +7 -2
  17. data/lib/isodoc/iso/html/isodoc-dis.css +196 -156
  18. data/lib/isodoc/iso/html/isodoc-dis.scss +193 -156
  19. data/lib/isodoc/iso/html/word_iso_intro-dis.html +7 -0
  20. data/lib/isodoc/iso/html/word_iso_titlepage-dis.html +3 -2
  21. data/lib/isodoc/iso/html/word_iso_titlepage.html +8 -2
  22. data/lib/isodoc/iso/html/wordstyle-dis.css +204 -34
  23. data/lib/isodoc/iso/html/wordstyle-dis.scss +198 -34
  24. data/lib/isodoc/iso/i18n-en.yaml +2 -1
  25. data/lib/isodoc/iso/i18n-fr.yaml +1 -0
  26. data/lib/isodoc/iso/i18n-ru.yaml +1 -0
  27. data/lib/isodoc/iso/i18n-zh-Hans.yaml +1 -0
  28. data/lib/isodoc/iso/index.rb +1 -1
  29. data/lib/isodoc/iso/init.rb +17 -1
  30. data/lib/isodoc/iso/iso.amendment.xsl +726 -299
  31. data/lib/isodoc/iso/iso.international-standard.xsl +726 -299
  32. data/lib/isodoc/iso/metadata.rb +75 -63
  33. data/lib/isodoc/iso/presentation_inline.rb +90 -0
  34. data/lib/isodoc/iso/presentation_xml_convert.rb +39 -100
  35. data/lib/isodoc/iso/presentation_xref.rb +126 -0
  36. data/lib/isodoc/iso/word_cleanup.rb +16 -2
  37. data/lib/isodoc/iso/word_convert.rb +27 -10
  38. data/lib/isodoc/iso/word_dis_convert.rb +174 -0
  39. data/lib/isodoc/iso/xref.rb +50 -30
  40. data/lib/metanorma/iso/biblio.rng +62 -10
  41. data/lib/metanorma/iso/boilerplate-fr.xml +1 -1
  42. data/lib/metanorma/iso/boilerplate-ru.xml +1 -3
  43. data/lib/metanorma/iso/boilerplate.xml +1 -3
  44. data/lib/metanorma/iso/cleanup.rb +7 -6
  45. data/lib/metanorma/iso/front_id.rb +28 -11
  46. data/lib/metanorma/iso/isodoc.rng +56 -0
  47. data/lib/metanorma/iso/version.rb +1 -1
  48. data/lib/metanorma-iso.rb +1 -0
  49. data/lib/relaton/render/config.yml +4 -0
  50. data/lib/relaton/render/general.rb +13 -0
  51. data/metanorma-iso.gemspec +1 -1
  52. data/spec/isodoc/amd_spec.rb +15 -14
  53. data/spec/isodoc/blocks_spec.rb +286 -179
  54. data/spec/isodoc/i18n_spec.rb +296 -133
  55. data/spec/isodoc/inline_spec.rb +35 -42
  56. data/spec/isodoc/iso_spec.rb +43 -27
  57. data/spec/isodoc/postproc_spec.rb +25 -0
  58. data/spec/isodoc/ref_spec.rb +66 -69
  59. data/spec/isodoc/section_spec.rb +78 -76
  60. data/spec/isodoc/table_spec.rb +2 -2
  61. data/spec/isodoc/terms_spec.rb +2 -2
  62. data/spec/isodoc/word_dis_spec.rb +760 -0
  63. data/spec/isodoc/xref_spec.rb +51 -51
  64. data/spec/metanorma/amd_spec.rb +39 -16
  65. data/spec/metanorma/base_spec.rb +17 -9
  66. data/spec/metanorma/blocks_spec.rb +4 -4
  67. data/spec/metanorma/cleanup_spec.rb +11 -11
  68. data/spec/metanorma/section_spec.rb +3 -3
  69. data/spec/spec_helper.rb +5 -2
  70. data/spec/vcr_cassettes/withdrawn_iso.yml +26 -26
  71. metadata +11 -5
  72. data/spec/vcr_cassettes/docrels.yml +0 -385
@@ -93,7 +93,7 @@ RSpec.describe Metanorma::ISO do
93
93
  <terms id="_" obligation="normative">
94
94
  <title>Terms and definitions</title>#{TERM_BOILERPLATE}
95
95
 
96
- <term id="term-tempus">
96
+ <term id="term-Tempus">
97
97
  <preferred><expression><name>Tempus</name></expression></preferred>
98
98
  <domain>relativity</domain>
99
99
  <definition><verbal-definition>
@@ -204,7 +204,7 @@ RSpec.describe Metanorma::ISO do
204
204
  <li>
205
205
  <p id="_">So am I</p></li>
206
206
  </ul>
207
- <term id="term-time">
207
+ <term id="term-Time">
208
208
  <preferred><expression><name>Time</name></expression></preferred>
209
209
  <definition><verbal-definition>
210
210
  <p id="_">This paragraph is extraneous</p>
@@ -454,7 +454,7 @@ RSpec.describe Metanorma::ISO do
454
454
  <terms id="_" obligation="normative">
455
455
  <title>Terms and definitions</title>
456
456
  #{TERM_BOILERPLATE}
457
- <term id="term-term1">
457
+ <term id="term-Term1">
458
458
  <preferred><expression><name>Term1</name></expression></preferred>
459
459
  <definition>
460
460
  <verbal-definition>
@@ -1257,7 +1257,7 @@ RSpec.describe Metanorma::ISO do
1257
1257
  </p>
1258
1258
  </li>
1259
1259
  </ul>
1260
- <term id='term-term1'>
1260
+ <term id='term-Term1'>
1261
1261
  <preferred><expression><name>Term1</name></expression></preferred>
1262
1262
  </term>
1263
1263
  </terms>
@@ -1308,13 +1308,13 @@ RSpec.describe Metanorma::ISO do
1308
1308
  </ul>
1309
1309
  <terms id='_' obligation='normative'>
1310
1310
  <title>Normal Terms</title>
1311
- <term id='term-term1'>
1311
+ <term id='term-Term1'>
1312
1312
  <preferred><expression><name>Term1</name></expression></preferred>
1313
1313
  </term>
1314
1314
  </terms>
1315
1315
  <terms id='_' obligation='normative'>
1316
1316
  <title>Abnormal terms</title>
1317
- <term id='term-term-2'>
1317
+ <term id='term-Term-2'>
1318
1318
  <preferred><expression><name>Term 2</name></expression></preferred>
1319
1319
  </term>
1320
1320
  </terms>
@@ -1372,13 +1372,13 @@ RSpec.describe Metanorma::ISO do
1372
1372
  </ul>
1373
1373
  <terms id='_' obligation='normative'>
1374
1374
  <title>Normal Terms</title>
1375
- <term id='term-term1'>
1375
+ <term id='term-Term1'>
1376
1376
  <preferred><expression><name>Term1</name></expression></preferred>
1377
1377
  </term>
1378
1378
  </terms>
1379
1379
  <terms id='_' obligation='normative'>
1380
1380
  <title>Abnormal terms</title>
1381
- <term id='term-term-2'>
1381
+ <term id='term-Term-2'>
1382
1382
  <preferred><expression><name>Term 2</name></expression></preferred>
1383
1383
  </term>
1384
1384
  </terms>
@@ -1437,13 +1437,13 @@ RSpec.describe Metanorma::ISO do
1437
1437
  </p>
1438
1438
  </li>
1439
1439
  </ul>
1440
- <term id='term-term1'>
1440
+ <term id='term-Term1'>
1441
1441
  <preferred><expression><name>Term1</name></expression></preferred>
1442
1442
  </term>
1443
1443
  </terms>
1444
1444
  <terms id='_' obligation='normative'>
1445
1445
  <title>Other Terms</title>
1446
- <term id='term-term-2'>
1446
+ <term id='term-Term-2'>
1447
1447
  <preferred><expression><name>Term 2</name></expression></preferred>
1448
1448
  </term>
1449
1449
  </terms>
@@ -1495,7 +1495,7 @@ RSpec.describe Metanorma::ISO do
1495
1495
  </p>
1496
1496
  </li>
1497
1497
  </ul>
1498
- <term id='term-term1'>
1498
+ <term id='term-Term1'>
1499
1499
  <preferred><expression><name>Term1</name></expression></preferred>
1500
1500
  </term>
1501
1501
  </terms>
@@ -92,7 +92,7 @@ RSpec.describe Metanorma::ISO do
92
92
  <link target="https://www.electropedia.org"/></p>
93
93
  </li>
94
94
  </ul>
95
- <term id="term-term1">
95
+ <term id="term-Term1">
96
96
  <preferred><expression><name>Term1</name></expression></preferred>
97
97
  </term>
98
98
  </terms>
@@ -100,7 +100,7 @@ RSpec.describe Metanorma::ISO do
100
100
  <title>Terms, definitions, symbols and abbreviated terms</title>
101
101
  <terms id="_" obligation="normative">
102
102
  <title>Normal Terms</title>
103
- <term id="term-term2">
103
+ <term id="term-Term2">
104
104
  <preferred><expression><name>Term2</name></expression></preferred>
105
105
  </term>
106
106
  </terms>
@@ -287,7 +287,7 @@ RSpec.describe Metanorma::ISO do
287
287
  <link target="https://www.electropedia.org"/></p>
288
288
  </li>
289
289
  </ul>
290
- <term id="term-term1">
290
+ <term id="term-Term1">
291
291
  <preferred><expression><name>Term1</name></expression></preferred>
292
292
  </term>
293
293
  </terms>
data/spec/spec_helper.rb CHANGED
@@ -47,7 +47,10 @@ RSpec.configure do |config|
47
47
  end
48
48
 
49
49
  def strip_guid(xml)
50
- xml.gsub(%r{ id="_[^"]+"}, ' id="_"').gsub(%r{ target="_[^"]+"}, ' target="_"')
50
+ xml.gsub(%r{ id="_[^"]+"}, ' id="_"')
51
+ .gsub(%r{ target="_[^"]+"}, ' target="_"')
52
+ .gsub(%r{ src="cid:[^.]+.gif"}, ' src="_.gif"')
53
+ .gsub(%r{ src='cid:[^.]+.gif'}, ' src="_.gif"')
51
54
  end
52
55
 
53
56
  def metadata(hash)
@@ -62,7 +65,7 @@ def xmlpp(xml)
62
65
  f.compact = true
63
66
  f.write(REXML::Document.new(xml
64
67
  .gsub(%r{<fetched>20[0-9-]+</fetched>}, "<fetched/>")), s)
65
- s
68
+ HTMLEntities.new.decode(s)
66
69
  end
67
70
 
68
71
  ASCIIDOC_BLANK_HDR = <<~"HDR".freeze