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.
- checksums.yaml +4 -4
- data/lib/isodoc/iso/html/header-dis.html +111 -29
- data/lib/isodoc/iso/html/isodoc-dis.css +65 -64
- data/lib/isodoc/iso/html/isodoc-dis.scss +65 -64
- data/lib/isodoc/iso/html/style-human.css +1 -2
- data/lib/isodoc/iso/html/style-human.scss +0 -1
- data/lib/isodoc/iso/html/style-iso.css +1 -2
- data/lib/isodoc/iso/html/style-iso.scss +0 -1
- data/lib/isodoc/iso/html/wordstyle-dis.css +10 -4
- data/lib/isodoc/iso/html/wordstyle-dis.scss +10 -4
- data/lib/isodoc/iso/i18n-en.yaml +4 -4
- data/lib/isodoc/iso/iso.amendment.xsl +205 -37
- data/lib/isodoc/iso/iso.international-standard.xsl +205 -37
- data/lib/isodoc/iso/presentation_bibdata.rb +13 -9
- data/lib/isodoc/iso/presentation_xml_convert.rb +5 -3
- data/lib/isodoc/iso/word_convert.rb +6 -4
- data/lib/isodoc/iso/word_dis_cleanup.rb +24 -3
- data/lib/isodoc/iso/word_dis_convert.rb +4 -1
- data/lib/metanorma/iso/base.rb +2 -1
- data/lib/metanorma/iso/biblio.rng +5 -0
- data/lib/metanorma/iso/isodoc.rng +46 -12
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +5 -2
- metadata +4 -87
- data/.github/workflows/automerge.yml +0 -31
- data/.github/workflows/rake.yml +0 -15
- data/.github/workflows/release.yml +0 -24
- data/.github/workflows/ubuntu.yml +0 -41
- data/Rakefile +0 -8
- data/bin/rspec +0 -17
- data/spec/assets/header.html +0 -7
- data/spec/assets/html.css +0 -2
- data/spec/assets/htmlcover.html +0 -4
- data/spec/assets/htmlintro.html +0 -5
- data/spec/assets/i18n.yaml +0 -2
- data/spec/assets/iso.adoc +0 -10
- data/spec/assets/iso.headless.html +0 -33
- data/spec/assets/iso.xml +0 -71
- data/spec/assets/rice_image1.png +0 -0
- data/spec/assets/scripts.html +0 -3
- data/spec/assets/std.css +0 -2
- data/spec/assets/word.css +0 -2
- data/spec/assets/wordcover.html +0 -3
- data/spec/assets/wordintro.html +0 -4
- data/spec/examples/103_01_02.html +0 -247
- data/spec/examples/english.yaml +0 -69
- data/spec/examples/iso_123_.xml +0 -45
- data/spec/examples/iso_123_all_parts.xml +0 -45
- data/spec/examples/iso_123_no_year_note.xml +0 -46
- data/spec/examples/iso_124_.xml +0 -41
- data/spec/examples/iso_216_.xml +0 -47
- data/spec/examples/iso_iec_12382_.xml +0 -48
- data/spec/examples/rice.adoc +0 -714
- data/spec/examples/rice.preview.html +0 -1870
- data/spec/examples/rice.sh +0 -4
- data/spec/examples/rice_img/1000-1_ed2amd3fig1a.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig1b.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig2.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig3.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig4.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig5_f.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figA.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figA1.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figA2.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figTab1.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figTab2.png +0 -0
- data/spec/examples/rice_img/1001_ed2amd3fig1.png +0 -0
- data/spec/examples/rice_img/ISO_1213_1.png +0 -0
- data/spec/examples/rice_img/SL1000-1_ed2amd3fig1.png +0 -0
- data/spec/examples/rice_img/rice_image1.png +0 -0
- data/spec/examples/rice_img/rice_image2.png +0 -0
- data/spec/examples/rice_img/rice_image3_1.png +0 -0
- data/spec/examples/rice_img/rice_image3_2.png +0 -0
- data/spec/examples/rice_img/rice_image3_3.png +0 -0
- data/spec/isodoc/amd_spec.rb +0 -986
- data/spec/isodoc/blocks_spec.rb +0 -1174
- data/spec/isodoc/i18n_spec.rb +0 -1579
- data/spec/isodoc/inline_spec.rb +0 -1060
- data/spec/isodoc/iso_spec.rb +0 -255
- data/spec/isodoc/metadata_spec.rb +0 -701
- data/spec/isodoc/postproc_spec.rb +0 -1089
- data/spec/isodoc/ref_spec.rb +0 -439
- data/spec/isodoc/section_spec.rb +0 -998
- data/spec/isodoc/table_spec.rb +0 -420
- data/spec/isodoc/terms_spec.rb +0 -314
- data/spec/isodoc/word_dis_spec.rb +0 -2064
- data/spec/isodoc/xref_spec.rb +0 -1747
- data/spec/metanorma/amd_spec.rb +0 -724
- data/spec/metanorma/base_spec.rb +0 -1384
- data/spec/metanorma/blank_spec.rb +0 -38
- data/spec/metanorma/blocks_spec.rb +0 -624
- data/spec/metanorma/cleanup_spec.rb +0 -1645
- data/spec/metanorma/inline_spec.rb +0 -203
- data/spec/metanorma/lists_spec.rb +0 -197
- data/spec/metanorma/macros_spec.rb +0 -99
- data/spec/metanorma/processor_spec.rb +0 -161
- data/spec/metanorma/refs_spec.rb +0 -672
- data/spec/metanorma/section_spec.rb +0 -492
- data/spec/metanorma/table_spec.rb +0 -329
- data/spec/metanorma/validate_spec.rb +0 -2153
- data/spec/relaton/render_spec.rb +0 -568
- data/spec/requirements/requirement_components_spec.rb +0 -610
- data/spec/requirements/requirements_spec.rb +0 -1596
- data/spec/requirements/xref_spec.rb +0 -1211
- data/spec/spec_helper.rb +0 -313
- data/spec/vcr_cassettes/docrels.yml +0 -385
- data/spec/vcr_cassettes/withdrawn_iso.yml +0 -295
data/spec/isodoc/iso_spec.rb
DELETED
@@ -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  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
|