metanorma-iec 1.3.0 → 1.3.5

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: 896831ab7585bc0d95fa10bcef8ba276bc624f6b5b51534e136177f43c74723c
4
- data.tar.gz: 2dec389207942c399e02b6cb085541f6255715f3cbb0c6c1ee8dfe29204b618d
3
+ metadata.gz: 1927ece3a09c61d4d12c9f6daa48bbadf0168bee1bfcde52392123308c44edb6
4
+ data.tar.gz: 1c92e46aa15e727af3438267cf5f9e72d78c00a959a8bcc354f384d0cc21102b
5
5
  SHA512:
6
- metadata.gz: ca103b07a7421e67ec218b8a759fc51d997eab8185a11c0bff0fefa6f1b632ea4bd614e61028b1b94e6f372f3c73c8a7ea9a772a507cdff883d0a14d502a9717
7
- data.tar.gz: ffad29f88e9171b636abf4fb7d1b85fe5a6627fd71fdbadf53cb612cae032b6f1481a3bf3dc950ea3623f93bbd45a87a4c9467358022cc250daffeac25cec956
6
+ metadata.gz: 98fd5f51acfe167d57c8f465d69d2f8fe7c4c24fd1393ed1377b27c36735066fbe1b71aeb6970e4e16ede2ed98f7143c602a4b3a091ad19f8b799dd3618639fb
7
+ data.tar.gz: da6cd485af116325a064b085d0533a0f895129de6a240129b233d1b9ea278df14a8a4a3931218b3ab34c87250fbd88df2a94a2177d0925a37458c97c8c88b348
@@ -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', '2.4' ]
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,14 +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
13
- Rails:
14
- Enabled: true
10
+ TargetRubyVersion: 2.5
@@ -787,6 +787,7 @@
787
787
  <value>adapted</value>
788
788
  <value>vote-started</value>
789
789
  <value>vote-ended</value>
790
+ <value>announced</value>
790
791
  </choice>
791
792
  </define>
792
793
  <define name="bdate">
@@ -6,7 +6,7 @@ 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, node, !node.attr("publisher")) }
9
+ c.organization { |a| organization(a, p, false, node, !node.attr("publisher")) }
10
10
  end
11
11
  end
12
12
  end
@@ -16,19 +16,21 @@ module Asciidoctor
16
16
  csv_split(publishers)&.each do |p|
17
17
  xml.contributor do |c|
18
18
  c.role **{ type: "publisher" }
19
- c.organization { |a| organization(a, p, node, !node.attr("publisher")) }
19
+ c.organization { |a| organization(a, p, true, node, !node.attr("publisher")) }
20
20
  end
21
21
  end
22
22
  end
23
23
 
24
24
  def metadata_copyright(node, xml)
25
- publishers = node.attr("copyright-holder") || node.attr("publisher") || "IEC"
25
+ publishers = node.attr("copyright-holder") || node.attr("publisher") ||
26
+ "IEC"
26
27
  csv_split(publishers)&.each do |p|
27
28
  xml.copyright do |c|
28
29
  c.from (node.attr("copyright-year") || Date.today.year)
29
30
  c.owner do |owner|
30
31
  owner.organization do |o|
31
- organization(o, p, node, !node.attr("copyright-holder") || node.attr("publisher"))
32
+ organization(o, p, true, node, !node.attr("copyright-holder") ||
33
+ node.attr("publisher"))
32
34
  end
33
35
  end
34
36
  end
@@ -37,6 +39,7 @@ module Asciidoctor
37
39
 
38
40
  def iso_id(node, xml)
39
41
  return unless node.attr("docnumber")
42
+
40
43
  part, subpart = node&.attr("partnumber")&.split(/-/)
41
44
  dn = add_id_parts(node.attr("docnumber"), part, subpart)
42
45
  dn = id_stage_prefix(dn, node, false)
@@ -111,6 +114,7 @@ module Asciidoctor
111
114
 
112
115
  def status_abbrev1(stage, substage, iter, doctype, draft)
113
116
  return "" unless stage
117
+
114
118
  abbr = STAGE_ABBRS.dig(stage, substage) || "??"
115
119
  if stage == "35" && substage == "92"
116
120
  iter = (iter.to_i + 1) % "02"
@@ -136,6 +140,7 @@ module Asciidoctor
136
140
 
137
141
  def stage_abbr(stage, substage)
138
142
  return "PPUB" if stage == "60"
143
+
139
144
  DOC_STAGE[stage.to_sym] || "??"
140
145
  end
141
146
 
@@ -188,7 +193,8 @@ module Asciidoctor
188
193
 
