metanorma-iso 2.1.6 → 2.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +3 -1
  3. data/.github/workflows/release.yml +24 -0
  4. data/lib/isodoc/iso/html/html_iso_titlepage.html +2 -2
  5. data/lib/isodoc/iso/html/style-human.css +34 -2
  6. data/lib/isodoc/iso/html/style-human.scss +35 -1
  7. data/lib/isodoc/iso/html/style-iso.css +34 -2
  8. data/lib/isodoc/iso/html/style-iso.scss +36 -1
  9. data/lib/isodoc/iso/i18n-en.yaml +4 -0
  10. data/lib/isodoc/iso/i18n-fr.yaml +5 -0
  11. data/lib/isodoc/iso/i18n-ru.yaml +4 -0
  12. data/lib/isodoc/iso/i18n-zh-Hans.yaml +5 -0
  13. data/lib/isodoc/iso/init.rb +4 -0
  14. data/lib/isodoc/iso/iso.amendment.xsl +195 -197
  15. data/lib/isodoc/iso/iso.international-standard.xsl +195 -197
  16. data/lib/isodoc/iso/presentation_xml_convert.rb +22 -6
  17. data/lib/isodoc/iso/xref.rb +35 -4
  18. data/lib/metanorma/iso/base.rb +4 -0
  19. data/lib/metanorma/iso/biblio.rng +8 -5
  20. data/lib/metanorma/iso/cleanup.rb +5 -1
  21. data/lib/metanorma/iso/front_id.rb +63 -38
  22. data/lib/metanorma/iso/section.rb +5 -0
  23. data/lib/metanorma/iso/validate.rb +3 -2
  24. data/lib/metanorma/iso/version.rb +1 -1
  25. data/lib/metanorma/requirements/modspec.rb +60 -0
  26. data/lib/metanorma/requirements/requirements.rb +16 -0
  27. data/lib/metanorma-iso.rb +2 -1
  28. data/metanorma-iso.gemspec +1 -1
  29. data/spec/assets/iso.adoc +10 -0
  30. data/spec/examples/rice_img/1000-1_ed2amd3fig1a.png +0 -0
  31. data/spec/examples/rice_img/1000-1_ed2amd3fig1b.png +0 -0
  32. data/spec/examples/rice_img/1000-1_ed2amd3fig2.png +0 -0
  33. data/spec/examples/rice_img/1000-1_ed2amd3fig3.png +0 -0
  34. data/spec/examples/rice_img/1000-1_ed2amd3fig4.png +0 -0
  35. data/spec/examples/rice_img/1000-1_ed2amd3fig5_f.png +0 -0
  36. data/spec/examples/rice_img/1000-1_ed2amd3figA.png +0 -0
  37. data/spec/examples/rice_img/1000-1_ed2amd3figA1.png +0 -0
  38. data/spec/examples/rice_img/1000-1_ed2amd3figA2.png +0 -0
  39. data/spec/examples/rice_img/1000-1_ed2amd3figTab1.png +0 -0
  40. data/spec/examples/rice_img/1000-1_ed2amd3figTab2.png +0 -0
  41. data/spec/examples/rice_img/1001_ed2amd3fig1.png +0 -0
  42. data/spec/examples/rice_img/ISO_1213_1.png +0 -0
  43. data/spec/examples/rice_img/SL1000-1_ed2amd3fig1.png +0 -0
  44. data/spec/isodoc/ref_spec.rb +129 -82
  45. data/spec/metanorma/amd_spec.rb +0 -10
  46. data/spec/metanorma/base_spec.rb +15 -12
  47. data/spec/metanorma/cleanup_spec.rb +136 -0
  48. data/spec/metanorma/macros_spec.rb +99 -0
  49. data/spec/metanorma/processor_spec.rb +86 -86
  50. data/spec/metanorma/section_spec.rb +2 -2
  51. data/spec/metanorma/validate_spec.rb +41 -40
  52. data/spec/requirements/requirements_spec.rb +1299 -0
  53. data/spec/requirements/xref_spec.rb +1205 -0
  54. data/spec/vcr_cassettes/docrels.yml +385 -0
  55. data/spec/vcr_cassettes/withdrawn_iso.yml +21 -21
  56. metadata +40 -18
