metanorma-iso 2.1.1 → 2.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/lib/html2doc/lists.rb +145 -10
  3. data/lib/isodoc/iso/base_convert.rb +10 -0
  4. data/lib/isodoc/iso/html/html_iso_titlepage.html +2 -0
  5. data/lib/isodoc/iso/html/isodoc-dis.css +173 -257
  6. data/lib/isodoc/iso/html/isodoc-dis.scss +173 -249
  7. data/lib/isodoc/iso/html/isodoc.css +38 -13
  8. data/lib/isodoc/iso/html/isodoc.scss +38 -12
  9. data/lib/isodoc/iso/html/style-human.css +14 -1
  10. data/lib/isodoc/iso/html/style-human.scss +10 -1
  11. data/lib/isodoc/iso/html/style-iso.css +35 -23
  12. data/lib/isodoc/iso/html/style-iso.scss +31 -23
  13. data/lib/isodoc/iso/html/word_iso_intro-dis.html +1 -6
  14. data/lib/isodoc/iso/html/word_iso_titlepage-dis.html +24 -13
  15. data/lib/isodoc/iso/html/word_iso_titlepage-prf.html +58 -0
  16. data/lib/isodoc/iso/html/word_iso_titlepage.html +6 -2
  17. data/lib/isodoc/iso/html_convert.rb +5 -0
  18. data/lib/isodoc/iso/i18n-en.yaml +32 -4
  19. data/lib/isodoc/iso/i18n-fr.yaml +29 -3
  20. data/lib/isodoc/iso/i18n-ru.yaml +32 -4
  21. data/lib/isodoc/iso/i18n-zh-Hans.yaml +32 -3
  22. data/lib/isodoc/iso/i18n.rb +1 -1
  23. data/lib/isodoc/iso/iso.amendment.xsl +750 -307
  24. data/lib/isodoc/iso/iso.international-standard.xsl +750 -307
  25. data/lib/isodoc/iso/metadata.rb +63 -63
  26. data/lib/isodoc/iso/presentation_bibdata.rb +74 -0
  27. data/lib/isodoc/iso/presentation_xml_convert.rb +15 -4
  28. data/lib/isodoc/iso/presentation_xref.rb +8 -2
  29. data/lib/isodoc/iso/sections.rb +1 -1
  30. data/lib/isodoc/iso/word_cleanup.rb +3 -0
  31. data/lib/isodoc/iso/word_convert.rb +6 -3
  32. data/lib/isodoc/iso/word_dis_cleanup.rb +243 -0
  33. data/lib/isodoc/iso/word_dis_convert.rb +47 -108
  34. data/lib/isodoc/iso/xref.rb +34 -6
  35. data/lib/metanorma/iso/base.rb +14 -1
  36. data/lib/metanorma/iso/biblio.rng +134 -39
  37. data/lib/metanorma/iso/boilerplate-fr.xml +3 -0
  38. data/lib/metanorma/iso/boilerplate-ru.xml +3 -0
  39. data/lib/metanorma/iso/boilerplate.xml +3 -0
  40. data/lib/metanorma/iso/cleanup.rb +53 -13
  41. data/lib/metanorma/iso/front.rb +38 -6
  42. data/lib/metanorma/iso/front_id.rb +2 -0
  43. data/lib/metanorma/iso/isodoc.rng +32 -0
  44. data/lib/metanorma/iso/isostandard.rng +32 -12
  45. data/lib/metanorma/iso/validate_section.rb +0 -12
  46. data/lib/metanorma/iso/version.rb +1 -1
  47. data/spec/isodoc/amd_spec.rb +4 -30
  48. data/spec/isodoc/blocks_spec.rb +499 -2
  49. data/spec/isodoc/i18n_spec.rb +145 -80
  50. data/spec/isodoc/iso_spec.rb +50 -169
  51. data/spec/isodoc/metadata_spec.rb +223 -83
  52. data/spec/isodoc/postproc_spec.rb +41 -5
  53. data/spec/isodoc/section_spec.rb +9 -9
  54. data/spec/isodoc/word_dis_spec.rb +1332 -146
  55. data/spec/isodoc/xref_spec.rb +87 -13
  56. data/spec/metanorma/amd_spec.rb +39 -23
  57. data/spec/metanorma/base_spec.rb +174 -44
  58. data/spec/metanorma/blocks_spec.rb +21 -0
  59. data/spec/metanorma/cleanup_spec.rb +196 -196
  60. data/spec/metanorma/lists_spec.rb +2 -2
  61. data/spec/metanorma/section_spec.rb +2 -2
  62. data/spec/metanorma/validate_spec.rb +8 -19
  63. data/spec/spec_helper.rb +10 -7
  64. data/spec/vcr_cassettes/withdrawn_iso.yml +30 -30
  65. metadata +6 -8
  66. data/docs/asciiiso-syntax.adoc +0 -307
  67. data/docs/guidance.adoc +0 -487
  68. data/docs/navigation.adoc +0 -23
  69. data/docs/quickstart.adoc +0 -179
  70. 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
