metanorma-iec 1.3.1 → 1.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +12 -11
- data/.hound.yml +3 -1
- data/.rubocop.yml +4 -8
- data/lib/asciidoctor/iec/biblio.rng +1 -0
- data/lib/asciidoctor/iec/iec.rng +4 -0
- data/lib/asciidoctor/iec/iec_intro_en.xml +1 -1
- data/lib/asciidoctor/iec/isodoc.rng +209 -4
- data/lib/asciidoctor/iec/isostandard.rng +12 -0
- data/lib/isodoc/iec/base_convert.rb +20 -14
- data/lib/isodoc/iec/html_convert.rb +6 -6
- data/lib/isodoc/iec/iec.international-standard.xsl +564 -85
- data/lib/isodoc/iec/metadata.rb +1 -1
- data/lib/isodoc/iec/pdf_convert.rb +1 -1
- data/lib/isodoc/iec/presentation_xml_convert.rb +17 -17
- data/lib/isodoc/iec/word_convert.rb +69 -19
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +2 -2
- data/spec/asciidoctor/base_spec.rb +818 -801
- data/spec/asciidoctor/blocks_spec.rb +212 -154
- data/spec/asciidoctor/section_spec.rb +0 -38
- data/spec/isodoc/blocks_spec.rb +2 -2
- data/spec/isodoc/i18n_spec.rb +346 -432
- data/spec/isodoc/iev_spec.rb +508 -519
- data/spec/isodoc/inline_spec.rb +2 -2
- data/spec/isodoc/ref_spec.rb +6 -6
- data/spec/isodoc/section_spec.rb +334 -339
- data/spec/isodoc/terms_spec.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8efe031009d849297cc1ca141ddd5c859f36e132411caca46580c4fe86a04169
|
4
|
+
data.tar.gz: 46c36ffcc548f144d63b88408c69f0237e7f069322ce2b2f3933eed2ad96c4ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59f27b9c0b09b4810f917ceb37284ac86643282210d8b85f7e6461ef31092d74a430cdbeef211a1759dfe013b27605a88850c54ced016d0ea0ea35f06f674653
|
7
|
+
data.tar.gz: 2d91c48a9f9dc1e8166af7c79816c98745a4b575de0d791d6728fd4ef17907f58fb198923a71bd58a1cb41d575abd835a13b21fcad5946c7e47aac3f4f72b78f
|
data/.github/workflows/rake.yml
CHANGED
@@ -16,19 +16,9 @@ jobs:
|
|
16
16
|
strategy:
|
17
17
|
fail-fast: false
|
18
18
|
matrix:
|
19
|
-
ruby: [ '
|
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
data/.rubocop.yml
CHANGED
@@ -1,14 +1,10 @@
|
|
1
|
-
#
|
2
|
-
# https://github.com/
|
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
|
-
|
11
|
-
StyleGuideCopsOnly: false
|
12
|
-
TargetRubyVersion: 2.4
|
13
|
-
Rails:
|
14
|
-
Enabled: true
|
10
|
+
TargetRubyVersion: 2.5
|
data/lib/asciidoctor/iec/iec.rng
CHANGED
@@ -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
|
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>
|
@@ -927,7 +955,24 @@
|
|
927
955
|
<define name="concept">
|
928
956
|
<element name="concept">
|
929
957
|
<optional>
|
930
|
-
<
|
958
|
+
<element name="refterm">
|
959
|
+
<zeroOrMore>
|
960
|
+
<choice>
|
961
|
+
<ref name="PureTextElement"/>
|
962
|
+
<ref name="stem"/>
|
963
|
+
</choice>
|
964
|
+
</zeroOrMore>
|
965
|
+
</element>
|
966
|
+
</optional>
|
967
|
+
<optional>
|
968
|
+
<element name="renderterm">
|
969
|
+
<zeroOrMore>
|
970
|
+
<choice>
|
971
|
+
<ref name="PureTextElement"/>
|
972
|
+
<ref name="stem"/>
|
973
|
+
</choice>
|
974
|
+
</zeroOrMore>
|
975
|
+
</element>
|
931
976
|
</optional>
|
932
977
|
<choice>
|
933
978
|
<ref name="eref"/>
|
@@ -943,8 +988,170 @@
|
|
943
988
|
<ref name="permission"/>
|
944
989
|
<ref name="imagemap"/>
|
945
990
|
<ref name="svgmap"/>
|
991
|
+
<ref name="inputform"/>
|
992
|
+
</choice>
|
993
|
+
</define>
|
994
|
+
<define name="inputform">
|
995
|
+
<element name="form">
|
996
|
+
<attribute name="id">
|
997
|
+
<data type="ID"/>
|
998
|
+
</attribute>
|
999
|
+
<attribute name="name"/>
|
1000
|
+
<attribute name="action"/>
|
1001
|
+
<zeroOrMore>
|
1002
|
+
<choice>
|
1003
|
+
<ref name="TextElement"/>
|
1004
|
+
<ref name="FormInput"/>
|
1005
|
+
</choice>
|
1006
|
+
</zeroOrMore>
|
1007
|
+
</element>
|
1008
|
+
</define>
|
1009
|
+
<define name="FormInput">
|
1010
|
+
<choice>
|
1011
|
+
<ref name="input"/>
|
1012
|
+
<ref name="formlabel"/>
|
1013
|
+
<ref name="select"/>
|
1014
|
+
<ref name="textarea"/>
|
946
1015
|
</choice>
|
947
1016
|
</define>
|
1017
|
+
<define name="InputType">
|
1018
|
+
<choice>
|
1019
|
+
<value>button</value>
|
1020
|
+
<value>checkbox</value>
|
1021
|
+
<value>date</value>
|
1022
|
+
<value>file</value>
|
1023
|
+
<value>password</value>
|
1024
|
+
<value>radio</value>
|
1025
|
+
<value>submit</value>
|
1026
|
+
<value>text</value>
|
1027
|
+
</choice>
|
1028
|
+
</define>
|
1029
|
+
<define name="input">
|
1030
|
+
<element name="input">
|
1031
|
+
<attribute name="type">
|
1032
|
+
<ref name="InputType"/>
|
1033
|
+
</attribute>
|
1034
|
+
<optional>
|
1035
|
+
<attribute name="checked">
|
1036
|
+
<data type="boolean"/>
|
1037
|
+
</attribute>
|
1038
|
+
</optional>
|
1039
|
+
<optional>
|
1040
|
+
<attribute name="disabled">
|
1041
|
+
<data type="boolean"/>
|
1042
|
+
</attribute>
|
1043
|
+
</optional>
|
1044
|
+
<optional>
|
1045
|
+
<attribute name="readonly">
|
1046
|
+
<data type="boolean"/>
|
1047
|
+
</attribute>
|
1048
|
+
</optional>
|
1049
|
+
<optional>
|
1050
|
+
<attribute name="maxlength">
|
1051
|
+
<data type="int"/>
|
1052
|
+
</attribute>
|
1053
|
+
</optional>
|
1054
|
+
<optional>
|
1055
|
+
<attribute name="minlength">
|
1056
|
+
<data type="int"/>
|
1057
|
+
</attribute>
|
1058
|
+
</optional>
|
1059
|
+
<optional>
|
1060
|
+
<attribute name="name"/>
|
1061
|
+
</optional>
|
1062
|
+
<optional>
|
1063
|
+
<attribute name="value"/>
|
1064
|
+
</optional>
|
1065
|
+
<optional>
|
1066
|
+
<attribute name="id">
|
1067
|
+
<data type="ID"/>
|
1068
|
+
</attribute>
|
1069
|
+
</optional>
|
1070
|
+
</element>
|
1071
|
+
</define>
|
1072
|
+
<define name="formlabel">
|
1073
|
+
<element name="label">
|
1074
|
+
<attribute name="for">
|
1075
|
+
<data type="IDREF"/>
|
1076
|
+
</attribute>
|
1077
|
+
<zeroOrMore>
|
1078
|
+
<ref name="PureTextElement"/>
|
1079
|
+
</zeroOrMore>
|
1080
|
+
</element>
|
1081
|
+
</define>
|
1082
|
+
<define name="select">
|
1083
|
+
<element name="select">
|
1084
|
+
<optional>
|
1085
|
+
<attribute name="name"/>
|
1086
|
+
</optional>
|
1087
|
+
<optional>
|
1088
|
+
<attribute name="value"/>
|
1089
|
+
</optional>
|
1090
|
+
<optional>
|
1091
|
+
<attribute name="id">
|
1092
|
+
<data type="ID"/>
|
1093
|
+
</attribute>
|
1094
|
+
</optional>
|
1095
|
+
<optional>
|
1096
|
+
<attribute name="disabled">
|
1097
|
+
<data type="boolean"/>
|
1098
|
+
</attribute>
|
1099
|
+
</optional>
|
1100
|
+
<optional>
|
1101
|
+
<attribute name="multiple">
|
1102
|
+
<data type="boolean"/>
|
1103
|
+
</attribute>
|
1104
|
+
</optional>
|
1105
|
+
<optional>
|
1106
|
+
<attribute name="size">
|
1107
|
+
<data type="int"/>
|
1108
|
+
</attribute>
|
1109
|
+
</optional>
|
1110
|
+
<oneOrMore>
|
1111
|
+
<ref name="option"/>
|
1112
|
+
</oneOrMore>
|
1113
|
+
</element>
|
1114
|
+
</define>
|
1115
|
+
<define name="option">
|
1116
|
+
<element name="option">
|
1117
|
+
<optional>
|
1118
|
+
<attribute name="disabled">
|
1119
|
+
<data type="boolean"/>
|
1120
|
+
</attribute>
|
1121
|
+
</optional>
|
1122
|
+
<optional>
|
1123
|
+
<attribute name="value"/>
|
1124
|
+
</optional>
|
1125
|
+
<zeroOrMore>
|
1126
|
+
<ref name="PureTextElement"/>
|
1127
|
+
</zeroOrMore>
|
1128
|
+
</element>
|
1129
|
+
</define>
|
1130
|
+
<define name="textarea">
|
1131
|
+
<element name="textarea">
|
1132
|
+
<optional>
|
1133
|
+
<attribute name="name"/>
|
1134
|
+
</optional>
|
1135
|
+
<optional>
|
1136
|
+
<attribute name="value"/>
|
1137
|
+
</optional>
|
1138
|
+
<optional>
|
1139
|
+
<attribute name="id">
|
1140
|
+
<data type="ID"/>
|
1141
|
+
</attribute>
|
1142
|
+
</optional>
|
1143
|
+
<optional>
|
1144
|
+
<attribute name="rows">
|
1145
|
+
<data type="int"/>
|
1146
|
+
</attribute>
|
1147
|
+
</optional>
|
1148
|
+
<optional>
|
1149
|
+
<attribute name="cols">
|
1150
|
+
<data type="int"/>
|
1151
|
+
</attribute>
|
1152
|
+
</optional>
|
1153
|
+
</element>
|
1154
|
+
</define>
|
948
1155
|
<define name="bibliography">
|
949
1156
|
<element name="bibliography">
|
950
1157
|
<oneOrMore>
|
@@ -1017,9 +1224,7 @@
|
|
1017
1224
|
</define>
|
1018
1225
|
<define name="IsoWorkgroup">
|
1019
1226
|
<optional>
|
1020
|
-
<attribute name="number"
|
1021
|
-
<data type="int"/>
|
1022
|
-
</attribute>
|
1227
|
+
<attribute name="number"/>
|
1023
1228
|
</optional>
|
1024
1229
|
<optional>
|
1025
1230
|
<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
|
-
|
22
|
-
|
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 << " " }
|
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
|
-
|
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
|
-
|
85
|
-
|
86
|
-
gsub(
|
87
|
-
gsub(/\
|
88
|
-
gsub(/\s*\[\/TERMREF\]
|
89
|
-
|
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} — "))
|
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 << ", <#{domain}>"
|
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
|
-
|
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
|