metanorma-iso 2.1.1 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/html2doc/lists.rb +145 -10
- data/lib/isodoc/iso/base_convert.rb +10 -0
- data/lib/isodoc/iso/html/html_iso_titlepage.html +2 -0
- data/lib/isodoc/iso/html/isodoc-dis.css +173 -257
- data/lib/isodoc/iso/html/isodoc-dis.scss +173 -249
- data/lib/isodoc/iso/html/isodoc.css +38 -13
- data/lib/isodoc/iso/html/isodoc.scss +38 -12
- data/lib/isodoc/iso/html/style-human.css +14 -1
- data/lib/isodoc/iso/html/style-human.scss +10 -1
- data/lib/isodoc/iso/html/style-iso.css +35 -23
- data/lib/isodoc/iso/html/style-iso.scss +31 -23
- data/lib/isodoc/iso/html/word_iso_intro-dis.html +1 -6
- data/lib/isodoc/iso/html/word_iso_titlepage-dis.html +24 -13
- data/lib/isodoc/iso/html/word_iso_titlepage-prf.html +58 -0
- data/lib/isodoc/iso/html/word_iso_titlepage.html +6 -2
- data/lib/isodoc/iso/html_convert.rb +5 -0
- data/lib/isodoc/iso/i18n-en.yaml +32 -4
- data/lib/isodoc/iso/i18n-fr.yaml +29 -3
- data/lib/isodoc/iso/i18n-ru.yaml +32 -4
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +32 -3
- data/lib/isodoc/iso/i18n.rb +1 -1
- data/lib/isodoc/iso/iso.amendment.xsl +750 -307
- data/lib/isodoc/iso/iso.international-standard.xsl +750 -307
- data/lib/isodoc/iso/metadata.rb +63 -63
- data/lib/isodoc/iso/presentation_bibdata.rb +74 -0
- data/lib/isodoc/iso/presentation_xml_convert.rb +15 -4
- data/lib/isodoc/iso/presentation_xref.rb +8 -2
- data/lib/isodoc/iso/sections.rb +1 -1
- data/lib/isodoc/iso/word_cleanup.rb +3 -0
- data/lib/isodoc/iso/word_convert.rb +6 -3
- data/lib/isodoc/iso/word_dis_cleanup.rb +243 -0
- data/lib/isodoc/iso/word_dis_convert.rb +47 -108
- data/lib/isodoc/iso/xref.rb +34 -6
- data/lib/metanorma/iso/base.rb +14 -1
- data/lib/metanorma/iso/biblio.rng +134 -39
- data/lib/metanorma/iso/boilerplate-fr.xml +3 -0
- data/lib/metanorma/iso/boilerplate-ru.xml +3 -0
- data/lib/metanorma/iso/boilerplate.xml +3 -0
- data/lib/metanorma/iso/cleanup.rb +53 -13
- data/lib/metanorma/iso/front.rb +38 -6
- data/lib/metanorma/iso/front_id.rb +2 -0
- data/lib/metanorma/iso/isodoc.rng +32 -0
- data/lib/metanorma/iso/isostandard.rng +32 -12
- data/lib/metanorma/iso/validate_section.rb +0 -12
- data/lib/metanorma/iso/version.rb +1 -1
- data/spec/isodoc/amd_spec.rb +4 -30
- data/spec/isodoc/blocks_spec.rb +499 -2
- data/spec/isodoc/i18n_spec.rb +145 -80
- data/spec/isodoc/iso_spec.rb +50 -169
- data/spec/isodoc/metadata_spec.rb +223 -83
- data/spec/isodoc/postproc_spec.rb +41 -5
- data/spec/isodoc/section_spec.rb +9 -9
- data/spec/isodoc/word_dis_spec.rb +1332 -146
- data/spec/isodoc/xref_spec.rb +87 -13
- data/spec/metanorma/amd_spec.rb +39 -23
- data/spec/metanorma/base_spec.rb +174 -44
- data/spec/metanorma/blocks_spec.rb +21 -0
- data/spec/metanorma/cleanup_spec.rb +196 -196
- data/spec/metanorma/lists_spec.rb +2 -2
- data/spec/metanorma/section_spec.rb +2 -2
- data/spec/metanorma/validate_spec.rb +8 -19
- data/spec/spec_helper.rb +10 -7
- data/spec/vcr_cassettes/withdrawn_iso.yml +30 -30
- metadata +6 -8
- data/docs/asciiiso-syntax.adoc +0 -307
- data/docs/guidance.adoc +0 -487
- data/docs/navigation.adoc +0 -23
- data/docs/quickstart.adoc +0 -179
- data/lib/isodoc/iso/presentation_inline.rb +0 -90
@@ -1023,202 +1023,202 @@ RSpec.describe Metanorma::ISO do
|
|
1023
1023
|
INPUT
|
1024
1024
|
output = <<~OUTPUT
|
1025
1025
|
#{BLANK_HDR}
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1026
|
+
<sections>
|
1027
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
1028
|
+
<title>Clause 1</title>
|
1029
|
+
<p id='_'>
|
1030
|
+
<eref type='inline' bibitemid='ref1' citeas='ISO 123'/>
|
1031
|
+
<eref type='inline' bibitemid='ref1a' citeas='ISO 123-100'/>
|
1032
|
+
<eref type='inline' bibitemid='ref1b' citeas='ISO/TS 123-1'/>
|
1033
|
+
<eref type='inline' bibitemid='ref2' citeas='ISO/IEC 123'/>
|
1034
|
+
<eref type='inline' bibitemid='ref3' citeas='IEC 123'/>
|
1035
|
+
<eref type='inline' bibitemid='ref4' citeas='GB 123'/>
|
1036
|
+
<eref type='inline' bibitemid='ref5' citeas='[7]'/>
|
1037
|
+
<eref type='inline' bibitemid='ref6' citeas='[B]'/>
|
1038
|
+
<eref type='inline' bibitemid='ref7' citeas='[A]'/>
|
1039
|
+
<xref target='ref8'/>
|
1040
|
+
<xref target='ref9'/>
|
1041
|
+
<eref type='inline' bibitemid='ref10' citeas='ISO/IEC 123'/>
|
1042
|
+
</p>
|
1043
|
+
</clause>
|
1044
|
+
</sections>
|
1045
|
+
<bibliography>
|
1046
|
+
<clause id='_' obligation='informative'>
|
1047
|
+
<title>Bibliography</title>
|
1048
|
+
<references id='_' normative='false' obligation='informative'>
|
1049
|
+
<title>Clause 1</title>
|
1050
|
+
<bibitem id='ref1' type='standard'>
|
1051
|
+
<title format='text/plain'>Standard ISO 123</title>
|
1052
|
+
<docidentifier>ISO 123</docidentifier>
|
1053
|
+
<docnumber>123</docnumber>
|
1054
|
+
<contributor>
|
1055
|
+
<role type='publisher'/>
|
1056
|
+
<organization>
|
1057
|
+
<name>International Organization for Standardization</name>
|
1058
|
+
<abbreviation>ISO</abbreviation>
|
1059
|
+
</organization>
|
1060
|
+
</contributor>
|
1061
|
+
</bibitem>
|
1062
|
+
<bibitem id='ref2' type='standard'>
|
1063
|
+
<title format='text/plain'>Standard ISO/IEC 123</title>
|
1064
|
+
<docidentifier>ISO/IEC 123</docidentifier>
|
1065
|
+
<docnumber>123</docnumber>
|
1066
|
+
<contributor>
|
1067
|
+
<role type='publisher'/>
|
1068
|
+
<organization>
|
1069
|
+
<name>International Organization for Standardization</name>
|
1070
|
+
<abbreviation>ISO</abbreviation>
|
1071
|
+
</organization>
|
1072
|
+
</contributor>
|
1073
|
+
<contributor>
|
1074
|
+
<role type='publisher'/>
|
1075
|
+
<organization>
|
1076
|
+
<name>International Electrotechnical Commission</name>
|
1077
|
+
<abbreviation>IEC</abbreviation>
|
1078
|
+
</organization>
|
1079
|
+
</contributor>
|
1080
|
+
</bibitem>
|
1081
|
+
<bibitem id='ref1b' type='standard'>
|
1082
|
+
<title format='text/plain'>Standard ISO 123</title>
|
1083
|
+
<docidentifier>ISO/TS 123-1</docidentifier>
|
1084
|
+
<docnumber>123-1</docnumber>
|
1085
|
+
<contributor>
|
1086
|
+
<role type='publisher'/>
|
1087
|
+
<organization>
|
1088
|
+
<name>International Organization for Standardization</name>
|
1089
|
+
<abbreviation>ISO</abbreviation>
|
1090
|
+
</organization>
|
1091
|
+
</contributor>
|
1092
|
+
<contributor>
|
1093
|
+
<role type='publisher'/>
|
1094
|
+
<organization>
|
1095
|
+
<name>TS</name>
|
1096
|
+
</organization>
|
1097
|
+
</contributor>
|
1098
|
+
</bibitem>
|
1099
|
+
<bibitem id='ref1a' type='standard'>
|
1100
|
+
<title format='text/plain'>Standard ISO 123</title>
|
1101
|
+
<docidentifier>ISO 123-100</docidentifier>
|
1102
|
+
<docnumber>123-100</docnumber>
|
1103
|
+
<contributor>
|
1104
|
+
<role type='publisher'/>
|
1105
|
+
<organization>
|
1106
|
+
<name>International Organization for Standardization</name>
|
1107
|
+
<abbreviation>ISO</abbreviation>
|
1108
|
+
</organization>
|
1109
|
+
</contributor>
|
1110
|
+
</bibitem>
|
1111
|
+
<bibitem id='ref3' type='standard'>
|
1112
|
+
<title format='text/plain'>Standard IEC 123</title>
|
1113
|
+
<docidentifier>IEC 123</docidentifier>
|
1114
|
+
<docnumber>123</docnumber>
|
1115
|
+
<contributor>
|
1116
|
+
<role type='publisher'/>
|
1117
|
+
<organization>
|
1118
|
+
<name>International Electrotechnical Commission</name>
|
1119
|
+
<abbreviation>IEC</abbreviation>
|
1120
|
+
</organization>
|
1121
|
+
</contributor>
|
1122
|
+
</bibitem>
|
1123
|
+
<bibitem id='ref4'>
|
1124
|
+
<formattedref format='application/x-isodoc+xml'>
|
1125
|
+
<em>Standard GB 123</em>
|
1126
|
+
</formattedref>
|
1127
|
+
<docidentifier>GB 123</docidentifier>
|
1128
|
+
<docnumber>123</docnumber>
|
1129
|
+
</bibitem>
|
1130
|
+
<bibitem id='ref5'>
|
1131
|
+
<formattedref format='application/x-isodoc+xml'>
|
1132
|
+
<em>Standard 10</em>
|
1133
|
+
</formattedref>
|
1134
|
+
<docidentifier type='metanorma'>[7]</docidentifier>
|
1135
|
+
</bibitem>
|
1136
|
+
<bibitem id='ref7'>
|
1137
|
+
<formattedref format='application/x-isodoc+xml'>
|
1138
|
+
<em>Standard 30</em>
|
1139
|
+
</formattedref>
|
1140
|
+
<docidentifier type='metanorma'>[A]</docidentifier>
|
1141
|
+
</bibitem>
|
1142
|
+
<bibitem id='ref6'>
|
1143
|
+
<formattedref format='application/x-isodoc+xml'>
|
1144
|
+
<em>Standard 20</em>
|
1145
|
+
</formattedref>
|
1146
|
+
<docidentifier type='metanorma'>[B]</docidentifier>
|
1147
|
+
</bibitem>
|
1148
|
+
</references>
|
1149
|
+
<references id='_' normative='false' obligation='informative'>
|
1150
|
+
<bibitem id='ref11' type='standard'>
|
1151
|
+
<title format='text/plain'>Standard ISO 123</title>
|
1152
|
+
<docidentifier>ISO 123</docidentifier>
|
1153
|
+
<docnumber>123</docnumber>
|
1154
|
+
<contributor>
|
1155
|
+
<role type='publisher'/>
|
1156
|
+
<organization>
|
1157
|
+
<name>International Organization for Standardization</name>
|
1158
|
+
<abbreviation>ISO</abbreviation>
|
1159
|
+
</organization>
|
1160
|
+
</contributor>
|
1161
|
+
</bibitem>
|
1162
|
+
<bibitem id='ref10' type='standard'>
|
1163
|
+
<title format='text/plain'>Standard ISO/IEC 123</title>
|
1164
|
+
<docidentifier>ISO/IEC 123</docidentifier>
|
1165
|
+
<docnumber>123</docnumber>
|
1166
|
+
<contributor>
|
1167
|
+
<role type='publisher'/>
|
1168
|
+
<organization>
|
1169
|
+
<name>International Organization for Standardization</name>
|
1170
|
+
<abbreviation>ISO</abbreviation>
|
1171
|
+
</organization>
|
1172
|
+
</contributor>
|
1173
|
+
<contributor>
|
1174
|
+
<role type='publisher'/>
|
1175
|
+
<organization>
|
1176
|
+
<name>International Electrotechnical Commission</name>
|
1177
|
+
<abbreviation>IEC</abbreviation>
|
1178
|
+
</organization>
|
1179
|
+
</contributor>
|
1180
|
+
</bibitem>
|
1181
|
+
<bibitem id='ref13' type='standard'>
|
1182
|
+
<title format='text/plain'>Standard IEC 123</title>
|
1183
|
+
<docidentifier>IEC 123</docidentifier>
|
1184
|
+
<docnumber>123</docnumber>
|
1185
|
+
<contributor>
|
1186
|
+
<role type='publisher'/>
|
1187
|
+
<organization>
|
1188
|
+
<name>International Electrotechnical Commission</name>
|
1189
|
+
<abbreviation>IEC</abbreviation>
|
1190
|
+
</organization>
|
1191
|
+
</contributor>
|
1192
|
+
</bibitem>
|
1193
|
+
<bibitem id='ref14'>
|
1194
|
+
<formattedref format='application/x-isodoc+xml'>
|
1195
|
+
<em>Standard GB 123</em>
|
1196
|
+
</formattedref>
|
1197
|
+
<docidentifier>GB 123</docidentifier>
|
1198
|
+
<docnumber>123</docnumber>
|
1199
|
+
</bibitem>
|
1200
|
+
<bibitem id='ref15'>
|
1201
|
+
<formattedref format='application/x-isodoc+xml'>
|
1202
|
+
<em>Standard 10</em>
|
1203
|
+
</formattedref>
|
1204
|
+
<docidentifier type='metanorma'>[14]</docidentifier>
|
1205
|
+
</bibitem>
|
1206
|
+
<bibitem id='ref17'>
|
1207
|
+
<formattedref format='application/x-isodoc+xml'>
|
1208
|
+
<em>Standard 30</em>
|
1209
|
+
</formattedref>
|
1210
|
+
<docidentifier type='metanorma'>[A]</docidentifier>
|
1211
|
+
</bibitem>
|
1212
|
+
<bibitem id='ref16'>
|
1213
|
+
<formattedref format='application/x-isodoc+xml'>
|
1214
|
+
<em>Standard 20</em>
|
1215
|
+
</formattedref>
|
1216
|
+
<docidentifier type='metanorma'>[B]</docidentifier>
|
1217
|
+
</bibitem>
|
1218
|
+
</references>
|
1219
|
+
</clause>
|
1220
|
+
</bibliography>
|
1221
|
+
</iso-standard>
|
1222
1222
|
OUTPUT
|
1223
1223
|
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1224
1224
|
.to be_equivalent_to xmlpp(output)
|
@@ -73,7 +73,7 @@ RSpec.describe Metanorma::ISO do
|
|
73
73
|
[loweralpha]
|
74
74
|
. First
|
75
75
|
. Second
|
76
|
-
[upperalpha]
|
76
|
+
[upperalpha,start=4]
|
77
77
|
.. Third
|
78
78
|
.. Fourth
|
79
79
|
. Fifth
|
@@ -117,7 +117,7 @@ RSpec.describe Metanorma::ISO do
|
|
117
117
|
</li>
|
118
118
|
<li>
|
119
119
|
<p id="_">Second</p>
|
120
|
-
<ol id=
|
120
|
+
<ol id='_' start='4'>
|
121
121
|
<li>
|
122
122
|
<p id="_">Third</p>
|
123
123
|
</li>
|
@@ -455,8 +455,8 @@ RSpec.describe Metanorma::ISO do
|
|
455
455
|
|
456
456
|
INPUT
|
457
457
|
output = <<~OUTPUT
|
458
|
-
#{BLANK_HDR.sub(%r{<doctype>
|
459
|
-
'<doctype>
|
458
|
+
#{BLANK_HDR.sub(%r{<doctype>standard</doctype>},
|
459
|
+
'<doctype>standard</doctype><subdoctype>vocabulary</subdoctype>')}
|
460
460
|
<sections>
|
461
461
|
<terms id='_' obligation='normative'>
|
462
462
|
<title>Terms and Definitions</title>
|
@@ -150,7 +150,7 @@ RSpec.describe Metanorma::ISO do
|
|
150
150
|
expect(File.read("test.err")).to include "Scope clause missing"
|
151
151
|
end
|
152
152
|
|
153
|
-
it "Scope clause not missing
|
153
|
+
it "Scope clause not missing if supplied" do
|
154
154
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
155
155
|
= Document title
|
156
156
|
Author
|
@@ -164,7 +164,7 @@ RSpec.describe Metanorma::ISO do
|
|
164
164
|
expect(File.read("test.err")).not_to include "Scope clause missing"
|
165
165
|
end
|
166
166
|
|
167
|
-
it "Scope clause not missing
|
167
|
+
it "Scope clause not missing in amendments" do
|
168
168
|
FileUtils.rm_f "test.err"
|
169
169
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
170
170
|
= Document title
|
@@ -196,7 +196,7 @@ RSpec.describe Metanorma::ISO do
|
|
196
196
|
expect(File.read("test.err")).to include "Normative references missing"
|
197
197
|
end
|
198
198
|
|
199
|
-
it "Normative references not missing
|
199
|
+
it "Normative references not missing if supplied" do
|
200
200
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
201
201
|
= Document title
|
202
202
|
Author
|
@@ -212,7 +212,7 @@ RSpec.describe Metanorma::ISO do
|
|
212
212
|
.not_to include "Normative references missing"
|
213
213
|
end
|
214
214
|
|
215
|
-
it "Normative references not missing
|
215
|
+
it "Normative references not missing in amendments" do
|
216
216
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
217
217
|
= Document title
|
218
218
|
Author
|
@@ -243,7 +243,7 @@ RSpec.describe Metanorma::ISO do
|
|
243
243
|
expect(File.read("test.err")).to include "Terms & definitions missing"
|
244
244
|
end
|
245
245
|
|
246
|
-
it "Terms & definitions not missing
|
246
|
+
it "Terms & definitions not missing if supplied" do
|
247
247
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
248
248
|
= Document title
|
249
249
|
Author
|
@@ -258,7 +258,7 @@ RSpec.describe Metanorma::ISO do
|
|
258
258
|
expect(File.read("test.err")).not_to include "Terms & definitions missing"
|
259
259
|
end
|
260
260
|
|
261
|
-
it "Terms & definitions not missing
|
261
|
+
it "Terms & definitions not missing in amendment" do
|
262
262
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
263
263
|
= Document title
|
264
264
|
Author
|
@@ -1699,6 +1699,7 @@ RSpec.describe Metanorma::ISO do
|
|
1699
1699
|
:docfile: test.adoc
|
1700
1700
|
:nodoc:
|
1701
1701
|
:technical-committee-type: X
|
1702
|
+
:technical-committee-number: X
|
1702
1703
|
:no-isobib:
|
1703
1704
|
|
1704
1705
|
INPUT
|
@@ -1712,19 +1713,7 @@ RSpec.describe Metanorma::ISO do
|
|
1712
1713
|
:docfile: test.adoc
|
1713
1714
|
:nodoc:
|
1714
1715
|
:subcommittee-type: X
|
1715
|
-
:
|
1716
|
-
|
1717
|
-
INPUT
|
1718
|
-
expect(File.read("test.err")).to include "invalid subcommittee type"
|
1719
|
-
end
|
1720
|
-
|
1721
|
-
it "Warning if invalid subcommittee type" do
|
1722
|
-
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1723
|
-
= Document title
|
1724
|
-
Author
|
1725
|
-
:docfile: test.adoc
|
1726
|
-
:nodoc:
|
1727
|
-
:subcommittee-type: X
|
1716
|
+
:subcommittee-number: X
|
1728
1717
|
:no-isobib:
|
1729
1718
|
|
1730
1719
|
INPUT
|
data/spec/spec_helper.rb
CHANGED
@@ -47,7 +47,7 @@ RSpec.configure do |config|
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def strip_guid(xml)
|
50
|
-
xml.gsub(%r{ id="_[^"]+"}, ' id="_"')
|
50
|
+
xml.gsub(%r{ id=['"]_[^"']+['"]}, ' id="_"')
|
51
51
|
.gsub(%r{ target="_[^"]+"}, ' target="_"')
|
52
52
|
.gsub(%r{ src="cid:[^.]+.gif"}, ' src="_.gif"')
|
53
53
|
.gsub(%r{ src='cid:[^.]+.gif'}, ' src="_.gif"')
|
@@ -151,7 +151,8 @@ BOILERPLATE =
|
|
151
151
|
File.read(ASCIIDOCTOR_ISO_DIR / "boilerplate.xml", encoding: "utf-8")
|
152
152
|
.gsub(/\{\{ agency \}\}/, "ISO")
|
153
153
|
.gsub(/\{\{ docyear \}\}/, Date.today.year.to_s)
|
154
|
-
.gsub(/\{% if unpublished %\}
|
154
|
+
.gsub(/\{% if unpublished %\}.*?\{% endif %\}/m, "")
|
155
|
+
.gsub(/\{% if stage_int >= 40 %\}(.*?)\{% endif %\}/m, "\\1")
|
155
156
|
.gsub(/(?<=\p{Alnum})'(?=\p{Alpha})/, "’"),
|
156
157
|
)
|
157
158
|
|
@@ -160,7 +161,8 @@ BOILERPLATE_FR =
|
|
160
161
|
File.read(ASCIIDOCTOR_ISO_DIR / "boilerplate-fr.xml", encoding: "utf-8")
|
161
162
|
.gsub(/\{\{ agency \}\}/, "ISO")
|
162
163
|
.gsub(/\{\{ docyear \}\}/, Date.today.year.to_s)
|
163
|
-
.gsub(/\{% if unpublished %\}
|
164
|
+
.gsub(/\{% if unpublished %\}.*?\{% endif %\}/m, "")
|
165
|
+
.gsub(/\{% if stage_int >= 40 %\}(.*?)\{% endif %\}/m, "\\1")
|
164
166
|
.gsub(/(?<=\p{Alnum})'(?=\p{Alpha})/, "’"),
|
165
167
|
)
|
166
168
|
|
@@ -198,12 +200,13 @@ BLANK_HDR1 = <<~"HDR".freeze
|
|
198
200
|
</owner>
|
199
201
|
</copyright>
|
200
202
|
<ext>
|
201
|
-
<doctype>
|
203
|
+
<doctype>standard</doctype>
|
202
204
|
<editorialgroup>
|
203
|
-
<
|
204
|
-
<subcommittee/>
|
205
|
-
<workgroup/>
|
205
|
+
<agency>ISO</agency>
|
206
206
|
</editorialgroup>
|
207
|
+
<approvalgroup>
|
208
|
+
<agency>ISO</agency>
|
209
|
+
</approvalgroup>
|
207
210
|
<stagename>International standard</stagename>
|
208
211
|
</ext>
|
209
212
|
</bibdata>
|