metanorma-iso 1.10.5 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +3 -33
  3. data/.gitignore +26 -0
  4. data/Makefile +1 -1
  5. data/lib/asciidoctor/iso/base.rb +2 -69
  6. data/lib/asciidoctor/iso/cleanup.rb +2 -175
  7. data/lib/asciidoctor/iso/converter.rb +2 -17
  8. data/lib/asciidoctor/iso/deprecated.rb +5 -0
  9. data/lib/asciidoctor/iso/front.rb +2 -169
  10. data/lib/asciidoctor/iso/front_id.rb +2 -224
  11. data/lib/asciidoctor/iso/section.rb +2 -48
  12. data/lib/asciidoctor/iso/validate.rb +2 -171
  13. data/lib/asciidoctor/iso/validate_image.rb +2 -96
  14. data/lib/asciidoctor/iso/validate_requirements.rb +2 -110
  15. data/lib/asciidoctor/iso/validate_section.rb +2 -246
  16. data/lib/asciidoctor/iso/validate_style.rb +2 -169
  17. data/lib/asciidoctor/iso/validate_title.rb +2 -104
  18. data/lib/isodoc/iso/html/style-human.css +19 -14
  19. data/lib/isodoc/iso/html/style-human.scss +8 -2
  20. data/lib/isodoc/iso/html/style-iso.css +21 -15
  21. data/lib/isodoc/iso/html/style-iso.scss +9 -2
  22. data/lib/isodoc/iso/html_convert.rb +6 -4
  23. data/lib/isodoc/iso/iso.amendment.xsl +1449 -1222
  24. data/lib/isodoc/iso/iso.international-standard.xsl +1449 -1222
  25. data/lib/isodoc/iso/word_convert.rb +2 -0
  26. data/lib/metanorma/iso/base.rb +70 -0
  27. data/lib/{asciidoctor → metanorma}/iso/basicdoc.rng +0 -0
  28. data/lib/{asciidoctor → metanorma}/iso/biblio.rng +2 -2
  29. data/lib/{asciidoctor → metanorma}/iso/boilerplate-fr.xml +0 -0
  30. data/lib/{asciidoctor → metanorma}/iso/boilerplate.xml +0 -0
  31. data/lib/metanorma/iso/cleanup.rb +176 -0
  32. data/lib/metanorma/iso/converter.rb +18 -0
  33. data/lib/metanorma/iso/front.rb +170 -0
  34. data/lib/metanorma/iso/front_id.rb +225 -0
  35. data/lib/{asciidoctor → metanorma}/iso/isodoc.rng +98 -1
  36. data/lib/{asciidoctor → metanorma}/iso/isostandard-amd.rng +0 -0
  37. data/lib/{asciidoctor → metanorma}/iso/isostandard.rnc +0 -0
  38. data/lib/{asciidoctor → metanorma}/iso/isostandard.rng +0 -0
  39. data/lib/{asciidoctor → metanorma}/iso/reqt.rng +0 -0
  40. data/lib/metanorma/iso/section.rb +49 -0
  41. data/lib/metanorma/iso/validate.rb +172 -0
  42. data/lib/metanorma/iso/validate_image.rb +97 -0
  43. data/lib/metanorma/iso/validate_requirements.rb +111 -0
  44. data/lib/metanorma/iso/validate_section.rb +247 -0
  45. data/lib/metanorma/iso/validate_style.rb +170 -0
  46. data/lib/metanorma/iso/validate_title.rb +105 -0
  47. data/lib/metanorma/iso/version.rb +1 -1
  48. data/lib/metanorma-iso.rb +1 -1
  49. data/metanorma-iso.gemspec +2 -2
  50. data/spec/isodoc/ref_spec.rb +4 -2
  51. data/spec/isodoc/section_spec.rb +1 -1
  52. data/spec/{asciidoctor → metanorma}/amd_spec.rb +1 -1
  53. data/spec/{asciidoctor → metanorma}/base_spec.rb +141 -130
  54. data/spec/{asciidoctor → metanorma}/blank_spec.rb +1 -1
  55. data/spec/{asciidoctor → metanorma}/blocks_spec.rb +1 -1
  56. data/spec/{asciidoctor → metanorma}/cleanup_spec.rb +1 -1
  57. data/spec/{asciidoctor → metanorma}/inline_spec.rb +1 -1
  58. data/spec/{asciidoctor → metanorma}/lists_spec.rb +1 -1
  59. data/spec/metanorma/processor_spec.rb +1 -1
  60. data/spec/{asciidoctor → metanorma}/refs_spec.rb +1 -1
  61. data/spec/{asciidoctor → metanorma}/section_spec.rb +1 -1
  62. data/spec/{asciidoctor → metanorma}/table_spec.rb +1 -1
  63. data/spec/{asciidoctor → metanorma}/validate_spec.rb +1 -1
  64. data/spec/spec_helper.rb +1 -1
  65. data/spec/vcr_cassettes/docrels.yml +21 -216
  66. metadata +39 -26
@@ -390,48 +390,54 @@ p.Terms {
390
390
  margin-top: 0em; }
391
391
 
392
392
  /* Navigation*/
