metanorma-iec 1.3.3 → 1.3.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a24900a199a0791b4bb2358674e8b34b109c9d8953b656f0d6662c9f8fd0466
4
- data.tar.gz: b5db833a6cc328ff262ae38411438ca4549d36dacd74bb7ec14695183b41afec
3
+ metadata.gz: a5b9cbe5c402a7dbd3a2b074aefdc52fa620a62c515d8a8d32a904c2198d4c5e
4
+ data.tar.gz: 43958dfa8f657c760a67c35d10403123fde662527f0c94402a7f32ab2e582ad2
5
5
  SHA512:
6
- metadata.gz: 7c7741d485f92f29adc57dfac10b8d842db1fab885f5f220fdcd216644ee78831ea9feee2fa3d028f612e78e44c1bccf074aaeed96fcf237462e4ef0c7621364
7
- data.tar.gz: 94b6790578314e2bf8fc68c77241a14b4ac68f8bbffa69706593f6345b82ccc9766ac6b80f7931c97c7ed3c5003bd309644863706eef6308ac8cdfe08b8e8852
6
+ metadata.gz: 5fa2ca8ae28b7ae9d060a1900f72a362f2d3f64b7cfb36a3b7e537270720be9c01b7eb5df31ca86ce263cc59b3dc08556d517c8c7aab4f9d4170846261b0a197
7
+ data.tar.gz: dd32106b4774c119cdd10ce89944f116d146906f70e0ecb29e8094fe45340319c35e1dcc308ebf1f0c95699b6a398b4f970b5878e7730eee27e169d4360841ee
@@ -16,19 +16,9 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: [ '2.7', '2.6', '2.5', '2.4' ]
19
+ ruby: [ '3.0', '2.7', '2.6', '2.5' ]
20
20
  os: [ ubuntu-latest, windows-latest, macos-latest ]
21
21
  experimental: [ false ]
22
- include:
23
- - ruby: '3.0'
24
- os: 'ubuntu-latest'
25
- experimental: true
26
- - ruby: '3.0'
27
- os: 'windows-latest'
28
- experimental: true
29
- - ruby: '3.0'
30
- os: 'macos-latest'
31
- experimental: true
32
22
  steps:
33
23
  - uses: actions/checkout@v2
34
24
  with:
@@ -40,3 +30,14 @@ jobs:
40
30
  bundler-cache: true
41
31
 
42
32
  - run: bundle exec rake
33
+
34
+ tests-passed:
35
+ needs: rake
36
+ runs-on: ubuntu-latest
37
+ steps:
38
+ - uses: peter-evans/repository-dispatch@v1
39
+ with:
40
+ token: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
41
+ repository: ${{ github.repository }}
42
+ event-type: tests-passed
43
+ client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
data/.hound.yml CHANGED
@@ -1,3 +1,5 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
1
3
  ruby:
2
- Enabled: true
4
+ enabled: true
3
5
  config_file: .rubocop.yml
data/.rubocop.yml CHANGED
@@ -1,12 +1,10 @@
1
- # This project follows the Ribose OSS style guide.
2
- # https://github.com/riboseinc/oss-guides
3
- # All project-specific additions and overrides should be specified in this file.
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
4
3
  inherit_from:
5
4
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
6
5
 
7
6
  # local repo-specific modifications
7
+ # ...
8
8
 
9
9
  AllCops:
10
- DisplayCopNames: false
11
- StyleGuideCopsOnly: false
12
- TargetRubyVersion: 2.4
10
+ TargetRubyVersion: 2.5
@@ -6,7 +6,9 @@ module Asciidoctor
6
6
  csv_split(publishers)&.each do |p|
7
7
  xml.contributor do |c|
8
8
  c.role **{ type: "author" }
9
- c.organization { |a| organization(a, p, false, node, !node.attr("publisher")) }
9
+ c.organization do |a|
10
+ organization(a, p, false, node, !node.attr("publisher"))
11
+ end
10
12
  end
11
13
  end
12
14
  end
@@ -16,7 +18,9 @@ module Asciidoctor
16
18
  csv_split(publishers)&.each do |p|
17
19
  xml.contributor do |c|
18
20
  c.role **{ type: "publisher" }
19
- c.organization { |a| organization(a, p, true, node, !node.attr("publisher")) }
21
+ c.organization do |a|
22
+ organization(a, p, true, node, !node.attr("publisher"))
23
+ end
20
24
  end
