metanorma-iso 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/lib/html2doc/lists.rb +142 -10
  3. data/lib/isodoc/iso/base_convert.rb +10 -0
  4. data/lib/isodoc/iso/html/html_iso_titlepage.html +2 -0
  5. data/lib/isodoc/iso/html/isodoc-dis.css +170 -252
  6. data/lib/isodoc/iso/html/isodoc-dis.scss +170 -245
  7. data/lib/isodoc/iso/html/isodoc.css +38 -13
  8. data/lib/isodoc/iso/html/isodoc.scss +38 -12
  9. data/lib/isodoc/iso/html/style-human.css +14 -1
  10. data/lib/isodoc/iso/html/style-human.scss +10 -1
  11. data/lib/isodoc/iso/html/style-iso.css +35 -23
  12. data/lib/isodoc/iso/html/style-iso.scss +31 -23
  13. data/lib/isodoc/iso/html/word_iso_intro-dis.html +1 -6
  14. data/lib/isodoc/iso/html/word_iso_titlepage-dis.html +24 -13
  15. data/lib/isodoc/iso/html/word_iso_titlepage-prf.html +58 -0
  16. data/lib/isodoc/iso/html/word_iso_titlepage.html +6 -2
  17. data/lib/isodoc/iso/html_convert.rb +5 -0
  18. data/lib/isodoc/iso/i18n-en.yaml +32 -4
  19. data/lib/isodoc/iso/i18n-fr.yaml +29 -3
  20. data/lib/isodoc/iso/i18n-ru.yaml +32 -4
  21. data/lib/isodoc/iso/i18n-zh-Hans.yaml +32 -3
  22. data/lib/isodoc/iso/i18n.rb +1 -1
  23. data/lib/isodoc/iso/iso.amendment.xsl +332 -187
  24. data/lib/isodoc/iso/iso.international-standard.xsl +332 -187
  25. data/lib/isodoc/iso/metadata.rb +63 -63
  26. data/lib/isodoc/iso/presentation_bibdata.rb +74 -0
  27. data/lib/isodoc/iso/presentation_xml_convert.rb +14 -3
  28. data/lib/isodoc/iso/presentation_xref.rb +8 -2
  29. data/lib/isodoc/iso/sections.rb +1 -1
  30. data/lib/isodoc/iso/word_cleanup.rb +3 -0
  31. data/lib/isodoc/iso/word_convert.rb +6 -3
  32. data/lib/isodoc/iso/word_dis_cleanup.rb +235 -0
  33. data/lib/isodoc/iso/word_dis_convert.rb +47 -108
  34. data/lib/isodoc/iso/xref.rb +34 -6
  35. data/lib/metanorma/iso/base.rb +20 -1
  36. data/lib/metanorma/iso/biblio.rng +32 -34
  37. data/lib/metanorma/iso/boilerplate-fr.xml +3 -0
  38. data/lib/metanorma/iso/boilerplate-ru.xml +3 -0
  39. data/lib/metanorma/iso/boilerplate.xml +3 -0
  40. data/lib/metanorma/iso/cleanup.rb +28 -1
  41. data/lib/metanorma/iso/front.rb +31 -6
  42. data/lib/metanorma/iso/front_id.rb +2 -0
  43. data/lib/metanorma/iso/isodoc.rng +9 -0
  44. data/lib/metanorma/iso/isostandard.rng +30 -12
  45. data/lib/metanorma/iso/macros.rb +29 -0
  46. data/lib/metanorma/iso/version.rb +1 -1
  47. data/spec/isodoc/amd_spec.rb +4 -30
  48. data/spec/isodoc/blocks_spec.rb +499 -2
  49. data/spec/isodoc/i18n_spec.rb +145 -80
  50. data/spec/isodoc/iso_spec.rb +50 -169
  51. data/spec/isodoc/metadata_spec.rb +224 -83
  52. data/spec/isodoc/postproc_spec.rb +41 -5
  53. data/spec/isodoc/section_spec.rb +12 -6
  54. data/spec/isodoc/word_dis_spec.rb +1273 -147
  55. data/spec/isodoc/xref_spec.rb +87 -13
  56. data/spec/metanorma/amd_spec.rb +53 -1
  57. data/spec/metanorma/base_spec.rb +185 -10
  58. data/spec/metanorma/blocks_spec.rb +54 -0
  59. data/spec/metanorma/lists_spec.rb +2 -2
  60. data/spec/metanorma/section_spec.rb +2 -2
  61. data/spec/spec_helper.rb +13 -4
  62. data/spec/vcr_cassettes/withdrawn_iso.yml +27 -27
  63. metadata +7 -8
  64. data/docs/asciiiso-syntax.adoc +0 -307
  65. data/docs/guidance.adoc +0 -487
  66. data/docs/navigation.adoc +0 -23
  67. data/docs/quickstart.adoc +0 -179
  68. data/lib/isodoc/iso/presentation_inline.rb +0 -90