@@ -9,95 +9,95 @@ RSpec.describe Metanorma::Iso::Processor do
9
9
  processor = registry.find_processor(:iso)
10
10
 
11
11
  inputxml = <<~INPUT
12
- <iso-standard xmlns="http://riboseinc.com/isoxml">
13
- <bibdata type="standard">
14
- <title language="en" format="text/plain" type="main">English</title>
15
- <title language="en" format="text/plain" type="title-main">English</title>
16
- <title language="fr" format="text/plain" type="main">French</title>
17
- <title language="fr" format="text/plain" type="title-main">French</title>
18
- <docidentifier type="ISO">ISO DIR 1</docidentifier><docidentifier type="iso-with-lang">ISO DIR 1(F)</docidentifier><docidentifier type="iso-reference">ISO DIR 1(F)</docidentifier>
19
- <docnumber>1</docnumber>
20
- <contributor>
21
- <role type="author"/>
22
- <organization>
23
- <name>International Organization for Standardization</name>
24
- <abbreviation>ISO</abbreviation>
25
- </organization>
26
- </contributor>
27
- <contributor>
28
- <role type="publisher"/>
29
- <organization>
30
- <name>International Organization for Standardization</name>
31
- <abbreviation>ISO</abbreviation>
32
- </organization>
33
- </contributor>
34
- <language>fr</language>
35
- <script>Latn</script>
36
- <status>
37
- <stage abbreviation="IS">60</stage>
38
- <substage>60</substage>
39
- </status>
40
- <copyright>
41
- <from>#{Time.new.year}</from>
42
- <owner>
43
- <organization>
44
- <name>International Organization for Standardization</name>
45
- <abbreviation>ISO</abbreviation>
46
- </organization>
47
- </owner>
48
- </copyright>
49
- <ext>
50
- <doctype>directive</doctype>
51
- <subdoctype>vocabulary</subdoctype>
52
- <editorialgroup>
53
- <technical-committee/>
54
- <subcommittee/>
55
- <workgroup/>
56
- </editorialgroup>
57
- <structuredidentifier>
58
- <project-number>ISO 1</project-number>
59
- </structuredidentifier>
60
- <stagename>International standard</stagename>
61
- </ext>
62
- </bibdata>
63
- <boilerplate>
64
- <copyright-statement>
65
- <clause>
66
- <title>DOCUMENT PROT&#201;G&#201; PAR COPYRIGHT</title>
67
- <p id="boilerplate-year">&#169; ISO 2021</p>
12
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
13
+ <bibdata type="standard">
14
+ <title language="en" format="text/plain" type="main">English</title>
15
+ <title language="en" format="text/plain" type="title-main">English</title>
16
+ <title language="fr" format="text/plain" type="main">French</title>
17
+ <title language="fr" format="text/plain" type="title-main">French</title>
18
+ <docidentifier type="ISO">ISO DIR 1</docidentifier><docidentifier type="iso-with-lang">ISO DIR 1(F)</docidentifier><docidentifier type="iso-reference">ISO DIR 1(F)</docidentifier>
19
+ <docnumber>1</docnumber>
20
+ <contributor>
21
+ <role type="author"/>
22
+ <organization>
23
+ <name>International Organization for Standardization</name>
24
+ <abbreviation>ISO</abbreviation>
25
+ </organization>
26
+ </contributor>
27
+ <contributor>
28
+ <role type="publisher"/>
29
+ <organization>
30
+ <name>International Organization for Standardization</name>
31
+ <abbreviation>ISO</abbreviation>
32
+ </organization>
33
+ </contributor>
34
+ <language>fr</language>
35
+ <script>Latn</script>
36
+ <status>
37
+ <stage abbreviation="IS">60</stage>
38
+ <substage>60</substage>
39
+ </status>
40
+ <copyright>
41
+ <from>#{Time.new.year}</from>
42
+ <owner>
43
+ <organization>
44
+ <name>International Organization for Standardization</name>
45
+ <abbreviation>ISO</abbreviation>
46
+ </organization>
47
+ </owner>
48
+ </copyright>
49
+ <ext>
50
+ <doctype>directive</doctype>
51
+ <subdoctype>vocabulary</subdoctype>
52
+ <editorialgroup>
53
+ <technical-committee/>
54
+ <subcommittee/>
55
+ <workgroup/>
56
+ </editorialgroup>
57
+ <structuredidentifier>
58
+ <project-number>ISO 1</project-number>
59
+ </structuredidentifier>
60
+ <stagename>International standard</stagename>
61
+ </ext>
62
+ </bibdata>
63
+ <boilerplate>
64
+ <copyright-statement>
65
+ <clause>
66
+ <title>DOCUMENT PROT&#201;G&#201; PAR COPYRIGHT</title>
67
+ <p id="boilerplate-year">&#169; ISO 2021</p>
68
68
 
