metanorma-iec 2.1.11 → 2.1.12
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/iec.international-standard.xsl +274 -100
- data/lib/isodoc/iec/presentation_xml_convert.rb +8 -6
- data/lib/metanorma/iec/biblio.rng +5 -0
- data/lib/metanorma/iec/iec_intro_en.xml +11 -12
- data/lib/metanorma/iec/iec_intro_fr.xml +11 -11
- data/lib/metanorma/iec/isodoc.rng +46 -12
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +5 -2
- metadata +4 -36
- data/.github/workflows/automerge.yml +0 -31
- data/.github/workflows/rake.yml +0 -15
- data/.github/workflows/release.yml +0 -24
- data/Rakefile +0 -8
- data/bin/rspec +0 -18
- data/spec/assets/header.html +0 -7
- data/spec/assets/html.css +0 -2
- data/spec/assets/iso.xml +0 -71
- data/spec/assets/rice_image1.png +0 -0
- data/spec/assets/word.css +0 -2
- data/spec/assets/wordintro.html +0 -4
- data/spec/assets/xref_error.adoc +0 -7
- data/spec/isodoc/blocks_spec.rb +0 -200
- data/spec/isodoc/i18n_spec.rb +0 -607
- data/spec/isodoc/iev_spec.rb +0 -888
- data/spec/isodoc/inline_spec.rb +0 -256
- data/spec/isodoc/iso_spec.rb +0 -211
- data/spec/isodoc/metadata_spec.rb +0 -251
- data/spec/isodoc/postproc_spec.rb +0 -303
- data/spec/isodoc/ref_spec.rb +0 -335
- data/spec/isodoc/section_spec.rb +0 -566
- data/spec/isodoc/terms_spec.rb +0 -192
- data/spec/metanorma/base_spec.rb +0 -1041
- data/spec/metanorma/blocks_spec.rb +0 -470
- data/spec/metanorma/cleanup_spec.rb +0 -372
- data/spec/metanorma/iev_spec.rb +0 -254
- data/spec/metanorma/inline_spec.rb +0 -145
- data/spec/metanorma/lists_spec.rb +0 -194
- data/spec/metanorma/processor_spec.rb +0 -171
- data/spec/metanorma/section_spec.rb +0 -348
- data/spec/metanorma/validate_spec.rb +0 -56
- data/spec/spec_helper.rb +0 -305
data/spec/isodoc/terms_spec.rb
DELETED
@@ -1,192 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe IsoDoc do
|
4
|
-
it "processes IsoXML terms" do
|
5
|
-
input = <<~INPUT
|
6
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
7
|
-
<sections>
|
8
|
-
<terms id="_terms_and_definitions" obligation="normative"><title>Terms and definitions</title>
|
9
|
-
|
10
|
-
<term id="paddy1"><preferred>paddy</preferred>
|
11
|
-
<domain>rice</domain>
|
12
|
-
<definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbal-definition></definition>
|
13
|
-
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
|
14
|
-
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
15
|
-
<ul>
|
16
|
-
<li>A</li>
|
17
|
-
</ul>
|
18
|
-
</termexample>
|
19
|
-
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894">
|
20
|
-
<ul>
|
21
|
-
<li>A</li>
|
22
|
-
</ul>
|
23
|
-
</termexample>
|
24
|
-
|
25
|
-
<termsource status="modified">
|
26
|
-
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
|
27
|
-
<modification>
|
28
|
-
<p id="_e73a417d-ad39-417d-a4c8-20e4e2529489">The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</p>
|
29
|
-
</modification>
|
30
|
-
</termsource></term>
|
31
|
-
|
32
|
-
<term id="paddy">
|
33
|
-
<preferred>paddy</preferred><admitted>paddy rice</admitted>
|
34
|
-
<admitted>rough rice</admitted>
|
35
|
-
<deprecates>cargo rice</deprecates>
|
36
|
-
<definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbal-definition></definition>
|
37
|
-
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e">
|
38
|
-
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
|
39
|
-
</termnote>
|
40
|
-
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74f">
|
41
|
-
<ul><li>A</li></ul>
|
42
|
-
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
|
43
|
-
</termnote>
|
44
|
-
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
|
45
|
-
<ul>
|
46
|
-
<li>A</li>
|
47
|
-
</ul>
|
48
|
-
</termexample>
|
49
|
-
<termsource status="identical">
|
50
|
-
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
|
51
|
-
</termsource></term>
|
52
|
-
</terms>
|
53
|
-
</sections>
|
54
|
-
</iso-standard>
|
55
|
-
INPUT
|
56
|
-
presxml = <<~INPUT
|
57
|
-
<?xml version='1.0'?>
|
58
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
59
|
-
<sections>
|
60
|
-
<terms id="_terms_and_definitions" obligation="normative" displayorder="1"><title depth="1">1<tab/>Terms and definitions</title>
|
61
|
-
|
62
|
-
<term id="paddy1">
|
63
|
-
<name>1.1</name><preferred>paddy</preferred>
|
64
|
-
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p></definition>
|
65
|
-
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
|
66
|
-
<name>EXAMPLE 1</name>
|
67
|
-
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
68
|
-
<ul>
|
69
|
-
<li>A</li>
|
70
|
-
</ul>
|
71
|
-
</termexample>
|
72
|
-
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894">
|
73
|
-
<name>EXAMPLE 2</name>
|
74
|
-
<ul>
|
75
|
-
<li>A</li>
|
76
|
-
</ul>
|
77
|
-
</termexample>
|
78
|
-
|
79
|
-
<termsource status="modified">[SOURCE:
|
80
|
-
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>, modified – The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]
|
81
|
-
</termsource></term>
|
82
|
-
|
83
|
-
<term id="paddy">
|
84
|
-
<name>1.2</name>
|
85
|
-
<preferred>paddy</preferred><admitted>paddy rice</admitted>
|
86
|
-
<admitted>rough rice</admitted>
|
87
|
-
<deprecates>cargo rice</deprecates>
|
88
|
-
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
89
|
-
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e">
|
90
|
-
<name>Note 1 to entry</name>
|
91
|
-
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
|
92
|
-
</termnote>
|
93
|
-
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74f">
|
94
|
-
<name>Note 2 to entry</name>
|
95
|
-
<ul><li>A</li></ul>
|
96
|
-
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
|
97
|
-
</termnote>
|
98
|
-
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
|
99
|
-
<name>EXAMPLE</name>
|
100
|
-
<ul>
|
101
|
-
<li>A</li>
|
102
|
-
</ul>
|
103
|
-
</termexample>
|
104
|
-
<termsource status="identical">[SOURCE:
|
105
|
-
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>]
|
106
|
-
</termsource></term>
|
107
|
-
</terms>
|
108
|
-
</sections>
|
109
|
-
</iso-standard>
|
110
|
-
INPUT
|
111
|
-
html = <<~OUTPUT
|
112
|
-
#{HTML_HDR}
|
113
|
-
<div id="">
|
114
|
-
<h1 class="ForewordTitle">FOREWORD</h1>
|
115
|
-
<div class="boilerplate_legal"/>
|
116
|
-
</div>
|
117
|
-
#{IEC_TITLE1}
|
118
|
-
<div id="_terms_and_definitions"><h1>1  Terms and definitions</h1>
|
119
|
-
<p class="TermNum" id="paddy1">1.1</p><p class="Terms" style="text-align:left;">paddy</p>
|
120
|
-
|
121
|
-
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p>
|
122
|
-
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example"><p><span class="example_label">EXAMPLE 1</span>  Foreign seeds, husks, bran, sand, dust.</p><ul>
|
123
|
-
<li>A</li>
|
124
|
-
</ul></div>
|
125
|
-
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p><span class="example_label">EXAMPLE 2</span>  </p>
|
126
|
-
<ul>
|
127
|
-
<li>A</li>
|
128
|
-
</ul>
|
129
|
-
</div>
|
130
|
-
|
131
|
-
<p>[SOURCE:
|
132
|
-
ISO 7301:2011, 3.1, modified – The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]
|
133
|
-
</p><p class="TermNum" id="paddy">1.2</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
|
134
|
-
<p class="AltTerms" style="text-align:left;">rough rice</p>
|
135
|
-
<p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
|
136
|
-
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
|
137
|
-
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p><span class="example_label">EXAMPLE</span>  </p>
|
138
|
-
<ul>
|
139
|
-
<li>A</li>
|
140
|
-
</ul>
|
141
|
-
</div>
|
142
|
-
<div id="_671a1994-4783-40d0-bc81-987d06ffb74e" class="Note"><p>Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
|
143
|
-
<div id='_671a1994-4783-40d0-bc81-987d06ffb74f' class="Note"><p>Note 2 to entry: <ul><li>A</li></ul><p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></p></div>
|
144
|
-
<p>[SOURCE: ISO 7301:2011, 3.1]</p></div>
|
145
|
-
</div>
|
146
|
-
</body>
|
147
|
-
</html>
|
148
|
-
OUTPUT
|
149
|
-
|
150
|
-
word = <<~OUTPUT
|
151
|
-
<div id="_terms_and_definitions"><h1>1<span style="mso-tab-count:1">  </span>Terms and definitions</h1><p class="TermNum" id="paddy1">1.1</p><p class="Terms" style="text-align:left;">paddy</p>
|
152
|
-
|
153
|
-
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p>
|
154
|
-
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example"><p><span class="example_label">EXAMPLE 1</span><span style="mso-tab-count:1">  </span>Foreign seeds, husks, bran, sand, dust.</p><ul>
|
155
|
-
<li>A</li>
|
156
|
-
</ul></div>
|
157
|
-
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p><span class="example_label">EXAMPLE 2</span><span style="mso-tab-count:1">  </span></p>
|
158
|
-
|
159
|
-
<ul>
|
160
|
-
<li>A</li>
|
161
|
-
</ul>
|
162
|
-
</div>
|
163
|
-
|
164
|
-
<p>[SOURCE: ISO 7301:2011, 3.1, modified –
|
165
|
-
The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p><p class="TermNum" id="paddy">1.2</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
|
166
|
-
<p class="AltTerms" style="text-align:left;">rough rice</p>
|
167
|
-
<p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
|
168
|
-
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p><div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p><span class="example_label">EXAMPLE</span><span style="mso-tab-count:1">  </span></p>
|
169
|
-
|
170
|
-
<ul>
|
171
|
-
<li>A</li>
|
172
|
-
</ul>
|
173
|
-
</div><div id="_671a1994-4783-40d0-bc81-987d06ffb74e" class="Note"><p class="Note">Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div><div id="_671a1994-4783-40d0-bc81-987d06ffb74f" class="Note"><p class="Note">Note 2 to entry: <ul><li>A</li></ul><p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></p></div>
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
<p>[SOURCE: ISO 7301:2011, 3.1]</p></div>
|
178
|
-
OUTPUT
|
179
|
-
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
180
|
-
.convert("test", input, true)))
|
181
|
-
.to be_equivalent_to xmlpp(presxml)
|
182
|
-
expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({})
|
183
|
-
.convert("test", presxml, true)))
|
184
|
-
.to be_equivalent_to xmlpp(html)
|
185
|
-
expect(xmlpp(IsoDoc::Iec::WordConvert.new({})
|
186
|
-
.convert("test", presxml, true)
|
187
|
-
.sub(%r{^.*<div id="_terms_and_definitions">}m,
|
188
|
-
'<div id="_terms_and_definitions">')
|
189
|
-
.sub(%r{</div>\s*<br[^>]*>\s*<div class="colophon"/>.*$}m, "")))
|
190
|
-
.to be_equivalent_to xmlpp(word)
|
191
|
-
end
|
192
|
-
end
|