metanorma-iec 2.0.8 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/iec/html/html_iec_titlepage.html +1 -0
- data/lib/isodoc/iec/iec.international-standard.xsl +475 -180
- data/lib/isodoc/iec/init.rb +6 -5
- data/lib/isodoc/iec/presentation_xml_convert.rb +3 -3
- data/lib/isodoc/iec/xref.rb +4 -0
- data/lib/metanorma/iec/biblio.rng +37 -8
- data/lib/metanorma/iec/iec.rng +1 -0
- data/lib/metanorma/iec/isodoc.rng +56 -0
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +1 -1
- data/spec/isodoc/blocks_spec.rb +146 -202
- data/spec/isodoc/i18n_spec.rb +22 -7
- data/spec/isodoc/iev_spec.rb +7 -7
- data/spec/isodoc/inline_spec.rb +255 -249
- data/spec/isodoc/ref_spec.rb +14 -62
- data/spec/metanorma/base_spec.rb +2 -2
- data/spec/metanorma/inline_spec.rb +6 -6
- metadata +4 -4
data/spec/isodoc/i18n_spec.rb
CHANGED
@@ -84,7 +84,7 @@ RSpec.describe IsoDoc do
|
|
84
84
|
<language current="true">en</language>
|
85
85
|
<ext>
|
86
86
|
<doctype language="">international-standard</doctype><doctype language="fr">Norme internationale</doctype><doctype language="en">International Standard</doctype>
|
87
|
-
<horizontal language=
|
87
|
+
<horizontal language=''>true</horizontal><horizontal language="fr">Norme horizontale</horizontal><horizontal language="en">Horizontal Standard</horizontal>
|
88
88
|
<function language="">emc</function><function language="fr">Publication fondamentale en CEM</function><function language="en">Basic EMC Publication</function>
|
89
89
|
</ext>
|
90
90
|
</bibdata>
|
@@ -224,12 +224,17 @@ RSpec.describe IsoDoc do
|
|
224
224
|
</body>
|
225
225
|
</html>
|
226
226
|
OUTPUT
|
227
|
-
expect((IsoDoc::Iec::PresentationXMLConvert.new({})
|
228
|
-
|
227
|
+
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
228
|
+
.convert("test", input, true)
|
229
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, "")))
|
230
|
+
.to be_equivalent_to xmlpp(presxml)
|
231
|
+
expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({})
|
232
|
+
.convert("test", presxml, true)))
|
233
|
+
.to be_equivalent_to xmlpp(html)
|
229
234
|
end
|
230
235
|
|
231
236
|
it "defaults to English" do
|
232
|
-
|
237
|
+
input = <<~INPUT
|
233
238
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
234
239
|
<bibdata>
|
235
240
|
<language>tlh</language>
|
@@ -297,6 +302,7 @@ RSpec.describe IsoDoc do
|
|
297
302
|
</bibliography>
|
298
303
|
</iso-standard>
|
299
304
|
INPUT
|
305
|
+
output = <<~OUTPUT
|
300
306
|
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
301
307
|
<bibdata>
|
302
308
|
<language current="true">tlh</language>
|
@@ -362,6 +368,10 @@ RSpec.describe IsoDoc do
|
|
362
368
|
</bibliography>
|
363
369
|
</iso-standard>
|
364
370
|
OUTPUT
|
371
|
+
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
372
|
+
.convert("test", input, true)
|
373
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, "")))
|
374
|
+
.to be_equivalent_to xmlpp(output)
|
365
375
|
end
|
366
376
|
|
367
377
|
it "processes French" do
|
@@ -445,7 +455,7 @@ RSpec.describe IsoDoc do
|
|
445
455
|
<language current="true">fr</language>
|
446
456
|
<ext>
|
447
457
|
<doctype language="">international-standard</doctype><doctype language="fr">Norme internationale</doctype><doctype language="en">International Standard</doctype>
|
448
|
-
<horizontal
|
458
|
+
<horizontal>false</horizontal>
|
449
459
|
<function language="">emc</function><function language="fr">Publication fondamentale en CEM</function><function language="en">Basic EMC Publication</function>
|
450
460
|
</ext>
|
451
461
|
</bibdata>
|
@@ -586,7 +596,12 @@ RSpec.describe IsoDoc do
|
|
586
596
|
</body>
|
587
597
|
</html>
|
588
598
|
OUTPUT
|
589
|
-
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
590
|
-
|
599
|
+
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
600
|
+
.convert("test", input, true)
|
601
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, "")))
|
602
|
+
.to be_equivalent_to xmlpp(presxml)
|
603
|
+
expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({})
|
604
|
+
.convert("test", presxml, true)))
|
605
|
+
.to be_equivalent_to xmlpp(html)
|
591
606
|
end
|
592
607
|
end
|
data/spec/isodoc/iev_spec.rb
CHANGED
@@ -171,7 +171,7 @@ RSpec.describe IsoDoc do
|
|
171
171
|
<stage language="">60</stage>
|
172
172
|
<stage language='fr'>Norme internationale</stage>
|
173
173
|
<stage language='en'>International standard</stage>
|
174
|
-
<substage
|
174
|
+
<substage>60</substage>
|
175
175
|
</status>
|
176
176
|
<copyright>
|
177
177
|
<from>2020</from>
|
@@ -183,7 +183,7 @@ RSpec.describe IsoDoc do
|
|
183
183
|
</owner>
|
184
184
|
</copyright>
|
185
185
|
<ext>
|
186
|
-
<doctype
|
186
|
+
<doctype>article</doctype>
|
187
187
|
<editorialgroup>
|
188
188
|
<technical-committee/>
|
189
189
|
<subcommittee/>
|
@@ -598,7 +598,7 @@ RSpec.describe IsoDoc do
|
|
598
598
|
<doctype language=''>international-standard</doctype>
|
599
599
|
<doctype language='fr'>Norme internationale</doctype>
|
600
600
|
<doctype language='en'>International Standard</doctype>
|
601
|
-
<horizontal
|
601
|
+
<horizontal>false</horizontal>
|
602
602
|
<structuredidentifier>
|
603
603
|
<project-number part='192'>IEC 60050</project-number>
|
604
604
|
</structuredidentifier>
|
@@ -621,7 +621,7 @@ RSpec.describe IsoDoc do
|
|
621
621
|
<termnote id='_5f49cfad-e57e-5029-78cf-5b7e3e10a3b3'>
|
622
622
|
<name>Note 1 to entry</name>
|
623
623
|
<p id='_8c830e60-8f09-73a2-6393-2a27d9c5b1ce'>Dependability includes availability (<em>192-01-02</em>
|
624
|
-
(<xref target='term-sub-item'>192-01-02</xref>),
|
624
|
+
(<xref target='term-sub-item'><span class='citesec'>192-01-02</span></xref>),
|
625
625
|
<em>191-01-02</em>
|
626
626
|
[term defined in
|
627
627
|
<termref base='IEV' target='191-01-02'/>])</p>
|
@@ -740,7 +740,7 @@ RSpec.describe IsoDoc do
|
|
740
740
|
CONTRAST:
|
741
741
|
<strong>Fifth Designation</strong>
|
742
742
|
(
|
743
|
-
<xref target='paddy1'>192-01-02</xref>
|
743
|
+
<xref target='paddy1'><span class='citesec'>192-01-02</span></xref>
|
744
744
|
)
|
745
745
|
</p>
|
746
746
|
<termexample id='_671a1994-4783-40d0-bc81-987d06ffb740'>
|
@@ -786,14 +786,14 @@ RSpec.describe IsoDoc do
|
|
786
786
|
CONTRASTEZ:
|
787
787
|
<strong>Designation cinquième</strong>
|
788
788
|
(
|
789
|
-
<xref target='paddy1'>192-01-02</xref>
|
789
|
+
<xref target='paddy1'><span class='citesec'>192-01-02</span></xref>
|
790
790
|
)
|
791
791
|
</p>
|
792
792
|
<p>
|
793
793
|
VOIR:
|
794
794
|
<strong>Designation sixième</strong>
|
795
795
|
(
|
796
|
-
<xref target='paddy1'>192-01-02</xref>
|
796
|
+
<xref target='paddy1'><span class='citesec'>192-01-02</span></xref>
|
797
797
|
)
|
798
798
|
</p>
|
799
799
|
<termexample id='_671a1994-4783-40d0-bc81-987d06ffb741'>
|