21
25
  end
22
26
  end
@@ -47,24 +51,29 @@ module Asciidoctor
47
51
  xml.docidentifier dn, **attr_code(type: "ISO")
48
52
  end
49
53
 
50
- def id_edition_suffix(dn, node)
54
+ def id_edition_suffix(docnum, node)
51
55
  ed = node.attr("edition") || 1
52
- dn += " ED #{ed}"
53
- dn
56
+ docnum += " ED #{ed}"
57
+ docnum
54
58
  end
55
59
 
56
60
  STAGE_CODES = {
57
- "PNW" => "1000", "ANW" => "2000", "CAN" => "2098", "ACD" => "2099", "CD" => "3020",
58
- "BWG" => "3092", "A2CD" => "3099", "2CD" => "3520", "3CD" => "3520", "4CD" => "3520",
59
- "5CD" => "3520", "6CD" => "3520", "7CD" => "3520", "8CD" => "3520", "9CD" => "3520",
60
- "CDM" => "3591", "A3CD" => "3592", "A4CD" => "3592", "A5CD" => "3592", "A6CD" => "3592",
61
- "A7CD" => "3592", "A8CD" => "3592", "A9CD" => "3592", "ACDV" => "3599", "CCDV" => "4020",
62
- "CDVM" => "4091", "NCDV" => "4092", "NADIS" => "4093", "ADIS" => "4099", "ADTR" => "4099",
63
- "ADTS" => "4099", "RDISH" => "5000", "RFDIS" => "5000", "CDISH" => "5020", "CDPAS" => "5020",
64
- "CDTR" => "5020", "CDTS" => "5020", "CFDIS" => "5020", "DTRM" => "5092", "DTSM" => "5092",
65
- "NDTR" => "5092", "NDTS" => "5092", "NFDIS" => "5092", "APUB" => "5099", "BPUB" => "6000",
66
- "PPUB" => "6060", "RR" => "9092", "AMW" => "9220", "WPUB" => "9599", "DELPUB" => "9960",
67
- "PWI" => "0000", "NWIP" => "1000", "WD" => "2000", "CDV" => "4000", "FDIS" => "5000",
61
+ "PNW" => "1000", "ANW" => "2000", "CAN" => "2098", "ACD" => "2099",
62
+ "CD" => "3020", "BWG" => "3092", "A2CD" => "3099", "2CD" => "3520",
63
+ "3CD" => "3520", "4CD" => "3520", "5CD" => "3520", "6CD" => "3520",
64
+ "7CD" => "3520", "8CD" => "3520", "9CD" => "3520", "CDM" => "3591",
65
+ "A3CD" => "3592", "A4CD" => "3592", "A5CD" => "3592", "A6CD" => "3592",
66
+ "A7CD" => "3592", "A8CD" => "3592", "A9CD" => "3592", "ACDV" => "3599",
67
+ "CCDV" => "4020", "CDVM" => "4091", "NCDV" => "4092",
68
+ "NADIS" => "4093", "ADIS" => "4099", "ADTR" => "4099",
69
+ "ADTS" => "4099", "RDISH" => "5000", "RFDIS" => "5000",
70
+ "CDISH" => "5020", "CDPAS" => "5020", "CDTR" => "5020",
71
+ "CDTS" => "5020", "CFDIS" => "5020", "DTRM" => "5092",
72
+ "DTSM" => "5092", "NDTR" => "5092", "NDTS" => "5092",
73
+ "NFDIS" => "5092", "APUB" => "5099", "BPUB" => "6000",
74
+ "PPUB" => "6060", "RR" => "9092", "AMW" => "9220", "WPUB" => "9599",
75
+ "DELPUB" => "9960", "PWI" => "0000", "NWIP" => "1000", "WD" => "2000",
76
+ "CDV" => "4000", "FDIS" => "5000"
68
77
  }.freeze
69
78
 
70
79
  DOC_STAGE = {
@@ -82,19 +91,23 @@ module Asciidoctor
82
91
  }.freeze
83
92
 
