metanorma-iso 2.2.2 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc/iso/html/header-dis.html +111 -29
  3. data/lib/isodoc/iso/html/isodoc-dis.css +65 -64
  4. data/lib/isodoc/iso/html/isodoc-dis.scss +65 -64
  5. data/lib/isodoc/iso/html/style-human.css +1 -2
  6. data/lib/isodoc/iso/html/style-human.scss +0 -1
  7. data/lib/isodoc/iso/html/style-iso.css +1 -2
  8. data/lib/isodoc/iso/html/style-iso.scss +0 -1
  9. data/lib/isodoc/iso/html/wordstyle-dis.css +10 -4
  10. data/lib/isodoc/iso/html/wordstyle-dis.scss +10 -4
  11. data/lib/isodoc/iso/i18n-en.yaml +4 -4
  12. data/lib/isodoc/iso/iso.amendment.xsl +205 -37
  13. data/lib/isodoc/iso/iso.international-standard.xsl +205 -37
  14. data/lib/isodoc/iso/presentation_bibdata.rb +13 -9
  15. data/lib/isodoc/iso/presentation_xml_convert.rb +5 -3
  16. data/lib/isodoc/iso/word_convert.rb +6 -4
  17. data/lib/isodoc/iso/word_dis_cleanup.rb +24 -3
  18. data/lib/isodoc/iso/word_dis_convert.rb +4 -1
  19. data/lib/metanorma/iso/base.rb +2 -1
  20. data/lib/metanorma/iso/biblio.rng +5 -0
  21. data/lib/metanorma/iso/isodoc.rng +46 -12
  22. data/lib/metanorma/iso/version.rb +1 -1
  23. data/metanorma-iso.gemspec +5 -2
  24. metadata +4 -87
  25. data/.github/workflows/automerge.yml +0 -31
  26. data/.github/workflows/rake.yml +0 -15
  27. data/.github/workflows/release.yml +0 -24
  28. data/.github/workflows/ubuntu.yml +0 -41
  29. data/Rakefile +0 -8
  30. data/bin/rspec +0 -17
  31. data/spec/assets/header.html +0 -7
  32. data/spec/assets/html.css +0 -2
  33. data/spec/assets/htmlcover.html +0 -4
  34. data/spec/assets/htmlintro.html +0 -5
  35. data/spec/assets/i18n.yaml +0 -2
  36. data/spec/assets/iso.adoc +0 -10
  37. data/spec/assets/iso.headless.html +0 -33
  38. data/spec/assets/iso.xml +0 -71
  39. data/spec/assets/rice_image1.png +0 -0
  40. data/spec/assets/scripts.html +0 -3
  41. data/spec/assets/std.css +0 -2
  42. data/spec/assets/word.css +0 -2
  43. data/spec/assets/wordcover.html +0 -3
  44. data/spec/assets/wordintro.html +0 -4
  45. data/spec/examples/103_01_02.html +0 -247
  46. data/spec/examples/english.yaml +0 -69
  47. data/spec/examples/iso_123_.xml +0 -45
  48. data/spec/examples/iso_123_all_parts.xml +0 -45
  49. data/spec/examples/iso_123_no_year_note.xml +0 -46
  50. data/spec/examples/iso_124_.xml +0 -41
  51. data/spec/examples/iso_216_.xml +0 -47
  52. data/spec/examples/iso_iec_12382_.xml +0 -48
  53. data/spec/examples/rice.adoc +0 -714
  54. data/spec/examples/rice.preview.html +0 -1870
  55. data/spec/examples/rice.sh +0 -4
  56. data/spec/examples/rice_img/1000-1_ed2amd3fig1a.png +0 -0
  57. data/spec/examples/rice_img/1000-1_ed2amd3fig1b.png +0 -0
  58. data/spec/examples/rice_img/1000-1_ed2amd3fig2.png +0 -0
  59. data/spec/examples/rice_img/1000-1_ed2amd3fig3.png +0 -0
  60. data/spec/examples/rice_img/1000-1_ed2amd3fig4.png +0 -0
  61. data/spec/examples/rice_img/1000-1_ed2amd3fig5_f.png +0 -0
  62. data/spec/examples/rice_img/1000-1_ed2amd3figA.png +0 -0
  63. data/spec/examples/rice_img/1000-1_ed2amd3figA1.png +0 -0
  64. data/spec/examples/rice_img/1000-1_ed2amd3figA2.png +0 -0
  65. data/spec/examples/rice_img/1000-1_ed2amd3figTab1.png +0 -0
  66. data/spec/examples/rice_img/1000-1_ed2amd3figTab2.png +0 -0
  67. data/spec/examples/rice_img/1001_ed2amd3fig1.png +0 -0
  68. data/spec/examples/rice_img/ISO_1213_1.png +0 -0
  69. data/spec/examples/rice_img/SL1000-1_ed2amd3fig1.png +0 -0
  70. data/spec/examples/rice_img/rice_image1.png +0 -0
  71. data/spec/examples/rice_img/rice_image2.png +0 -0
  72. data/spec/examples/rice_img/rice_image3_1.png +0 -0
  73. data/spec/examples/rice_img/rice_image3_2.png +0 -0
  74. data/spec/examples/rice_img/rice_image3_3.png +0 -0
  75. data/spec/isodoc/amd_spec.rb +0 -986
  76. data/spec/isodoc/blocks_spec.rb +0 -1174
  77. data/spec/isodoc/i18n_spec.rb +0 -1579
  78. data/spec/isodoc/inline_spec.rb +0 -1060
  79. data/spec/isodoc/iso_spec.rb +0 -255
  80. data/spec/isodoc/metadata_spec.rb +0 -701
  81. data/spec/isodoc/postproc_spec.rb +0 -1089
  82. data/spec/isodoc/ref_spec.rb +0 -439
  83. data/spec/isodoc/section_spec.rb +0 -998
  84. data/spec/isodoc/table_spec.rb +0 -420
  85. data/spec/isodoc/terms_spec.rb +0 -314
  86. data/spec/isodoc/word_dis_spec.rb +0 -2064
  87. data/spec/isodoc/xref_spec.rb +0 -1747
  88. data/spec/metanorma/amd_spec.rb +0 -724
  89. data/spec/metanorma/base_spec.rb +0 -1384
  90. data/spec/metanorma/blank_spec.rb +0 -38
  91. data/spec/metanorma/blocks_spec.rb +0 -624
  92. data/spec/metanorma/cleanup_spec.rb +0 -1645
  93. data/spec/metanorma/inline_spec.rb +0 -203
  94. data/spec/metanorma/lists_spec.rb +0 -197
  95. data/spec/metanorma/macros_spec.rb +0 -99
  96. data/spec/metanorma/processor_spec.rb +0 -161
  97. data/spec/metanorma/refs_spec.rb +0 -672
  98. data/spec/metanorma/section_spec.rb +0 -492
  99. data/spec/metanorma/table_spec.rb +0 -329
  100. data/spec/metanorma/validate_spec.rb +0 -2153
  101. data/spec/relaton/render_spec.rb +0 -568
  102. data/spec/requirements/requirement_components_spec.rb +0 -610
  103. data/spec/requirements/requirements_spec.rb +0 -1596
  104. data/spec/requirements/xref_spec.rb +0 -1211
  105. data/spec/spec_helper.rb +0 -313
  106. data/spec/vcr_cassettes/docrels.yml +0 -385
  107. data/spec/vcr_cassettes/withdrawn_iso.yml +0 -295