393
- #toc {
393
+ #toc, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) {
394
394
  font-family: {{bodyfont}};
395
395
  font-weight: 400; }
396
- #toc ul {
396
+ #toc ul, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) ul {
397
397
  margin: 0;
398
398
  padding: 0;
399
399
  list-style: none; }
400
- #toc ul li a {
400
+ #toc ul li a, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) ul li a {
401
401
  padding: 5px 10px; }
402
- #toc ul a {
402
+ #toc ul a, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) ul a {
403
403
  text-decoration: none;
404
404
  display: block; }
405
- #toc ul a:hover {
405
+ #toc ul a:hover, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) ul a:hover {
406
406
  box-shadow: none;
407
407
  color: black; }
408
- #toc .h2 {
408
+ #toc .h2, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) .h2 {
409
409
  padding-left: 30px; }
410
- #toc .h3 {
410
+ #toc .h3, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) .h3 {
411
411
  padding-left: 50px; }
412
- #toc .toc-active, #toc li:hover {
412
+ #toc .toc-active, #toc li:hover, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) .toc-active, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) li:hover {
413
413
  background: #f7f7f7;
414
414
  box-shadow: inset -5px 0px 10px -5px #f7f7f7 !important; }
415
- #toc .toc-active a, #toc li:hover a {
415
+ #toc .toc-active a, #toc li:hover a, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) .toc-active a, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) li:hover a {
416
416
  color: black; }
417
417
  @media print {
418
- #toc .toc-active, #toc li:hover {
418
+ #toc .toc-active, #toc li:hover, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) .toc-active, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) li:hover {
419
419
  background: white;
420
420
  box-shadow: none !important; }
421
- #toc li:hover a {
421
+ #toc li:hover a, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) li:hover a {
422
422
  color: black; } }
423
423
  @media screen and (max-width: 768px) {
424
- #toc {
424
+ #toc, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) {
425
425
  padding: 0 1.5em;
426
426
  overflow: visible; } }
427
427
  #toc .toc-active,
428
- #toc li:hover {
428
+ #toc li:hover, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) .toc-active,
429
+ #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) li:hover {
429
430
  box-shadow: 0px 1px 0px 0px black !important;
430
431
  background: none; }
431
- #toc li:before {
432
+ #toc li:before, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) li:before {
432
433
  content: " ";
433
434
  display: none; }
434
435
 
436
+ #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) {
437
+ margin-top: 0;
438
+ margin-bottom: 0;
439
+ font-size: 100%; }
440
+
435
441
  nav {
436
442
  line-height: 1.2em; }
437
443
  @media screen and (min-width: 768px) {
@@ -486,7 +492,7 @@ nav {
486
492
  display: none; }
487
493
  h1.toc-contents {
488
494
  margin-top: 1em; }
489
- ul#toc-list {
495
+ ul#toc-list, ul#toc-list > :is(.h1, .h2, .h3, .h4, .h5, .h6) {
490
496
  padding: 0;
491
497
  margin: 0; } }
492
498
 
@@ -198,7 +198,7 @@ p.Terms {
198
198
 
199
199
  /* Navigation*/
200
200
 
201
- #toc {
201
+ #toc, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) {
202
202
  @include toc(null, #f7f7f7, black);
203
203
  @include sidebarToc();
204
204
 
@@ -214,6 +214,13 @@ p.Terms {
214
214
  }
215
215
  }
216
216
 
217
+ #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) {
218
+ margin-top: 0;
219
+ margin-bottom: 0;
220
+ font-size: 100%;
221
+ }
222
+
223
+
217
224
  nav {
218
225
  @include sidebarNav(#f7f7f7, 278px, 20px);
219
226
  line-height: 1.2em;
@@ -239,7 +246,7 @@ nav {
239
246
  margin-top: 1em;
240
247
  }
241
248
 
242
- ul#toc-list {
249
+ ul#toc-list, ul#toc-list > :is(.h1, .h2, .h3, .h4, .h5, .h6) {
243
250
  padding:0;
244
251
  margin:0;
245
252
  }
@@ -58,15 +58,17 @@ module IsoDoc
58
58
  end
59
59
 
60
60
  def html_toc_entry(level, header)
61
- if level == "h1" && header.parent.at(".//h2[not(@class = 'TermNum')]"\
62
- "[not(@class = 'noTOC')][text()]")
61
+ content = header.at("./following-sibling::p"\
62
+ "[@class = 'variant-title-toc']") || header
63
+ if level == "h1" &&
64
+ header.parent.at(".//h2#{toc_exclude_class}")
63
65
  <<~HDR
64
- <li class="#{level}"><div class="collapse-group"><a href="##{header['id']}">#{header_strip(header)}</a></li>
66
+ <li class="#{level}"><div class="collapse-group"><a href="##{header['id']}">#{header_strip(content)}</a></li>
65
67
  <div class="collapse-button"></div></div>
66
68
  HDR
67
69
  else
68
70
  %(<li class="#{level}"><a href="##{header['id']}">\
69
- #{header_strip(header)}</a></li>)
71
+ #{header_strip(content)}</a></li>)
70
72
  end
71
73
  end
72
74