metanorma-iso 1.10.6 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +26 -0
  3. data/Makefile +1 -1
  4. data/lib/asciidoctor/iso/base.rb +2 -69
  5. data/lib/asciidoctor/iso/cleanup.rb +2 -175
  6. data/lib/asciidoctor/iso/converter.rb +2 -17
  7. data/lib/asciidoctor/iso/deprecated.rb +5 -0
  8. data/lib/asciidoctor/iso/front.rb +2 -169
  9. data/lib/asciidoctor/iso/front_id.rb +2 -224
  10. data/lib/asciidoctor/iso/section.rb +2 -48
  11. data/lib/asciidoctor/iso/validate.rb +2 -171
  12. data/lib/asciidoctor/iso/validate_image.rb +2 -96
  13. data/lib/asciidoctor/iso/validate_requirements.rb +2 -110
  14. data/lib/asciidoctor/iso/validate_section.rb +2 -246
  15. data/lib/asciidoctor/iso/validate_style.rb +2 -169
  16. data/lib/asciidoctor/iso/validate_title.rb +2 -104
  17. data/lib/isodoc/iso/html/htmlstyle.css +47 -0
  18. data/lib/isodoc/iso/html/isodoc.css +1326 -0
  19. data/lib/isodoc/iso/html/isodoc.scss +0 -1
  20. data/lib/isodoc/iso/html/style-human.css +1015 -0
  21. data/lib/isodoc/iso/html/style-human.scss +8 -2
  22. data/lib/isodoc/iso/html/style-iso.css +1042 -0
  23. data/lib/isodoc/iso/html/style-iso.scss +9 -2
  24. data/lib/isodoc/iso/html/wordstyle.css +1701 -0
  25. data/lib/isodoc/iso/html_convert.rb +6 -4
  26. data/lib/isodoc/iso/iso.amendment.xsl +2142 -1565
  27. data/lib/isodoc/iso/iso.international-standard.xsl +2142 -1565
  28. data/lib/isodoc/iso/word_convert.rb +2 -0
  29. data/lib/metanorma/iso/base.rb +70 -0
  30. data/lib/{asciidoctor → metanorma}/iso/basicdoc.rng +5 -3
  31. data/lib/{asciidoctor → metanorma}/iso/biblio.rng +7 -5
  32. data/lib/{asciidoctor → metanorma}/iso/boilerplate-fr.xml +0 -0
  33. data/lib/{asciidoctor → metanorma}/iso/boilerplate.xml +0 -0
  34. data/lib/metanorma/iso/cleanup.rb +176 -0
  35. data/lib/metanorma/iso/converter.rb +18 -0
  36. data/lib/metanorma/iso/front.rb +170 -0
  37. data/lib/metanorma/iso/front_id.rb +225 -0
  38. data/lib/{asciidoctor → metanorma}/iso/isodoc.rng +98 -1
  39. data/lib/{asciidoctor → metanorma}/iso/isostandard-amd.rng +0 -0
  40. data/lib/{asciidoctor → metanorma}/iso/isostandard.rnc +0 -0
  41. data/lib/{asciidoctor → metanorma}/iso/isostandard.rng +0 -0
  42. data/lib/{asciidoctor → metanorma}/iso/reqt.rng +0 -0
  43. data/lib/metanorma/iso/section.rb +49 -0
  44. data/lib/metanorma/iso/validate.rb +172 -0
  45. data/lib/metanorma/iso/validate_image.rb +97 -0
  46. data/lib/metanorma/iso/validate_requirements.rb +111 -0
  47. data/lib/metanorma/iso/validate_section.rb +248 -0
  48. data/lib/metanorma/iso/validate_style.rb +170 -0
  49. data/lib/metanorma/iso/validate_title.rb +105 -0
  50. data/lib/metanorma/iso/version.rb +1 -1
  51. data/lib/metanorma-iso.rb +1 -1
  52. data/metanorma-iso.gemspec +1 -1
  53. data/spec/isodoc/ref_spec.rb +4 -2
  54. data/spec/isodoc/xref_spec.rb +18 -18
  55. data/spec/{asciidoctor → metanorma}/amd_spec.rb +1 -1
  56. data/spec/{asciidoctor → metanorma}/base_spec.rb +158 -197
  57. data/spec/{asciidoctor → metanorma}/blank_spec.rb +1 -1
  58. data/spec/{asciidoctor → metanorma}/blocks_spec.rb +1 -1
  59. data/spec/{asciidoctor → metanorma}/cleanup_spec.rb +1 -1
  60. data/spec/{asciidoctor → metanorma}/inline_spec.rb +1 -1
  61. data/spec/{asciidoctor → metanorma}/lists_spec.rb +1 -1
  62. data/spec/{asciidoctor → metanorma}/refs_spec.rb +2 -5
  63. data/spec/{asciidoctor → metanorma}/section_spec.rb +1 -1
  64. data/spec/{asciidoctor → metanorma}/table_spec.rb +1 -1
  65. data/spec/{asciidoctor → metanorma}/validate_spec.rb +28 -3
  66. data/spec/spec_helper.rb +1 -1
  67. metadata +46 -30
  68. data/spec/vcr_cassettes/docrels.yml +0 -393
  69. data/spec/vcr_cassettes/sortrefs.yml +0 -599
@@ -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