69
- <p id="boilerplate-message">
70
- Droits de reproduction r&#233;serv&#233;s. Sauf indication contraire, aucune partie de cette publication ne
71
- peut &#234;tre reproduite ni utilis&#233;e sous quelque forme que ce soit et par aucun proc&#233;d&#233;, &#233;lectronique
72
- ou m&#233;canique, y compris la photocopie, l&#8217;affichage sur l&#8217;internet ou sur un Intranet, sans
73
- autorisation &#233;crite pr&#233;alable. Les demandes d&#8217;autorisation peuvent &#234;tre adress&#233;es &#224; l&#8217;ISO &#224;
74
- l&#8217;adresse ci-apr&#232;s ou au comit&#233; membre de l&#8217;ISO dans le pays du demandeur.
75
- </p>
69
+ <p id="boilerplate-message">
70
+ Droits de reproduction r&#233;serv&#233;s. Sauf indication contraire, aucune partie de cette publication ne
71
+ peut &#234;tre reproduite ni utilis&#233;e sous quelque forme que ce soit et par aucun proc&#233;d&#233;, &#233;lectronique
72
+ ou m&#233;canique, y compris la photocopie, l&#8217;affichage sur l&#8217;internet ou sur un Intranet, sans
73
+ autorisation &#233;crite pr&#233;alable. Les demandes d&#8217;autorisation peuvent &#234;tre adress&#233;es &#224; l&#8217;ISO &#224;
74
+ l&#8217;adresse ci-apr&#232;s ou au comit&#233; membre de l&#8217;ISO dans le pays du demandeur.
75
+ </p>
76
76
 
77
- <p id="boilerplate-address" align="left">
78
- ISO copyright office<br/>
79
- Ch. de Blandonnet 8 &#8226; CP 401<br/>
80
- CH-1214 Vernier, Geneva, Switzerland<br/>
81
- Phone: +41 22 749 01 11<br/>
82
- Email: copyright@iso.org<br/>
83
- Website: www.iso.org
84
- </p>
85
- <p id="boilerplate-place">
86
- Publi&#233; en Suisse
87
- </p>
88
- </clause>
89
- </copyright-statement>
77
+ <p id="boilerplate-address" align="left">
78
+ ISO copyright office<br/>
79
+ Ch. de Blandonnet 8 &#8226; CP 401<br/>
80
+ CH-1214 Vernier, Geneva, Switzerland<br/>
81
+ Phone: +41 22 749 01 11<br/>
82
+ Email: copyright@iso.org<br/>
83
+ Website: www.iso.org
84
+ </p>
85
+ <p id="boilerplate-place">
86
+ Publi&#233; en Suisse
87
+ </p>
88
+ </clause>
89
+ </copyright-statement>
90
90
 
91
91
 