@@ -455,8 +455,8 @@ RSpec.describe Metanorma::ISO do
455
455
 
456
456
  INPUT
457
457
  output = <<~OUTPUT
458
- #{BLANK_HDR.sub(%r{<doctype>article</doctype>},
459
- '<doctype>article</doctype><subdoctype>vocabulary</subdoctype>')}
458
+ #{BLANK_HDR.sub(%r{<doctype>standard</doctype>},
459
+ '<doctype>standard</doctype><subdoctype>vocabulary</subdoctype>')}
460
460
  <sections>
461
461
  <terms id='_' obligation='normative'>
462
462
  <title>Terms and Definitions</title>
data/spec/spec_helper.rb CHANGED
@@ -47,7 +47,7 @@ RSpec.configure do |config|
47
47
  end
48
48
 
49
49
  def strip_guid(xml)
50
- xml.gsub(%r{ id="_[^"]+"}, ' id="_"')
50
+ xml.gsub(%r{ id=['"]_[^"']+['"]}, ' id="_"')
51
51
  .gsub(%r{ target="_[^"]+"}, ' target="_"')
52
52
  .gsub(%r{ src="cid:[^.]+.gif"}, ' src="_.gif"')
53
53
  .gsub(%r{ src='cid:[^.]+.gif'}, ' src="_.gif"')
@@ -151,7 +151,8 @@ BOILERPLATE =
151
151
  File.read(ASCIIDOCTOR_ISO_DIR / "boilerplate.xml", encoding: "utf-8")
152
152
  .gsub(/\{\{ agency \}\}/, "ISO")
153
153
  .gsub(/\{\{ docyear \}\}/, Date.today.year.to_s)
154
- .gsub(/\{% if unpublished %\}.*\{% endif %\}/m, "")
154
+ .gsub(/\{% if unpublished %\}.*?\{% endif %\}/m, "")
155
+ .gsub(/\{% if stage_int >= 40 %\}(.*?)\{% endif %\}/m, "\\1")
155
156
  .gsub(/(?<=\p{Alnum})'(?=\p{Alpha})/, "’"),
156
157
  )
157
158
 
@@ -160,7 +161,8 @@ BOILERPLATE_FR =
160
161
  File.read(ASCIIDOCTOR_ISO_DIR / "boilerplate-fr.xml", encoding: "utf-8")
161
162
  .gsub(/\{\{ agency \}\}/, "ISO")
162
163
  .gsub(/\{\{ docyear \}\}/, Date.today.year.to_s)
163
- .gsub(/\{% if unpublished %\}.*\{% endif %\}/m, "")
164
+ .gsub(/\{% if unpublished %\}.*?\{% endif %\}/m, "")
165
+ .gsub(/\{% if stage_int >= 40 %\}(.*?)\{% endif %\}/m, "\\1")
164
166
  .gsub(/(?<=\p{Alnum})'(?=\p{Alpha})/, "’"),
165
167
  )
166
168
 
@@ -198,12 +200,19 @@ BLANK_HDR1 = <<~"HDR".freeze
198
200
  </owner>
199
201
  </copyright>
200
202
  <ext>
201
- <doctype>article</doctype>
203
+ <doctype>standard</doctype>
202
204
  <editorialgroup>
205
+ <agency>ISO</agency>
203
206
  <technical-committee/>
204
207
  <subcommittee/>
205
208
  <workgroup/>
206
209
  </editorialgroup>
210
+ <approvalgroup>
211
+ <agency>ISO</agency>
212
+ <technical-committee/>
213
+ <subcommittee/>
214
+ <workgroup/>
215
+ </approvalgroup>
207
216
  <stagename>International standard</stagename>
208
217
  </ext>
209
218
  </bibdata>