- <sections>
1027
- <clause id="_" inline-header="false" obligation="normative">
1028
- <title>Clause 1</title>
1029
- <p id="_">
1030
- <eref bibitemid="ref1" citeas="ISO 123" type="inline"/>
1031
- <eref bibitemid="ref1a" citeas="ISO 123-100" type="inline"/>
1032
- <eref bibitemid="ref1b" citeas="ISO/TS 123-1" type="inline"/>
1033
- <eref bibitemid="ref2" citeas="ISO/IEC 123" type="inline"/>
1034
- <eref bibitemid="ref3" citeas="IEC 123" type="inline"/>
1035
- <eref bibitemid="ref4" citeas="GB 123" type="inline"/>
1036
- <eref bibitemid="ref5" citeas="[6]" type="inline"/>
1037
- <eref bibitemid="ref6" citeas="[B]" type="inline"/>
1038
- <eref bibitemid="ref7" citeas="[A]" type="inline"/>
1039
- <xref target="ref8"/>
1040
- <xref target="ref9"/>
1041
- <eref bibitemid="ref10" citeas="ISO/IEC 123" type="inline"/>
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="ref5">
1124
- <formattedref format="application/x-isodoc+xml">
1125
- <em>Standard 10</em>
1126
- </formattedref>
1127
- <docidentifier type="metanorma">[6]</docidentifier>
1128
- </bibitem>
1129
- <bibitem id="ref6">
1130
- <formattedref format="application/x-isodoc+xml">
1131
- <em>Standard 20</em>
1132
- </formattedref>
1133
- <docidentifier type="metanorma">[B]</docidentifier>
1134
- </bibitem>
1135
- <bibitem id="ref7">
1136
- <formattedref format="application/x-isodoc+xml">
1137
- <em>Standard 30</em>
1138
- </formattedref>
1139
- <docidentifier type="metanorma">[A]</docidentifier>
1140
- </bibitem>
1141
- <bibitem id="ref4">
1142
- <formattedref format="application/x-isodoc+xml">
1143
- <em>Standard GB 123</em>
1144
- </formattedref>
1145
- <docidentifier>GB 123</docidentifier>
1146
- <docnumber>123</docnumber>
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="ref15">
1194
- <formattedref format="application/x-isodoc+xml">
1195
- <em>Standard 10</em>
1196
- </formattedref>
1197
- <docidentifier type="metanorma">[13]</docidentifier>
1198
- </bibitem>
1199
- <bibitem id="ref16">
1200
- <formattedref format="application/x-isodoc+xml">
1201
- <em>Standard 20</em>
1202
- </formattedref>
1203
- <docidentifier type="metanorma">[B]</docidentifier>
1204
- </bibitem>
1205
- <bibitem id="ref17">
1206
- <formattedref format="application/x-isodoc+xml">
1207
- <em>Standard 30</em>
1208
- </formattedref>
1209
- <docidentifier type="metanorma">[A]</docidentifier>
1210
- </bibitem>
1211
- <bibitem id="ref14">
1212
- <formattedref format="application/x-isodoc+xml">
1213
- <em>Standard GB 123</em>
1214
- </formattedref>
1215
- <docidentifier>GB 123</docidentifier>
1216
- <docnumber>123</docnumber>
1217
- </bibitem>
1218
- </references>
1219
- </clause>
1220
- </bibliography>
1221
- </iso-standard>
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>article</doctype>},
459
- '<doctype>article</doctype><subdoctype>vocabulary</subdoctype>')}
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 1" do
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 2" do
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 1" do
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 2" do
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 1" do
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 2" do
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
- :no-isobib:
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 %\}.*\{% endif %\}/m, "")
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 %\}.*\{% endif %\}/m, "")
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>article</doctype>
203
+ <doctype>standard</doctype>
202
204
  <editorialgroup>
203
- <technical-committee/>
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>