92
- </boilerplate>
93
- <sections>
94
- <terms id="H" obligation="normative"><title>1&#xA0; Terms, Definitions, Symbols and Abbreviated Terms</title>
95
- <term id="J">
96
- <name>1.1</name>
97
- <preferred>Term2</preferred>
98
- </term>
99
- </terms>
100
- </sections>
92
+ </boilerplate>
93
+ <sections>
94
+ <terms id="H" obligation="normative"><title>1&#xA0; Terms, Definitions, Symbols and Abbreviated Terms</title>
95
+ <term id="J">
96
+ <name>1.1</name>
97
+ <preferred>Term2</preferred>
98
+ </term>
99
+ </terms>
100
+ </sections>
101
101
  </iso-standard>
102
102
  INPUT
103
103
 
@@ -152,7 +152,7 @@ l&#8217;adresse ci-apr&#232;s ou au comit&#233; membre de l&#8217;ISO dans le pa
152
152
  FileUtils.rm_f "test.xml"
153
153
  FileUtils.rm_f "test.sts.xml"
154
154
  FileUtils.rm_f "test.iso.sts.xml"
155
- File.open("test.xml", "w") { |f| f.write inputxml }
155
+ File.write("test.xml", inputxml)
156
156
  processor.output(inputxml, "test.xml", "test.sts.xml", :sts)
157
157
  processor.output(inputxml, "test.xml", "test.iso.sts.xml", :isosts)
158
158
  expect(File.exist?("test.sts.xml")).to be true
@@ -12,12 +12,12 @@ RSpec.describe Metanorma::ISO do
12
12
 
13
13
  === Introduction Subsection
14
14
 
15
+ == Acknowledgements
16
+
15
17
  == Scope
16
18
 
17
19
  Text
18
20
 
19
- == Acknowledgements
20
-
21
21
  == Normative References
22
22
 
23
23
  == Terms and Definitions
@@ -35,102 +35,103 @@ RSpec.describe Metanorma::ISO do
35
35
  :partnumber: 1
36
36
  :edition: 2
37
37
  :amendment-number: 3
38
+ :data-uri-image: false
38
39
 
39
40
  .Split-it-right sample divider
40
- image::spec/examples/rice_images/rice_image1.png[]
41
- image::spec/examples/rice_images/SL1000-1_ed2amd3fig1.png[]
42
- image::spec/examples/rice_images/1001_ed2amd3fig1.png[]
43
- image::spec/examples/rice_images/ISO_1213_1.png[]
44
- image::spec/examples/rice_images/1000-1_ed2amd3figA.png[]
41
+ image::spec/examples/rice_img/rice_image1.png[]
42
+ image::spec/examples/rice_img/SL1000-1_ed2amd3fig1.png[]
43
+ image::spec/examples/rice_img/1001_ed2amd3fig1.png[]
44
+ image::spec/examples/rice_img/ISO_1213_1.png[]
45
+ image::spec/examples/rice_img/1000-1_ed2amd3figA.png[]
45
46
 
46
47
  |===
47
48
  |a |b
48
49
 
49
- a|image::spec/examples/rice_images/1000-1_ed2amd3figTab1.png[]#{' '}
50
- a|image::spec/examples/rice_images/1000-1_ed2amd3fig2.png[]
50
+ a|image::spec/examples/rice_img/1000-1_ed2amd3figTab1.png[]
51
+ a|image::spec/examples/rice_img/1000-1_ed2amd3fig2.png[]
51
52
  |===
52
53
 
53
- image::spec/examples/rice_images/1000-1_ed2amd3figTab2.png[]
54
+ image::spec/examples/rice_img/1000-1_ed2amd3figTab2.png[]
54
55
 
55
- image::spec/examples/rice_images/1000-1_ed2amd3figA1.png[]
56
- image::spec/examples/rice_images/1000-1_ed2amd3fig1a.png[]
56
+ image::spec/examples/rice_img/1000-1_ed2amd3figA1.png[]
57
+ image::spec/examples/rice_img/1000-1_ed2amd3fig1a.png[]
57
58
 
58
59
  .Stages of gelatinization
59
60
  ====
60
- image::spec/examples/rice_images/1000-1_ed2amd3fig1b.png[]
61
+ image::spec/examples/rice_img/1000-1_ed2amd3fig1b.png[]
61
62
 