189
194
  def metadata_ext(node, xml)
190
195
  super
191
- a = node.attr("accessibility-color-inside") and xml.accessibility_color_inside a
196
+ a = node.attr("accessibility-color-inside") and
197
+ xml.accessibility_color_inside a
192
198
  a = node.attr("price-code") and xml.price_code a
193
199
  a = node.attr("cen-processing") and xml.cen_processing a
194
200
  a = node.attr("secretary") and xml.secretary a
@@ -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>
@@ -50,7 +50,7 @@
50
50
  <license-statement>
51
51
  <clause>
52
52
  {% if stage_int < 50 %}
53
- <p>This document is still under study and subject to change. It should not be used for reference purposes.</p>
53
+ <p>This document is still under study and subject to change. It should not be used for reference purposes.
54
54
  until published as such.</p>
55
55
  {% endif %}
56
56
  {% if stage_int >= 50 %}
@@ -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>
@@ -543,6 +548,9 @@
543
548
  </define>
544
549
  <define name="BibDataExtensionType">
545
550
  <ref name="doctype"/>
551
+ <optional>
552
+ <ref name="docsubtype"/>
553
+ </optional>
546
554
  <optional>
547
555
  <ref name="editorialgroup"/>
548
556
  </optional>
@@ -876,8 +884,28 @@
876
884
  </zeroOrMore>
877
885
  </element>
878
886
  </define>
887
+ <define name="pagebreak">
888
+ <element name="pagebreak">
889
+ <optional>
890
+ <attribute name="orientation">
891
+ <choice>
892
+ <value>landscape</value>
893
+ <value>portrait</value>
894
+ </choice>
895
+ </attribute>
896
+ </optional>
897
+ </element>
898
+ </define>
879
899
  </include>
880
900
  <!-- end overrides -->
901
+ <define name="docsubtype">
902
+ <element name="docsubtype">
903
+ <ref name="DocumentSubtype"/>
904
+ </element>
905
+ </define>
906
+ <define name="DocumentSubtype">
907
+ <text/>
908
+ </define>
881
909
  <define name="colgroup">
882
910
  <element name="colgroup">
883
911
  <oneOrMore>
@@ -943,8 +971,170 @@
943
971
  <ref name="permission"/>
944
972
  <ref name="imagemap"/>
945
973
  <ref name="svgmap"/>
974
+ <ref name="inputform"/>
975
+ </choice>
976
+ </define>
977
+ <define name="inputform">
978
+ <element name="form">
979
+ <attribute name="id">
980
+ <data type="ID"/>
981
+ </attribute>
982
+ <attribute name="name"/>
983
+ <attribute name="action"/>
984
+ <zeroOrMore>
985
+ <choice>
986
+ <ref name="TextElement"/>
987
+ <ref name="FormInput"/>
988
+ </choice>
989
+ </zeroOrMore>
990
+ </element>
991
+ </define>
992
+ <define name="FormInput">
993
+ <choice>
994
+ <ref name="input"/>
995
+ <ref name="formlabel"/>
996
+ <ref name="select"/>
997
+ <ref name="textarea"/>
998
+ </choice>
999
+ </define>
1000
+ <define name="InputType">
1001
+ <choice>
1002
+ <value>button</value>
1003
+ <value>checkbox</value>
1004
+ <value>date</value>
1005
+ <value>file</value>
1006
+ <value>password</value>
1007
+ <value>radio</value>
1008
+ <value>submit</value>
1009
+ <value>text</value>
946
1010
  </choice>
947
1011
  </define>