84
93
  STAGE_ABBRS = {
85
- "00" => {"00" => "PWI"},
86
- "10" => {"00" => "PNW"},
87
- "20" => {"00" => "ANW", "98" => "CAN", "99" => "ACD"},
88
- "30" => {"00" => "CD", "20" => "CD", "92" => "BWG", "97" => "MERGED", "98" => "DREJ", "99" => "A2CD"},
89
- "35" => {"00" => "CD", "20" => "CD", "91" => "CDM", "92" => "ACD", "99" => "ACDV"},
90
- "40" => {"00" => "CCDV", "20" => "CCDV", "91" => "CDVM", "92" => "NCDV", "93" => "NADIS",
91
- "95" => "ADISSB", "99" => "ADIS"},
92
- "50" => {"00" => "RFDIS", "20" => "CFDIS", "92" => "NFDIS", "95" => "APUBSB", "99" => "APUB"},
93
- "60" => {"00" => "BPUB", "60" => "PPUB"},
94
- "90" => {"00" => "RR", "92" => "RR"},
95
- "92" => {"00" => "AMW", "20" => "AMW"},
96
- "95" => {"00" => "WPUB", "99" => "WPUB"},
97
- "99" => {"00" => "DELPUB", "60" => "DELPUB"},
94
+ "00" => { "00" => "PWI" },
95
+ "10" => { "00" => "PNW" },
96
+ "20" => { "00" => "ANW", "98" => "CAN", "99" => "ACD" },
97
+ "30" => { "00" => "CD", "20" => "CD", "92" => "BWG", "97" => "MERGED",
98
+ "98" => "DREJ", "99" => "A2CD" },
99
+ "35" => { "00" => "CD", "20" => "CD", "91" => "CDM", "92" => "ACD",
100
+ "99" => "ACDV" },
101
+ "40" => { "00" => "CCDV", "20" => "CCDV", "91" => "CDVM",
102
+ "92" => "NCDV", "93" => "NADIS",
103
+ "95" => "ADISSB", "99" => "ADIS" },
104
+ "50" => { "00" => "RFDIS", "20" => "CFDIS", "92" => "NFDIS",
105
+ "95" => "APUBSB", "99" => "APUB" },
106
+ "60" => { "00" => "BPUB", "60" => "PPUB" },
107
+ "90" => { "00" => "RR", "92" => "RR" },
108
+ "92" => { "00" => "AMW", "20" => "AMW" },
109
+ "95" => { "00" => "WPUB", "99" => "WPUB" },
110
+ "99" => { "00" => "DELPUB", "60" => "DELPUB" },
98
111
  }.freeze
99
112
 
100
113
  STAGE_NAMES = {
@@ -112,7 +125,7 @@ module Asciidoctor
112
125
  "99": "Deleted",
113
126
  }.freeze
114
127
 
115
- def status_abbrev1(stage, substage, iter, doctype, draft)
128
+ def status_abbrev1(stage, substage, iter, doctype, _draft)
116
129
  return "" unless stage
117
130
 
118
131
  abbr = STAGE_ABBRS.dig(stage, substage) || "??"
@@ -121,30 +134,30 @@ module Asciidoctor
121
134
  end
122
135
  case doctype
123
136
  when "technical-report"
124
- stage = "ADTR" if stage == "40" && substage == "99"
125
- stage = "CDTR" if stage == "50" && substage == "20"
126
- stage = "DTRM" if stage == "50" && substage == "92"
137
+ abbr = "ADTR" if stage == "40" && substage == "99"
138
+ abbr = "CDTR" if stage == "50" && substage == "20"
139
+ abbr = "DTRM" if stage == "50" && substage == "92"
127
140
  when "technical-specification"
128
- stage = "ADTS" if stage == "40" && substage == "99"
129
- stage = "CDTS" if stage == "50" && substage == "20"
130
- stage = "DTSM" if stage == "50" && substage == "92"
141
+ abbr = "ADTS" if stage == "40" && substage == "99"
142
+ abbr = "CDTS" if stage == "50" && substage == "20"
143
+ abbr = "DTSM" if stage == "50" && substage == "92"
131
144
  when "interpretation-sheet"
132
- stage = "RDISH" if stage == "50" && substage == "00"
133
- stage = "CDISH" if stage == "50" && substage == "20"
145
+ abbr = "RDISH" if stage == "50" && substage == "00"
146
+ abbr = "CDISH" if stage == "50" && substage == "20"
134
147
  when "publicly-available-specification"
135
- stage = "CDPAS" if stage == "50" && substage == "20"
148
+ abbr = "CDPAS" if stage == "50" && substage == "20"
136
149
  end
137
150
  abbr = abbr.sub(/CD$/, "#{iter}CD") if iter
138
151
  abbr
139
152
  end
140
153
 