62
- image::spec/examples/rice_images/1000-1_ed2amd3fig4.png[]
63
+ image::spec/examples/rice_img/1000-1_ed2amd3fig4.png[]
63
64
  ====
64
65
 
65
- image::spec/examples/rice_images/1000-1_ed2amd3fig5_f.png[]
66
+ image::spec/examples/rice_img/1000-1_ed2amd3fig5_f.png[]
66
67
 
67
68
  [appendix]
68
69
  == Annex
69
- image::spec/examples/rice_images/1000-1_ed2amd3figA2.png[]
70
- image::spec/examples/rice_images/1000-1_ed2amd3fig3.png[]
70
+ image::spec/examples/rice_img/1000-1_ed2amd3figA2.png[]
71
+ image::spec/examples/rice_img/1000-1_ed2amd3fig3.png[]
71
72
 
72
73
  INPUT
73
74
  expect(File.read("test.err")).to include \
74
- "image name spec/examples/rice_images/rice_image1.png does not match "\
75
+ "image name spec/examples/rice_img/rice_image1.png does not match "\
75
76
  "DRG requirements: expect 1000-1_ed2amd3fig"
76
77
  expect(File.read("test.err")).to include \
77
- "image name spec/examples/rice_images/1001_ed2amd3fig1.png does not "\
78
+ "image name spec/examples/rice_img/1001_ed2amd3fig1.png does not "\
78
79
  "match DRG requirements: " \
79
80
  "expect 1000-1_ed2amd3fig"
80
81
  expect(File.read("test.err")).not_to include \
81
- "image name spec/examples/rice_images/SL1000-1_ed2amd3fig1.png does not "\
82
+ "image name spec/examples/rice_img/SL1000-1_ed2amd3fig1.png does not "\
82
83
  "match DRG requirements: " \
83
84
  "expect 1000-1_ed2amd3fig"
84
85
  expect(File.read("test.err")).not_to include \
85
- "image name spec/examples/rice_images/ISO_1213_1.png does not match DRG "\
86
+ "image name spec/examples/rice_img/ISO_1213_1.png does not match DRG "\
86
87
  "requirements: expect 1000-1_ed2amd3fig"
87
88
  expect(File.read("test.err")).to include \
88
- "image name spec/examples/rice_images/1000-1_ed2amd3figA.png does not "\
89
+ "image name spec/examples/rice_img/1000-1_ed2amd3figA.png does not "\
89
90
  "match DRG requirements"
90
91
  expect(File.read("test.err")).not_to include \
91
- "image name spec/examples/rice_images/1000-1_ed2amd3figTab1.png does "\
92
+ "image name spec/examples/rice_img/1000-1_ed2amd3figTab1.png does "\
92
93
  "not match DRG requirements"
93
94
  expect(File.read("test.err")).not_to include \
94
- "image name spec/examples/rice_images/1000-1_ed2amd3figTab1.png is "\
95
+ "image name spec/examples/rice_img/1000-1_ed2amd3figTab1.png is "\
95
96
  "under a table but is not so labelled"
96
97
  expect(File.read("test.err")).to include \
97
- "image name spec/examples/rice_images/1000-1_ed2amd3fig2.png is under "\
98
+ "image name spec/examples/rice_img/1000-1_ed2amd3fig2.png is under "\
98
99
  "a table but is not so labelled"
99
100
  expect(File.read("test.err")).to include \
100
- "image name spec/examples/rice_images/1000-1_ed2amd3figTab2.png is "\
101
+ "image name spec/examples/rice_img/1000-1_ed2amd3figTab2.png is "\
101
102
  "labelled as under a table but is not"
102
103
  expect(File.read("test.err")).not_to include \
103
- "image name spec/examples/rice_images/1000-1_ed2amd3fig1.png is "\
104
+ "image name spec/examples/rice_img/1000-1_ed2amd3fig1.png is "\
104
105
  "labelled as under a table but is not"
105
106
  expect(File.read("test.err")).not_to include \
