metanorma-iec 2.0.3 → 2.0.6
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/wordstyle.css +20 -0
- data/lib/isodoc/iec/html/wordstyle.scss +19 -0
- data/lib/isodoc/iec/iec.international-standard.xsl +626 -186
- data/lib/isodoc/iec/xref.rb +10 -9
- data/lib/metanorma/iec/isodoc.rng +73 -3
- data/lib/metanorma/iec/version.rb +1 -1
- data/spec/isodoc/iev_spec.rb +5 -10
- data/spec/isodoc/postproc_spec.rb +1 -1
- data/spec/isodoc/terms_spec.rb +4 -7
- metadata +3 -3
data/lib/isodoc/iec/xref.rb
CHANGED
@@ -13,22 +13,22 @@ module IsoDoc
|
|
13
13
|
return super unless @is_iev
|
14
14
|
end
|
15
15
|
|
16
|
-
def initial_anchor_names(
|
16
|
+
def initial_anchor_names(docxml)
|
17
17
|
super
|
18
18
|
return unless @is_iev
|
19
19
|
|
20
|
-
terms_iev_names(
|
21
|
-
middle_section_asset_names(
|
22
|
-
termnote_anchor_names(
|
23
|
-
termexample_anchor_names(
|
20
|
+
terms_iev_names(docxml)
|
21
|
+
middle_section_asset_names(docxml)
|
22
|
+
termnote_anchor_names(docxml)
|
23
|
+
termexample_anchor_names(docxml)
|
24
24
|
end
|
25
25
|
|
26
|
-
def terms_iev_names(
|
27
|
-
|
26
|
+
def terms_iev_names(docxml)
|
27
|
+
docxml.xpath(ns("//sections/clause/terms")).each_with_index do |t, i|
|
28
28
|
num = "#{@iev_part}-%02d" % [i + 1]
|
29
29
|
@anchors[t["id"]] =
|
30
30
|
{ label: num, xref: l10n("#{@labels['section_iev']} #{num}"),
|
31
|
-
level: 2, type: "clause" }
|
31
|
+
level: 2, type: "clause", elem: @labels["section_iev"] }
|
32
32
|
t.xpath(ns("./term")).each_with_index do |c, j|
|
33
33
|
num2 = "%02d" % [j + 1]
|
34
34
|
section_names1(c, "#{num}-#{num2}", 3)
|
@@ -38,7 +38,8 @@ module IsoDoc
|
|
38
38
|
|
39
39
|
def annex_name_lbl(clause, num)
|
40
40
|
obl = l10n("(#{@labels['inform_annex']})")
|
41
|
-
|
41
|
+
clause["obligation"] == "normative" and
|
42
|
+
obl = l10n("(#{@labels['norm_annex']})")
|
42
43
|
l10n("<strong>#{@labels['annex']} #{num}</strong><br/>#{obl}")
|
43
44
|
end
|
44
45
|
end
|
@@ -152,9 +152,7 @@
|
|
152
152
|
<data type="boolean"/>
|
153
153
|
</attribute>
|
154
154
|
</optional>
|
155
|
-
<
|
156
|
-
<ref name="PureTextElement"/>
|
157
|
-
</oneOrMore>
|
155
|
+
<ref name="XrefBody"/>
|
158
156
|
</element>
|
159
157
|
</define>
|
160
158
|
<define name="erefType">
|
@@ -188,6 +186,42 @@
|
|
188
186
|
<ref name="PureTextElement"/>
|
189
187
|
</oneOrMore>
|
190
188
|
</define>
|
189
|
+
<define name="localityStack">
|
190
|
+
<element name="localityStack">
|
191
|
+
<optional>
|
192
|
+
<attribute name="connective">
|
193
|
+
<choice>
|
194
|
+
<value>and</value>
|
195
|
+
<value>or</value>
|
196
|
+
<value>from</value>
|
197
|
+
<value>to</value>
|
198
|
+
<value/>
|
199
|
+
</choice>
|
200
|
+
</attribute>
|
201
|
+
</optional>
|
202
|
+
<zeroOrMore>
|
203
|
+
<ref name="locality"/>
|
204
|
+
</zeroOrMore>
|
205
|
+
</element>
|
206
|
+
</define>
|
207
|
+
<define name="sourceLocalityStack">
|
208
|
+
<element name="sourceLocalityStack">
|
209
|
+
<optional>
|
210
|
+
<attribute name="connective">
|
211
|
+
<choice>
|
212
|
+
<value>and</value>
|
213
|
+
<value>or</value>
|
214
|
+
<value>from</value>
|
215
|
+
<value>to</value>
|
216
|
+
<value/>
|
217
|
+
</choice>
|
218
|
+
</attribute>
|
219
|
+
</optional>
|
220
|
+
<zeroOrMore>
|
221
|
+
<ref name="sourceLocality"/>
|
222
|
+
</zeroOrMore>
|
223
|
+
</element>
|
224
|
+
</define>
|
191
225
|
<define name="ul">
|
192
226
|
<element name="ul">
|
193
227
|
<attribute name="id">
|
@@ -1098,6 +1132,16 @@
|
|
1098
1132
|
</define>
|
1099
1133
|
</include>
|
1100
1134
|
<!-- end overrides -->
|
1135
|
+
<define name="image" combine="choice">
|
1136
|
+
<element name="svg">
|
1137
|
+
<oneOrMore>
|
1138
|
+
<choice>
|
1139
|
+
<text/>
|
1140
|
+
<ref name="AnyElement"/>
|
1141
|
+
</choice>
|
1142
|
+
</oneOrMore>
|
1143
|
+
</element>
|
1144
|
+
</define>
|
1101
1145
|
<define name="MultilingualRenderingType">
|
1102
1146
|
<choice>
|
1103
1147
|
<value>common</value>
|
@@ -2631,4 +2675,30 @@
|
|
2631
2675
|
</zeroOrMore>
|
2632
2676
|
</element>
|
2633
2677
|
</define>
|
2678
|
+
<define name="XrefBody">
|
2679
|
+
<zeroOrMore>
|
2680
|
+
<ref name="XrefTarget"/>
|
2681
|
+
</zeroOrMore>
|
2682
|
+
<oneOrMore>
|
2683
|
+
<ref name="PureTextElement"/>
|
2684
|
+
</oneOrMore>
|
2685
|
+
</define>
|
2686
|
+
<define name="XrefTarget">
|
2687
|
+
<element name="location">
|
2688
|
+
<attribute name="target">
|
2689
|
+
<data type="string">
|
2690
|
+
<param name="pattern">\i\c*|\c+#\c+</param>
|
2691
|
+
</data>
|
2692
|
+
</attribute>
|
2693
|
+
<attribute name="connective">
|
2694
|
+
<choice>
|
2695
|
+
<value>and</value>
|
2696
|
+
<value>or</value>
|
2697
|
+
<value>from</value>
|
2698
|
+
<value>to</value>
|
2699
|
+
<value/>
|
2700
|
+
</choice>
|
2701
|
+
</attribute>
|
2702
|
+
</element>
|
2703
|
+
</define>
|
2634
2704
|
</grammar>
|
data/spec/isodoc/iev_spec.rb
CHANGED
@@ -169,6 +169,8 @@ RSpec.describe IsoDoc do
|
|
169
169
|
<script current="true">Latn</script>
|
170
170
|
<status>
|
171
171
|
<stage language="">60</stage>
|
172
|
+
<stage language='fr'>Norme internationale</stage>
|
173
|
+
<stage language='en'>International standard</stage>
|
172
174
|
<substage language="">60</substage>
|
173
175
|
</status>
|
174
176
|
<copyright>
|
@@ -397,9 +399,7 @@ RSpec.describe IsoDoc do
|
|
397
399
|
</ul>
|
398
400
|
</div>
|
399
401
|
<p>
|
400
|
-
SOURCE:
|
401
|
-
<a href='#ISO7301'>ISO 7301:2011, 3.1</a>
|
402
|
-
, modified – The term "cargo rice" is shown as deprecated, and
|
402
|
+
SOURCE: ISO 7301:2011, 3.1, modified – The term "cargo rice" is shown as deprecated, and
|
403
403
|
Note 1 to entry is not included here
|
404
404
|
</p>
|
405
405
|
<p class='TermNum' id='paddy'>192-01-02</p>
|
@@ -438,10 +438,7 @@ RSpec.describe IsoDoc do
|
|
438
438
|
</p>
|
439
439
|
</p>
|
440
440
|
</div>
|
441
|
-
<p>
|
442
|
-
SOURCE:
|
443
|
-
<a href='#ISO7301'>ISO 7301:2011, 3.1</a>
|
444
|
-
</p>
|
441
|
+
<p>SOURCE: ISO 7301:2011, 3.1 </p>
|
445
442
|
</div>
|
446
443
|
</div>
|
447
444
|
</div>
|
@@ -551,9 +548,7 @@ RSpec.describe IsoDoc do
|
|
551
548
|
rice retaining its husk after threshing
|
552
549
|
</p>
|
553
550
|
<p class='MsoNormal'>
|
554
|
-
SOURCE:
|
555
|
-
<a href='#ISO7301'>ISO 7301:2011, 3.1</a>
|
556
|
-
, modified – The term "cargo rice" is shown as deprecated, and
|
551
|
+
SOURCE: ISO 7301:2011, 3.1, modified – The term "cargo rice" is shown as deprecated, and
|
557
552
|
Note 1 to entry is not included here
|
558
553
|
</p>
|
559
554
|
</div>
|
@@ -147,7 +147,7 @@ RSpec.describe IsoDoc do
|
|
147
147
|
<div><a name="_terms_and_definitions" id="_terms_and_definitions"></a><h1 class="main">1<span style="mso-tab-count:1">  </span>Terms and Definitions</h1>
|
148
148
|
<p class="TermNum"><a name="paddy1" id="paddy1"></a>1.1</p><p class="Terms" style="text-align:left;">paddy</p>
|
149
149
|
<p class="MsoNormal"><a name="_eb29b35e-123e-4d1c-b50b-2714d41e747f" id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"></a>rice retaining its husk after threshing</p>
|
150
|
-
<p class="MsoNormal">[SOURCE:
|
150
|
+
<p class="MsoNormal">[SOURCE: ISO 7301:2011, 3.1, modified — The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p></div>
|
151
151
|
</div>
|
152
152
|
OUTPUT
|
153
153
|
end
|
data/spec/isodoc/terms_spec.rb
CHANGED
@@ -129,7 +129,7 @@ RSpec.describe IsoDoc do
|
|
129
129
|
</div>
|
130
130
|
|
131
131
|
<p>[SOURCE:
|
132
|
-
|
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
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
134
|
<p class="AltTerms" style="text-align:left;">rough rice</p>
|
135
135
|
<p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
|
@@ -141,8 +141,7 @@ RSpec.describe IsoDoc do
|
|
141
141
|
</div>
|
142
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
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:
|
145
|
-
<a href="#ISO7301">ISO 7301:2011, 3.1</a>]</p></div>
|
144
|
+
<p>[SOURCE: ISO 7301:2011, 3.1]</p></div>
|
146
145
|
</div>
|
147
146
|
</body>
|
148
147
|
</html>
|
@@ -162,8 +161,7 @@ RSpec.describe IsoDoc do
|
|
162
161
|
</ul>
|
163
162
|
</div>
|
164
163
|
|
165
|
-
<p>[SOURCE:
|
166
|
-
<a href="#ISO7301">ISO 7301:2011, 3.1</a>, modified –
|
164
|
+
<p>[SOURCE: ISO 7301:2011, 3.1, modified –
|
167
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>
|
168
166
|
<p class="AltTerms" style="text-align:left;">rough rice</p>
|
169
167
|
<p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
|
@@ -176,8 +174,7 @@ RSpec.describe IsoDoc do
|
|
176
174
|
|
177
175
|
|
178
176
|
|
179
|
-
<p>[SOURCE:
|
180
|
-
<a href="#ISO7301">ISO 7301:2011, 3.1</a>]</p></div>
|
177
|
+
<p>[SOURCE: ISO 7301:2011, 3.1]</p></div>
|
181
178
|
OUTPUT
|
182
179
|
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
183
180
|
.convert("test", input, true)))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-iec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-iso
|
@@ -298,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
298
298
|
- !ruby/object:Gem::Version
|
299
299
|
version: '0'
|
300
300
|
requirements: []
|
301
|
-
rubygems_version: 3.
|
301
|
+
rubygems_version: 3.3.9
|
302
302
|
signing_key:
|
303
303
|
specification_version: 4
|
304
304
|
summary: metanorma-iec lets you write IEC standards in AsciiDoc.
|