141
- def stage_abbr(stage, substage)
154
+ def stage_abbr(stage, _substage)
142
155
  return "PPUB" if stage == "60"
143
156
 
144
157
  DOC_STAGE[stage.to_sym] || "??"
145
158
  end
146
159
 
147
- def stage_name(stage, substage, _doctype, _iteration)
160
+ def stage_name(stage, _substage, _doctype, _iteration)
148
161
  STAGE_NAMES[stage.to_sym]
149
162
  end
150
163
 
@@ -159,11 +172,16 @@ module Asciidoctor
159
172
  st = node.attr("status") || node.attr("docstage")
160
173
  stage = get_stage(node)
161
174
  node.attr("docsubstage") ||
162
- ( stage == "60" ? "60" : STAGE_CODES[st] ? STAGE_CODES[st][2..3] : "00" )
175
+ (if stage == "60"
176
+ "60"
177
+ else
178
+ STAGE_CODES[st] ? STAGE_CODES[st][2..3] : "00"
179
+ end)
163
180
  end
164
181
 
165
- def id_stage_abbr(stage, substage, node)
182
+ def id_stage_abbr(stage, _substage, node)
166
183
  return "" if stage == "60"
184
+
167
185
  abbr = DOC_STAGE[stage.to_sym] || ""
168
186
  abbr = node.attr("iteration") + abbr if node.attr("iteration")
169
187
  abbr
@@ -174,9 +192,9 @@ module Asciidoctor
174
192
  substage = get_substage(node)
175
193
  xml.status do |s|
176
194
  s.stage stage, **attr_code(abbreviation: stage_abbr(stage, substage))
177
- s.substage substage,
178
- **attr_code(abbreviation: status_abbrev1(stage, substage, node.attr("iteration"),
179
- doctype(node),node.attr("draft")))
195
+ subst = status_abbrev1(stage, substage, node.attr("iteration"),
196
+ doctype(node), node.attr("draft"))
197
+ s.substage substage, **attr_code(abbreviation: subst)
180
198
  node.attr("iteration") && (s.iteration node.attr("iteration"))
181
199
  end
182
200
  end
@@ -13,10 +13,14 @@
13
13
  <value>publicly-available-specification</value>
14
14
  <value>international-workshop-agreement</value>
15
15
  <value>guide</value>
16
+ <value>industry-technical-agreement</value>
16
17
  </choice>
17
18
  </define>
18
19
  <define name="BibDataExtensionType">
19
20
  <ref name="doctype"/>
21
+ <optional>
22
+ <ref name="docsubtype"/>
23
+ </optional>
20
24
  <optional>
21
25
  <ref name="horizontal"/>
22
26
  </optional>
@@ -45,6 +45,11 @@
45
45
  <optional>
46
46
  <attribute name="alt"/>
47
47
  </optional>
48
+ <optional>
49
+ <attribute name="updatetype">
50
+ <data type="boolean"/>
51
+ </attribute>
52
+ </optional>
48
53
  <text/>
49
54
  </element>
50
55
  </define>
@@ -199,6 +204,18 @@
199
204
  </zeroOrMore>
200
205
  </element>
201
206
  </define>
207
+ <define name="dt">
208
+ <element name="dt">
209
+ <optional>
210
+ <attribute name="id">
211
+ <data type="ID"/>
212
+ </attribute>
213
+ </optional>
214
+ <zeroOrMore>
215
+ <ref name="TextElement"/>
216
+ </zeroOrMore>
217
+ </element>
218
+ </define>
202
219
  <define name="example">
203
220
  <element name="example">
204
221
  <attribute name="id">
@@ -543,6 +560,9 @@
543
560
  </define>
544
561
  <define name="BibDataExtensionType">
545
562
  <ref name="doctype"/>
563
+ <optional>
564
+ <ref name="docsubtype"/>
565
+ </optional>
546
566
  <optional>
547
567
  <ref name="editorialgroup"/>
548
568
  </optional>
@@ -890,6 +910,14 @@
890
910
  </define>
891
911
  </include>
892
912
  <!-- end overrides -->
913
+ <define name="docsubtype">
914
+ <element name="subdoctype">
915
+ <ref name="DocumentSubtype"/>
916
+ </element>
917
+ </define>
918
+ <define name="DocumentSubtype">
919
+ <text/>
920
+ </define>
893
921
  <define name="colgroup">
894
922
  <element name="colgroup">
895
923
  <oneOrMore>
@@ -939,7 +967,34 @@
939
967
  <define name="concept">