1012
+ <define name="input">
1013
+ <element name="input">
1014
+ <attribute name="type">
1015
+ <ref name="InputType"/>
1016
+ </attribute>
1017
+ <optional>
1018
+ <attribute name="checked">
1019
+ <data type="boolean"/>
1020
+ </attribute>
1021
+ </optional>
1022
+ <optional>
1023
+ <attribute name="disabled">
1024
+ <data type="boolean"/>
1025
+ </attribute>
1026
+ </optional>
1027
+ <optional>
1028
+ <attribute name="readonly">
1029
+ <data type="boolean"/>
1030
+ </attribute>
1031
+ </optional>
1032
+ <optional>
1033
+ <attribute name="maxlength">
1034
+ <data type="int"/>
1035
+ </attribute>
1036
+ </optional>
1037
+ <optional>
1038
+ <attribute name="minlength">
1039
+ <data type="int"/>
1040
+ </attribute>
1041
+ </optional>
1042
+ <optional>
1043
+ <attribute name="name"/>
1044
+ </optional>
1045
+ <optional>
1046
+ <attribute name="value"/>
1047
+ </optional>
1048
+ <optional>
1049
+ <attribute name="id">
1050
+ <data type="ID"/>
1051
+ </attribute>
1052
+ </optional>
1053
+ </element>
1054
+ </define>
1055
+ <define name="formlabel">
1056
+ <element name="label">
1057
+ <attribute name="for">
1058
+ <data type="IDREF"/>
1059
+ </attribute>
1060
+ <zeroOrMore>
1061
+ <ref name="PureTextElement"/>
1062
+ </zeroOrMore>
1063
+ </element>
1064
+ </define>
1065
+ <define name="select">
1066
+ <element name="select">
1067
+ <optional>
1068
+ <attribute name="name"/>
1069
+ </optional>
1070
+ <optional>
1071
+ <attribute name="value"/>
1072
+ </optional>
1073
+ <optional>
1074
+ <attribute name="id">
1075
+ <data type="ID"/>
1076
+ </attribute>
1077
+ </optional>
1078
+ <optional>
1079
+ <attribute name="disabled">
1080
+ <data type="boolean"/>
1081
+ </attribute>
1082
+ </optional>
1083
+ <optional>
1084
+ <attribute name="multiple">
1085
+ <data type="boolean"/>
1086
+ </attribute>
1087
+ </optional>
1088
+ <optional>
1089
+ <attribute name="size">
1090
+ <data type="int"/>
1091
+ </attribute>
1092
+ </optional>
1093
+ <oneOrMore>
1094
+ <ref name="option"/>
1095
+ </oneOrMore>
1096
+ </element>
1097
+ </define>
1098
+ <define name="option">
1099
+ <element name="option">
1100
+ <optional>
1101
+ <attribute name="disabled">
1102
+ <data type="boolean"/>
1103
+ </attribute>
1104
+ </optional>
1105
+ <optional>
1106
+ <attribute name="value"/>
1107
+ </optional>
1108
+ <zeroOrMore>
1109
+ <ref name="PureTextElement"/>
1110
+ </zeroOrMore>
1111
+ </element>
1112
+ </define>
1113
+ <define name="textarea">
1114
+ <element name="textarea">
1115
+ <optional>
1116
+ <attribute name="name"/>
1117
+ </optional>
1118
+ <optional>
1119
+ <attribute name="value"/>
1120
+ </optional>
1121
+ <optional>
1122
+ <attribute name="id">
1123
+ <data type="ID"/>
1124
+ </attribute>
1125
+ </optional>
1126
+ <optional>
1127
+ <attribute name="rows">
1128
+ <data type="int"/>
1129
+ </attribute>
1130
+ </optional>
1131
+ <optional>
1132
+ <attribute name="cols">
1133
+ <data type="int"/>
1134
+ </attribute>
1135
+ </optional>
1136
+ </element>
1137
+ </define>
948
1138
  <define name="bibliography">
949
1139
  <element name="bibliography">
950
1140
  <oneOrMore>
@@ -1017,9 +1207,7 @@
1017
1207
  </define>
1018
1208
  <define name="IsoWorkgroup">
1019
1209
  <optional>
1020
- <attribute name="number">
1021
- <data type="int"/>
1022
- </attribute>
1210
+ <attribute name="number"/>
1023
1211
  </optional>
1024
1212
  <optional>
1025
1213
  <attribute name="type"/>
@@ -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>
@@ -256,6 +259,15 @@
256
259
  <value>guide</value>
257
260
  <value>amendment</value>
258
261
  <value>technical-corrigendum</value>
262
+ <value>directive</value>
263
+ </choice>
264
+ </define>
265
+ <define name="DocumentSubtype">
266
+ <choice>
267
+ <value>specification</value>
268
+ <value>method-of-test</value>
269
+ <value>vocabulary</value>
270
+ <value>code-of-practice</value>
259
271
  </choice>
260
272
  </define>
261
273
  <define name="structuredidentifier">
@@ -18,8 +18,8 @@ module IsoDoc
18
18
  s.h1(**{ class: "ForewordTitle" }) { |h1| h1 << @i18n.foreword }
19
19
  @meta.get[:doctype] == "Amendment" or
20
20
  s.div **attr_code(class: "boilerplate_legal") do |s1|
21
- b&.elements&.each { |e| parse(e, s1) }
22
- end
21
+ b&.elements&.each { |e| parse(e, s1) }
22
+ end
23
23
  f&.elements&.each { |e| parse(e, s) unless e.name == "title" }
24
24
  end
25
25
  end
@@ -40,12 +40,12 @@ module IsoDoc
40
40
  @meta.get[:doctitlepartlabel] and