@@ -1,255 +0,0 @@
1
- require "spec_helper"
2
- require "fileutils"
3
-
4
- RSpec.describe IsoDoc::Iso do
5
- it "processes isodoc as ISO: HTML output" do
6
- IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", false)
7
- <iso-standard xmlns="http://riboseinc.com/isoxml">
8
- <preface>
9
- <foreword>
10
- <note>
11
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
12
- </note>
13
- </foreword>
14
- </preface>
15
- </iso-standard>
16
- INPUT
17
- html = File.read("test.html", encoding: "utf-8")
18
- expect(html)
19
- .to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
20
- expect(html)
21
- .to match(%r[blockquote[^{]+\{[^{]+font-family: "Cambria", serif;]m)
22
- expect(html)
23
- .to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Cambria", serif;]m)
24
- end
25
-
26
- it "processes isodoc as ISO: alt HTML output" do
27
- IsoDoc::Iso::HtmlConvert.new(alt: true).convert("test", <<~"INPUT", false)
28
- <iso-standard xmlns="http://riboseinc.com/isoxml">
29
- <preface>
30
- <foreword>
31
- <note>
32
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
33
- </note>
34
- </foreword>
35
- </preface>
36
- </iso-standard>
37
- INPUT
38
- html = File.read("test.html", encoding: "utf-8")
39
- expect(html)
40
- .to match(%r[\bpre[^{]+\{[^{]+font-family: "Space Mono", monospace;]m)
41
- expect(html)
42
- .to match(%r[blockquote[^{]+\{[^{]+font-family: "Lato", sans-serif;]m)
43
- expect(html)
44
- .to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Lato", sans-serif;]m)
45
- end
46
-
47
- it "processes isodoc as ISO: Chinese HTML output" do
48
- IsoDoc::Iso::HtmlConvert.new(script: "Hans")
49
- .convert("test", <<~"INPUT", false)
50
- <iso-standard xmlns="http://riboseinc.com/isoxml">
51
- <preface>
52
- <foreword>
53
- <note>
54
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
55
- </note>
56
- </foreword>
57
- </preface>
58
- </iso-standard>
59
- INPUT
60
- html = File.read("test.html", encoding: "utf-8")
61
- expect(html)
62
- .to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
63
- expect(html)
64
- .to match(%r[blockquote[^{]+\{[^{]+font-family: "Source Han Sans", serif;]m)
65
- expect(html)
66
- .to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Source Han Sans", sans-serif;]m)
67
- end
68
-
69
- it "processes isodoc as ISO: user nominated fonts" do
70
- IsoDoc::Iso::HtmlConvert.new(bodyfont: "Zapf Chancery",
71
- headerfont: "Comic Sans",
72
- monospacefont: "Andale Mono")
73
- .convert("test", <<~"INPUT", false)
74
- <iso-standard xmlns="http://riboseinc.com/isoxml">
75
- <preface>
76
- <foreword>
77
- <note>
78
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
79
- </note>
80
- </foreword>
81
- </preface>
82
- </iso-standard>
83
- INPUT
84
- html = File.read("test.html", encoding: "utf-8")
85
- expect(html)
86
- .to match(%r[\bpre[^{]+\{[^{]+font-family: Andale Mono;]m)
87
- expect(html)
88
- .to match(%r[blockquote[^{]+\{[^{]+font-family: Zapf Chancery;]m)
89
- expect(html)
90
- .to match(%r[\.h2Annex[^{]+\{[^{]+font-family: Comic Sans;]m)
91
- end
92
-
93
- it "processes isodoc as ISO: Word output" do
94
- IsoDoc::Iso::WordConvert.new({}).convert("test", <<~"INPUT", false)
95
- <iso-standard xmlns="http://riboseinc.com/isoxml">
96
- <preface>
97
- <foreword>
98
- <note>
99
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
100
- </note>
101
- </foreword>
102
- </preface>
103
- </iso-standard>
104
- INPUT
105
- html = File.read("test.doc", encoding: "utf-8")
106
- expect(html)
107
- .to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
108
- expect(html)
109
- .to match(%r[Quote[^{]+\{[^{]+font-family: "Cambria", serif;]m)
110
- expect(html)
111
- .to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Cambria", serif;]m)
112
- end
113
-
114
- it "does not include IEV in references" do
115
- output = IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)
116
- <iso-standard xmlns="http://riboseinc.com/isoxml">
117
- <preface>
118
- <foreword>
119
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">
120
- <eref bibitemid="IEV">IEV</eref>
121
- <eref bibitemid="ISO20483">ISO 20483</eref>
122
- </p>
123
- </foreword>
124
- </preface>
125
- <bibliography>
126
- <references id="_normative_references" normative="true" obligation="informative">
127
- <title>1<tab/>
128
- Normative References</title>
129
- <bibitem id="IEV" type="international-standard">
130
- <title format="text/plain" language="en" script="Latn">Electropedia: The World's Online Electrotechnical Vocabulary</title>
131
- <uri type="src">http://www.electropedia.org</uri>
132
- <docidentifier>IEV</docidentifier>
133
- <contributor>
134
- <role type="publisher"/>
135
- <organization>
136
- <name>International Electrotechnical Commission</name>
137
- <abbreviation>IEC</abbreviation>
138
- <uri>www.iec.ch</uri>
139
- </organization>
140
- </contributor>
141
- <language>en</language>
142
- <language>fr</language>
143
- <script>Latn</script>
144
- <copyright>
145
- <owner>
146
- <organization>
147
- <name>International Electrotechnical Commission</name>
148
- <abbreviation>IEC</abbreviation>
149
- <uri>www.iec.ch</uri>
150
- </organization>
151
- </owner>
152
- </copyright>
153
- <relation type="updates">
154
- <bibitem>
155
- <formattedref>IEC 60050</formattedref>
156
- </bibitem>
157
- </relation>
158
- </bibitem>
159
- <bibitem id="ISO20483" type="standard">
160
- <formattedref format="text/plain"><em>Cereals and pulses</em></formattedref>
161
- <docidentifier>ISO 20483</docidentifier>
162
- <date type="published">
163
- <from>2013</from>
164
- <to>2014</to>
165
- </date>
166
- <contributor>
167
- <role type="publisher"/>
168
- <organization>
169
- <name>International Organization for Standardization</name>
170
- </organization>
171
- </contributor>
172
- </bibitem>
173
- </references>
174
- </bibliography>
175
- </iso-standard>
176
- INPUT
177
- expect(xmlpp(output)).to be_equivalent_to xmlpp(<<~"OUTPUT")
178
- #{HTML_HDR}
179
- <br/>
180
- <div>
181
- <h1 class="ForewordTitle">Foreword</h1>
182
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">
183
- <a href="#IEV">IEV</a>
184
- <a href="#ISO20483">ISO 20483</a>
185
- </p>
186
- </div>
187
- <p class="zzSTDTitle1"/>
188
- <div>
189
- <h1>1&#160; Normative References</h1>
190
- <p id="ISO20483" class="NormRef">ISO 20483, <i>Cereals and pulses</i></p>
191
- </div>
192
- </div>
193
- </body>
194
- </html>
195
- OUTPUT
196
- end
197
-
198
- it "inserts identifiers for editorial group and approval group" do
199
- input = <<~INPUT
200
- <iso-standard xmlns="http://riboseinc.com/isoxml">
201
- <bibdata>
202
- <ext>
203
- <doctype>international-standard</doctype>
204
- <horizontal>true</horizontal>
205
- <editorialgroup>
206
- <agency>ISO</agency>
207
- <agency>IEC</agency>
208
- <technical-committee type="A" number="34">Food products</technical-committee>
209
- <subcommittee type="B" number="4">Cereals and pulses</subcommittee>
210
- <workgroup type="C" number="3">Rice Group</workgroup>
211
- <secretariat>GB</secretariat>
212
- </editorialgroup>
213
- <approvalgroup>
214
- <agency>ISO</agency>
215
- <technical-committee type="D" number="34a">Food products A</technical-committee>
216
- <subcommittee type="E" number="4a">Cereals and pulses A</subcommittee>
217
- <workgroup type="F" number="3a">Rice Group A</workgroup>
218
- </approvalgroup>
219
- <stagename>Committee draft</stagename>
220
- </ext>
221
- </bibdata>
222
- </iso-standard>
223
- INPUT
224
- presxml = <<~OUTPUT
225
- <bibdata>
226
- <ext>
227
- <doctype language=''>international-standard</doctype>
228
- <doctype language='en'>International Standard</doctype>
229
- <horizontal>true</horizontal>
230
- <editorialgroup identifier='ISO/IEC/A 34/B 4/C 3'>
231
- <agency>ISO</agency>
232
- <agency>IEC</agency>
233
- <technical-committee type='A' number='34'>Food products</technical-committee>
234
- <subcommittee type='B' number='4'>Cereals and pulses</subcommittee>
235
- <workgroup type='C' number='3'>Rice Group</workgroup>
236
- <secretariat>GB</secretariat>
237
- </editorialgroup>
238
- <approvalgroup identifier='ISO/D 34a/E 4a/F 3a'>
239
- <agency>ISO</agency>
240
- <technical-committee type='D' number='34a'>Food products A</technical-committee>
241
- <subcommittee type='E' number='4a'>Cereals and pulses A</subcommittee>
242
- <workgroup type='F' number='3a'>Rice Group A</workgroup>
243
- </approvalgroup>
244
- <stagename>Committee draft</stagename>
245
- </ext>
246
- </bibdata>
247
- OUTPUT
248
- expect(xmlpp(Nokogiri::XML(
249
- IsoDoc::Iso::PresentationXMLConvert.new({})
250
- .convert("test", input, true),
251
- )
252
- .at("//xmlns:bibdata").to_xml))
253
- .to be_equivalent_to xmlpp(presxml)
254
- end
255
- end