940
968
  <element name="concept">
941
969
  <optional>
942
- <attribute name="term"/>
970
+ <attribute name="ital">
971
+ <data type="boolean"/>
972
+ </attribute>
973
+ </optional>
974
+ <optional>
975
+ <attribute name="ref">
976
+ <data type="boolean"/>
977
+ </attribute>
978
+ </optional>
979
+ <optional>
980
+ <element name="refterm">
981
+ <zeroOrMore>
982
+ <choice>
983
+ <ref name="PureTextElement"/>
984
+ <ref name="stem"/>
985
+ </choice>
986
+ </zeroOrMore>
987
+ </element>
988
+ </optional>
989
+ <optional>
990
+ <element name="renderterm">
991
+ <zeroOrMore>
992
+ <choice>
993
+ <ref name="PureTextElement"/>
994
+ <ref name="stem"/>
995
+ </choice>
996
+ </zeroOrMore>
997
+ </element>
943
998
  </optional>
944
999
  <choice>
945
1000
  <ref name="eref"/>
@@ -965,6 +1020,9 @@
965
1020
  </attribute>
966
1021
  <attribute name="name"/>
967
1022
  <attribute name="action"/>
1023
+ <optional>
1024
+ <attribute name="class"/>
1025
+ </optional>
968
1026
  <zeroOrMore>
969
1027
  <choice>
970
1028
  <ref name="TextElement"/>
@@ -1457,26 +1515,26 @@
1457
1515
  <optional>
1458
1516
  <ref name="section-title"/>
1459
1517
  </optional>
1460
- <group>
1518
+ <choice>
1461
1519
  <choice>
1462
1520
  <group>
1463
- <zeroOrMore>
1521
+ <oneOrMore>
1464
1522
  <ref name="BasicBlock"/>
1465
- </zeroOrMore>
1523
+ </oneOrMore>
1466
1524
  <zeroOrMore>
1467
1525
  <ref name="note"/>
1468
1526
  </zeroOrMore>
1469
1527
  </group>
1470
1528
  <ref name="amend"/>
1471
1529
  </choice>
1472
- <zeroOrMore>
1530
+ <oneOrMore>
1473
1531
  <choice>
1474
1532
  <ref name="clause-subsection"/>
1475
1533
  <ref name="terms"/>
1476
1534
  <ref name="definitions"/>
1477
1535
  </choice>
1478
- </zeroOrMore>
1479
- </group>
1536
+ </oneOrMore>
1537
+ </choice>
1480
1538
  </define>
1481
1539
  <define name="Annex-Section">
1482
1540
  <optional>
@@ -38,6 +38,9 @@
38
38
  </define>
39
39
  <define name="BibDataExtensionType">
40
40
  <ref name="doctype"/>
41
+ <optional>
42
+ <ref name="docsubtype"/>
43
+ </optional>
41
44
  <optional>
42
45
  <ref name="horizontal"/>
43
46
  </optional>
@@ -98,7 +101,11 @@
98
101
  <ref name="definitions"/>
99
102
  </optional>
100
103
  <oneOrMore>
101
- <ref name="clause"/>
104
+ <choice>
105
+ <ref name="clause"/>
106
+ <ref name="term-clause"/>
107
+ <ref name="terms"/>
108
+ </choice>
102
109
  </oneOrMore>
103
110
  </element>
104
111
  </define>
@@ -133,7 +140,7 @@
133
140
  <optional>
134
141
  <ref name="section-title"/>
135
142
  </optional>
136
- <group>
143
+ <choice>
137
144
  <choice>
138
145
  <group>
139
146
  <oneOrMore>
@@ -148,7 +155,7 @@
148
155
  <oneOrMore>
149
156
  <ref name="clause-subsection"/>
150
157
  </oneOrMore>
151
- </group>
158
+ </choice>
152
159
  </define>
153
160
  <define name="term">
154
161
  <element name="term">
@@ -259,6 +266,14 @@
259
266
  <value>directive</value>
260
267
  </choice>
261
268
  </define>
269
+ <define name="DocumentSubtype">
270
+ <choice>
271
+ <value>specification</value>
272
+ <value>method-of-test</value>
273
+ <value>vocabulary</value>
274
+ <value>code-of-practice</value>
275
+ </choice>
276
+ </define>
262
277
  <define name="structuredidentifier">
263
278
  <element name="structuredidentifier">
264
279
  <optional>