41
41
  title2 = "#{@meta.get[:doctitlepartlabel]}: #{title2}"
42
42
  end
43
- out.p(**{ class: "zzSTDTitle1" }) do |p|
43
+ out.p(**{ class: "zzSTDTitle1" }) do |p|
44
44
  p.b { |b| b << title1 }
45
45
  end
46
46
  if @meta.get[:doctitlepart]
47
47
  out.p(**{ class: "zzSTDTitle1" }) { |p| p << "&nbsp;" }
48
- out.p(**{ class: "zzSTDTitle2" }) do |p|
48
+ out.p(**{ class: "zzSTDTitle2" }) do |p|
49
49
  p.b { |b| b << title2 }
50
50
  end
51
51
  end
@@ -58,7 +58,7 @@ module IsoDoc
58
58
 
59
59
  def biblio_list(f, div, biblio)
60
60
  return super unless @is_iev
61
- i = 0
61
+
62
62
  f.children.each do |b|
63
63
  parse(b, div) unless %w(title bibitem).include? b.name
64
64
  end
@@ -66,6 +66,7 @@ module IsoDoc
66
66
 
67
67
  def terms_parse(node, out)
68
68
  return super unless @is_iev
69
+
69
70
  page_break(out)
70
71
  out.div **attr_code(id: node["id"]) do |div|
71
72
  out.p(**{ class: "zzSTDTitle2" }) do |p|
@@ -81,12 +82,14 @@ module IsoDoc
81
82
 
82
83
  def termref_cleanup(docxml)
83
84
  return super unless @is_iev
84
- docxml.
85
- gsub(%r{\s*\[/TERMREF\]\s*</p>\s*<p>\s*\[TERMREF\]}, "; ").
86
- gsub(/\[TERMREF\]\s*/, l10n("#{@i18n.source}: ")).
87
- gsub(/\s*\[MODIFICATION\]\s*\[\/TERMREF\]/, l10n(", #{@i18n.modified} [/TERMREF]")).
88
- gsub(/\s*\[\/TERMREF\]\s*/, l10n("")).
89
- gsub(/\s*\[MODIFICATION\]/, l10n(", #{@i18n.modified} &mdash; "))
85
+
86
+ docxml
87
+ .gsub(%r{\s*\[/TERMREF\]\s*</p>\s*<p>\s*\[TERMREF\]}, "; ")
88
+ .gsub(/\[TERMREF\]\s*/, l10n("#{@i18n.source}: "))
89
+ .gsub(/\s*\[MODIFICATION\]\s*\[\/TERMREF\]/,
90
+ l10n(", #{@i18n.modified} [/TERMREF]"))
91
+ .gsub(/\s*\[\/TERMREF\]\s*/, l10n(""))
92
+ .gsub(/\s*\[MODIFICATION\]/, l10n(", #{@i18n.modified} &mdash; "))
90
93
  end
91
94
 
92
95
  def set_termdomain(termdomain)
@@ -95,13 +98,15 @@ module IsoDoc
95
98
 
96
99
  def term_suffix(node, out)
97
100
  return unless @is_iev
101
+
98
102
  domain = node&.at(ns("../domain"))&.text
99
103
  return unless domain
104
+
100
105
  out << ", &lt;#{domain}&gt;"
101
106
  end
102
107
 
103
108
  def deprecated_term_parse(node, out)
104
- out.p **{ class: "DeprecatedTerms", style:"text-align:left;" } do |p|
109
+ out.p **{ class: "DeprecatedTerms", style: "text-align:left;" } do |p|
105
110
  p << l10n("#{@i18n.deprecated}: ")
106
111
  node.children.each { |c| parse(c, p) }
107
112
  term_suffix(node, p)
@@ -109,7 +114,7 @@ module IsoDoc
109
114
  end
110
115
 
111
116
  def admitted_term_parse(node, out)
112
- out.p **{ class: "AltTerms", style:"text-align:left;" } do |p|
117
+ out.p **{ class: "AltTerms", style: "text-align:left;" } do |p|
113
118
  node.children.each { |c| parse(c, p) }
114
119
  term_suffix(node, p)
115
120
  end
@@ -117,7 +122,8 @@ module IsoDoc
117
122
 
118
123
  def term_parse(node, out)
119
124
  return super unless @is_iev
120
- out.p **{ class: "Terms", style:"text-align:left;" } do |p|
125
+
126
+ out.p **{ class: "Terms", style: "text-align:left;" } do |p|
121
127
  node.children.each { |c| parse(c, p) }
122
128
  term_suffix(node, p)
123
129
  end