106
- "image name spec/examples/rice_images/1000-1_ed2amd3figA2.png is "\
107
+ "image name spec/examples/rice_img/1000-1_ed2amd3figA2.png is "\
107
108
  "under an annex but is not so labelled"
108
109
  expect(File.read("test.err")).to include \
109
- "image name spec/examples/rice_images/1000-1_ed2amd3fig3.png is "\
110
+ "image name spec/examples/rice_img/1000-1_ed2amd3fig3.png is "\
110
111
  "under an annex but is not so labelled"
111
112
  expect(File.read("test.err")).to include \
112
- "image name spec/examples/rice_images/1000-1_ed2amd3figA1.png is "\
113
+ "image name spec/examples/rice_img/1000-1_ed2amd3figA1.png is "\
113
114
  "labelled as under an annex but is not"
114
115
  expect(File.read("test.err")).not_to include \
115
- "image name spec/examples/rice_images/1000-1_ed2amd3fig1.png is "\
116
+ "image name spec/examples/rice_img/1000-1_ed2amd3fig1.png is "\
116
117
  "labelled as under an annex but is not"
117
118
  expect(File.read("test.err")).not_to include \
118
- "image name spec/examples/rice_images/1000-1_ed2amd3fig1b.png has a "\
119
+ "image name spec/examples/rice_img/1000-1_ed2amd3fig1b.png has a "\
119
120
  "subfigure letter but is not a subfigure"
120
121
  expect(File.read("test.err")).to include \
121
- "image name spec/examples/rice_images/1000-1_ed2amd3fig4.png does not "\
122
+ "image name spec/examples/rice_img/1000-1_ed2amd3fig4.png does not "\
122
123
  "have a subfigure letter but is a subfigure"
123
124
  expect(File.read("test.err")).to include \
124
- "image name spec/examples/rice_images/1000-1_ed2amd3fig1a.png has a "\
125
+ "image name spec/examples/rice_img/1000-1_ed2amd3fig1a.png has a "\
125
126
  "subfigure letter but is not a subfigure"
126
127
  expect(File.read("test.err")).not_to include \
127
- "image name spec/examples/rice_images/1000-1_ed2amd3fig1.png has a "\
128
+ "image name spec/examples/rice_img/1000-1_ed2amd3fig1.png has a "\
128
129
  "subfigure letter but is not a subfigure"
129
130
  expect(File.read("test.err")).to include \
130
- "image name spec/examples/rice_images/1000-1_ed2amd3fig5_f.png expected "\
131
+ "image name spec/examples/rice_img/1000-1_ed2amd3fig5_f.png expected "\
131
132
  "to have suffix _e"
132
133
  expect(File.read("test.err")).not_to include \
133
- "image name spec/examples/rice_images/1000-1_ed2amd3fig1.png expected "\
134
+ "image name spec/examples/rice_img/1000-1_ed2amd3fig1.png expected "\
134
135
  "to have suffix _e"
135
136
  end
136
137
 
@@ -487,7 +488,7 @@ RSpec.describe Metanorma::ISO do
487
488
  Asciidoctor.convert(<<~"INPUT", *OPTIONS)
488
489
  #{VALIDATING_BLANK_HDR}
489
490
 
490
- image::spec/examples/rice_images/rice_image1.png[]
491
+ image::spec/examples/rice_img/rice_image1.png[]
491
492
  INPUT
492
493
  expect(File.read("test.err")).to include "Figure should have title"
493
494
  end
@@ -2136,12 +2137,12 @@ RSpec.describe Metanorma::ISO do
2136
2137
 
2137
2138
  [[b]]
2138
2139
  === Term 1
2139
- <<b>>
2140
- <<c>>
2140
+ _<<b>>_
2141
+ _<<c>>_
2141
2142
 
2142
2143
  == Clause
2143
- <<b>>
2144
- <<c>>
2144
+ _<<b>>_
2145
+ _<<c>>_
2145
2146
 
2146
2147
  INPUT
2147
2148
  expect(File.read("test.err"))