metanorma-standoc 1.11.2 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +3 -31
  3. data/.gitignore +23 -0
  4. data/Gemfile +1 -0
  5. data/lib/asciidoctor/standoc/base.rb +2 -241
  6. data/lib/asciidoctor/standoc/blocks.rb +2 -238
  7. data/lib/asciidoctor/standoc/blocks_notes.rb +2 -100
  8. data/lib/asciidoctor/standoc/cleanup.rb +2 -207
  9. data/lib/asciidoctor/standoc/cleanup_amend.rb +2 -53
  10. data/lib/asciidoctor/standoc/cleanup_block.rb +2 -173
  11. data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +2 -212
  12. data/lib/asciidoctor/standoc/cleanup_footnotes.rb +2 -108
  13. data/lib/asciidoctor/standoc/cleanup_image.rb +2 -69
  14. data/lib/asciidoctor/standoc/cleanup_inline.rb +2 -179
  15. data/lib/asciidoctor/standoc/cleanup_maths.rb +2 -221
  16. data/lib/asciidoctor/standoc/cleanup_ref.rb +2 -169
  17. data/lib/asciidoctor/standoc/cleanup_ref_dl.rb +2 -103
  18. data/lib/asciidoctor/standoc/cleanup_reqt.rb +2 -110
  19. data/lib/asciidoctor/standoc/cleanup_section.rb +2 -184
  20. data/lib/asciidoctor/standoc/cleanup_section_names.rb +2 -91
  21. data/lib/asciidoctor/standoc/cleanup_symbols.rb +2 -47
  22. data/lib/asciidoctor/standoc/cleanup_table.rb +2 -67
  23. data/lib/asciidoctor/standoc/cleanup_terms.rb +2 -117
  24. data/lib/asciidoctor/standoc/cleanup_terms_designations.rb +2 -178
  25. data/lib/asciidoctor/standoc/cleanup_text.rb +2 -95
  26. data/lib/asciidoctor/standoc/cleanup_toc.rb +3 -0
  27. data/lib/asciidoctor/standoc/cleanup_xref.rb +2 -106
  28. data/lib/asciidoctor/standoc/converter.rb +2 -123
  29. data/lib/asciidoctor/standoc/datamodel/attributes_table_preprocessor.rb +2 -56
  30. data/lib/asciidoctor/standoc/datamodel/diagram_preprocessor.rb +2 -102
  31. data/lib/asciidoctor/standoc/datamodel/plantuml_renderer.rb +3 -404
  32. data/lib/asciidoctor/standoc/deprecated.rb +5 -0
  33. data/lib/asciidoctor/standoc/front.rb +2 -219
  34. data/lib/asciidoctor/standoc/front_contributor.rb +2 -191
  35. data/lib/asciidoctor/standoc/inline.rb +2 -231
  36. data/lib/asciidoctor/standoc/lists.rb +2 -119
  37. data/lib/asciidoctor/standoc/macros.rb +2 -203
  38. data/lib/asciidoctor/standoc/macros_form.rb +2 -62
  39. data/lib/asciidoctor/standoc/macros_note.rb +2 -44
  40. data/lib/asciidoctor/standoc/macros_plantuml.rb +2 -112
  41. data/lib/asciidoctor/standoc/macros_terms.rb +2 -180
  42. data/lib/asciidoctor/standoc/ref.rb +2 -251
  43. data/lib/asciidoctor/standoc/ref_sect.rb +2 -153
  44. data/lib/asciidoctor/standoc/ref_utility.rb +2 -0
  45. data/lib/asciidoctor/standoc/render.rb +3 -0
  46. data/lib/asciidoctor/standoc/reqt.rb +2 -89
  47. data/lib/asciidoctor/standoc/section.rb +2 -190
  48. data/lib/asciidoctor/standoc/table.rb +2 -84
  49. data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +2 -178
  50. data/lib/asciidoctor/standoc/terms.rb +2 -153
  51. data/lib/asciidoctor/standoc/utils.rb +2 -116
  52. data/lib/asciidoctor/standoc/validate.rb +2 -157
  53. data/lib/asciidoctor/standoc/validate_section.rb +2 -54
  54. data/lib/isodoc/html/htmlstyle.css +44 -29
  55. data/lib/isodoc/html/htmlstyle.scss +17 -12
  56. data/lib/metanorma/standoc/base.rb +163 -0
  57. data/lib/{asciidoctor → metanorma}/standoc/basicdoc.rng +0 -0
  58. data/lib/{asciidoctor → metanorma}/standoc/biblio.rng +0 -0
  59. data/lib/metanorma/standoc/blocks.rb +239 -0
  60. data/lib/metanorma/standoc/blocks_notes.rb +101 -0
  61. data/lib/metanorma/standoc/cleanup.rb +157 -0
  62. data/lib/metanorma/standoc/cleanup_amend.rb +54 -0
  63. data/lib/metanorma/standoc/cleanup_block.rb +173 -0
  64. data/lib/metanorma/standoc/cleanup_boilerplate.rb +213 -0
  65. data/lib/metanorma/standoc/cleanup_footnotes.rb +109 -0
  66. data/lib/metanorma/standoc/cleanup_image.rb +70 -0
  67. data/lib/metanorma/standoc/cleanup_inline.rb +190 -0
  68. data/lib/metanorma/standoc/cleanup_maths.rb +222 -0
  69. data/lib/metanorma/standoc/cleanup_ref.rb +170 -0
  70. data/lib/metanorma/standoc/cleanup_ref_dl.rb +104 -0
  71. data/lib/metanorma/standoc/cleanup_reqt.rb +111 -0
  72. data/lib/metanorma/standoc/cleanup_section.rb +212 -0
  73. data/lib/metanorma/standoc/cleanup_section_names.rb +92 -0
  74. data/lib/metanorma/standoc/cleanup_symbols.rb +48 -0
  75. data/lib/metanorma/standoc/cleanup_table.rb +68 -0
  76. data/lib/metanorma/standoc/cleanup_terms.rb +140 -0
  77. data/lib/metanorma/standoc/cleanup_terms_designations.rb +199 -0
  78. data/lib/metanorma/standoc/cleanup_text.rb +96 -0
  79. data/lib/metanorma/standoc/cleanup_toc.rb +98 -0
  80. data/lib/metanorma/standoc/cleanup_xref.rb +107 -0
  81. data/lib/metanorma/standoc/converter.rb +125 -0
  82. data/lib/metanorma/standoc/datamodel/attributes_table_preprocessor.rb +57 -0
  83. data/lib/metanorma/standoc/datamodel/diagram_preprocessor.rb +103 -0
  84. data/lib/metanorma/standoc/datamodel/plantuml_renderer.rb +409 -0
  85. data/lib/metanorma/standoc/front.rb +224 -0
  86. data/lib/metanorma/standoc/front_contributor.rb +192 -0
  87. data/lib/metanorma/standoc/inline.rb +232 -0
  88. data/lib/{asciidoctor → metanorma}/standoc/isodoc.rng +49 -2
  89. data/lib/metanorma/standoc/lists.rb +120 -0
  90. data/lib/metanorma/standoc/macros.rb +204 -0
  91. data/lib/metanorma/standoc/macros_form.rb +63 -0
  92. data/lib/metanorma/standoc/macros_note.rb +45 -0
  93. data/lib/metanorma/standoc/macros_plantuml.rb +113 -0
  94. data/lib/metanorma/standoc/macros_terms.rb +194 -0
  95. data/lib/metanorma/standoc/ref.rb +243 -0
  96. data/lib/metanorma/standoc/ref_sect.rb +153 -0
  97. data/lib/{asciidoctor/standoc/ref_date_id.rb → metanorma/standoc/ref_utility.rb} +43 -5
  98. data/lib/metanorma/standoc/render.rb +115 -0
  99. data/lib/metanorma/standoc/reqt.rb +90 -0
  100. data/lib/{asciidoctor → metanorma}/standoc/reqt.rng +0 -0
  101. data/lib/metanorma/standoc/section.rb +209 -0
  102. data/lib/metanorma/standoc/table.rb +85 -0
  103. data/lib/metanorma/standoc/term_lookup_cleanup.rb +179 -0
  104. data/lib/metanorma/standoc/terms.rb +160 -0
  105. data/lib/metanorma/standoc/utils.rb +101 -0
  106. data/lib/metanorma/standoc/validate.rb +158 -0
  107. data/lib/metanorma/standoc/validate_section.rb +55 -0
  108. data/lib/metanorma/standoc/version.rb +1 -1
  109. data/lib/{asciidoctor → metanorma}/standoc/views/datamodel/model_representation.adoc.erb +0 -0
  110. data/lib/{asciidoctor → metanorma}/standoc/views/datamodel/plantuml_representation.adoc.erb +0 -0
  111. data/lib/metanorma-standoc.rb +1 -1
  112. data/metanorma-standoc.gemspec +2 -2
  113. data/spec/{asciidoctor → metanorma}/base_spec.rb +499 -407
  114. data/spec/{asciidoctor → metanorma}/blank_spec.rb +1 -1
  115. data/spec/{asciidoctor → metanorma}/blocks_spec.rb +34 -5
  116. data/spec/{asciidoctor → metanorma}/cleanup_blocks_spec.rb +25 -1
  117. data/spec/{asciidoctor → metanorma}/cleanup_sections_spec.rb +1 -1
  118. data/spec/{asciidoctor → metanorma}/cleanup_spec.rb +5 -5
  119. data/spec/{asciidoctor → metanorma}/cleanup_terms_spec.rb +281 -29
  120. data/spec/{asciidoctor → metanorma}/datamodel/attributes_table_preprocessor_spec.rb +1 -1
  121. data/spec/{asciidoctor → metanorma}/datamodel/diagram_preprocessor_spec.rb +1 -1
  122. data/spec/{asciidoctor → metanorma}/inline_spec.rb +170 -1
  123. data/spec/{asciidoctor → metanorma}/isobib_cache_spec.rb +1 -1
  124. data/spec/{asciidoctor → metanorma}/lists_spec.rb +1 -1
  125. data/spec/{asciidoctor → metanorma}/macros_json2text_spec.rb +0 -0
  126. data/spec/{asciidoctor → metanorma}/macros_plantuml_spec.rb +3 -3
  127. data/spec/{asciidoctor → metanorma}/macros_spec.rb +8 -6
  128. data/spec/{asciidoctor → metanorma}/macros_yaml2text_spec.rb +0 -0
  129. data/spec/metanorma/refs_dl_spec.rb +863 -0
  130. data/spec/{asciidoctor → metanorma}/refs_spec.rb +522 -15
  131. data/spec/{asciidoctor → metanorma}/section_spec.rb +88 -1
  132. data/spec/{asciidoctor → metanorma}/table_spec.rb +1 -1
  133. data/spec/{asciidoctor → metanorma}/validate_spec.rb +2 -2
  134. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +53 -53
  135. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +14 -14
  136. data/spec/vcr_cassettes/hide_refs.yml +599 -0
  137. data/spec/vcr_cassettes/isobib_get_123.yml +14 -14
  138. data/spec/vcr_cassettes/isobib_get_123_1.yml +99 -99
  139. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +109 -109
  140. data/spec/vcr_cassettes/isobib_get_123_2001.yml +13 -13
  141. data/spec/vcr_cassettes/isobib_get_124.yml +12 -12
  142. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +14 -14
  143. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +46 -46
  144. metadata +87 -35
  145. data/spec/asciidoctor/refs_dl_spec.rb +0 -864
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
  require "relaton_iso"
3
3
  require "relaton_ietf"
4
4
 
5
- RSpec.describe Asciidoctor::Standoc do
5
+ RSpec.describe Metanorma::Standoc do
6
6
  it "processes simple ISO reference" do
7
7
  input = <<~INPUT
8
8
  #{ASCIIDOC_BLANK_HDR}
@@ -735,7 +735,8 @@ RSpec.describe Asciidoctor::Standoc do
735
735
  end
736
736
 
737
737
  it "processes dated ISO reference and joint ISO/IEC references" do
738
- VCR.use_cassette("dated_iso_ref_joint_iso_iec", match_requests_on: %i[method uri body]) do
738
+ VCR.use_cassette("dated_iso_ref_joint_iso_iec",
739
+ match_requests_on: %i[method uri body]) do
739
740
  input = <<~INPUT
740
741
  #{ISOBIB_BLANK_HDR}
741
742
  [bibliography]
@@ -969,8 +970,9 @@ RSpec.describe Asciidoctor::Standoc do
969
970
  <formattedref format='application/x-isodoc+xml'>
970
971
  <em>Standard</em>
971
972
  </formattedref>
972
- <docidentifier type='ISO'>ISO/IEC TR 12382:1992</docidentifier>
973
- <docnumber>12382:1992</docnumber>
973
+ <docidentifier type='ISO'>ISO/IEC TR 12382</docidentifier>
974
+ <docnumber>12382</docnumber>
975
+ <date type='published'><on>1992</on></date>
974
976
  </bibitem>
975
977
  <bibitem id='iso124' type='standard'>
976
978
  <fetched/>
@@ -1024,6 +1026,451 @@ RSpec.describe Asciidoctor::Standoc do
1024
1026
  end
1025
1027
  end
1026
1028
 
1029
+ it "hides individual references" do
1030
+ VCR.use_cassette "hide_refs",
1031
+ match_requests_on: %i[method uri body] do
1032
+ input = <<~INPUT
1033
+ #{ISOBIB_BLANK_HDR}
1034
+ [bibliography]
1035
+ == Normative References
1036
+
1037
+ * [[[iso123,hidden(ISO 124)]]] _Standard_
1038
+ * [[[iso124,ISO 125]]] _Standard_
1039
+
1040
+ [bibliography]
1041
+ == Bibliography
1042
+
1043
+ * [[[iso125,hidden(ISO 125)]]] _Standard_
1044
+ * [[[iso126,hidden(XYZ)]]] _Standard_
1045
+ * [[[iso127,ISO 124]]] _Standard_
1046
+ * [[[iso128,ABC]]] _Standard_
1047
+ INPUT
1048
+ output = <<~OUTPUT
1049
+ #{BLANK_HDR}
1050
+ <sections>
1051
+
1052
+ </sections><bibliography><references id="_" normative="true" obligation="informative" >
1053
+ <title>Normative references</title>
1054
+ #{NORM_REF_BOILERPLATE}
1055
+ <bibitem id='iso123' type='standard' hidden='true'>
1056
+ <fetched/>
1057
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Latex, rubber</title>
1058
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Determination of total solids content</title>
1059
+ <title type='main' format='text/plain' language='en' script='Latn'>Latex, rubber&#8201;&#8212;&#8201;Determination of total solids content</title>
1060
+ <uri type='src'>https://www.iso.org/standard/61884.html</uri>
1061
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:61884:en</uri>
1062
+ <uri type='rss'>https://www.iso.org/contents/data/standard/06/18/61884.detail.rss</uri>
1063
+ <docidentifier type='ISO'>ISO 124</docidentifier>
1064
+ <docidentifier type='URN'>urn:iso:std:iso:124:stage-90.93:ed-7:en</docidentifier>
1065
+ <docnumber>124</docnumber>
1066
+ <contributor>
1067
+ <role type='publisher'/>
1068
+ <organization>
1069
+ <name>International Organization for Standardization</name>
1070
+ <abbreviation>ISO</abbreviation>
1071
+ <uri>www.iso.org</uri>
1072
+ </organization>
1073
+ </contributor>
1074
+ <edition>7</edition>
1075
+ <language>en</language>
1076
+ <script>Latn</script>
1077
+ <status>
1078
+ <stage>90</stage>
1079
+ <substage>93</substage>
1080
+ </status>
1081
+ <copyright>
1082
+ <from>2014</from>
1083
+ <owner>
1084
+ <organization>
1085
+ <name>ISO</name>
1086
+ </organization>
1087
+ </owner>
1088
+ </copyright>
1089
+ <relation type='obsoletes'>
1090
+ <bibitem type='standard'>
1091
+ <formattedref format='text/plain'>ISO 124:2011</formattedref>
1092
+ </bibitem>
1093
+ </relation>
1094
+ <relation type='instance'>
1095
+ <bibitem type='standard'>
1096
+ <fetched/>
1097
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Latex, rubber</title>
1098
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Determination of total solids content</title>
1099
+ <title type='main' format='text/plain' language='en' script='Latn'>Latex, rubber&#8201;&#8212;&#8201;Determination of total solids content</title>
1100
+ <uri type='src'>https://www.iso.org/standard/61884.html</uri>
1101
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:61884:en</uri>
1102
+ <uri type='rss'>https://www.iso.org/contents/data/standard/06/18/61884.detail.rss</uri>
1103
+ <docidentifier type='ISO'>ISO 124:2014</docidentifier>
1104
+ <docidentifier type='URN'>urn:iso:std:iso:124:stage-90.93:ed-7:en</docidentifier>
1105
+ <docnumber>124</docnumber>
1106
+ <date type='published'>
1107
+ <on>2014-03</on>
1108
+ </date>
1109
+ <contributor>
1110
+ <role type='publisher'/>
1111
+ <organization>
1112
+ <name>International Organization for Standardization</name>
1113
+ <abbreviation>ISO</abbreviation>
1114
+ <uri>www.iso.org</uri>
1115
+ </organization>
1116
+ </contributor>
1117
+ <edition>7</edition>
1118
+ <language>en</language>
1119
+ <script>Latn</script>
1120
+ <abstract format='text/plain' language='en' script='Latn'>
1121
+ ISO 124:2014 specifies methods for the determination of the total
1122
+ solids content of natural rubber field and concentrated latices
1123
+ and synthetic rubber latex. These methods are not necessarily
1124
+ suitable for latex from natural sources other than the Hevea
1125
+ brasiliensis, for vulcanized latex, for compounded latex, or for
1126
+ artificial dispersions of rubber.
1127
+ </abstract>
1128
+ <status>
1129
+ <stage>90</stage>
1130
+ <substage>93</substage>
1131
+ </status>
1132
+ <copyright>
1133
+ <from>2014</from>
1134
+ <owner>
1135
+ <organization>
1136
+ <name>ISO</name>
1137
+ </organization>
1138
+ </owner>
1139
+ </copyright>
1140
+ <relation type='obsoletes'>
1141
+ <bibitem type='standard'>
1142
+ <formattedref format='text/plain'>ISO 124:2011</formattedref>
1143
+ </bibitem>
1144
+ </relation>
1145
+ <place>Geneva</place>
1146
+ </bibitem>
1147
+ </relation>
1148
+ <place>Geneva</place>
1149
+ </bibitem>
1150
+ <bibitem id='iso124' type='standard'>
1151
+ <fetched/>
1152
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Natural rubber latex concentrate</title>
1153
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Determination of alkalinity</title>
1154
+ <title type='main' format='text/plain' language='en' script='Latn'>
1155
+ Natural rubber latex concentrate&#8201;&#8212;&#8201;Determination of
1156
+ alkalinity
1157
+ </title>
1158
+ <uri type='src'>https://www.iso.org/standard/72849.html</uri>
1159
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:72849:en</uri>
1160
+ <uri type='rss'>https://www.iso.org/contents/data/standard/07/28/72849.detail.rss</uri>
1161
+ <docidentifier type='ISO'>ISO 125</docidentifier>
1162
+ <docidentifier type='URN'>urn:iso:std:iso:125:stage-60.60:ed-7:en</docidentifier>
1163
+ <docnumber>125</docnumber>
1164
+ <contributor>
1165
+ <role type='publisher'/>
1166
+ <organization>
1167
+ <name>International Organization for Standardization</name>
1168
+ <abbreviation>ISO</abbreviation>
1169
+ <uri>www.iso.org</uri>
1170
+ </organization>
1171
+ </contributor>
1172
+ <edition>7</edition>
1173
+ <language>en</language>
1174
+ <script>Latn</script>
1175
+ <status>
1176
+ <stage>60</stage>
1177
+ <substage>60</substage>
1178
+ </status>
1179
+ <copyright>
1180
+ <from>2020</from>
1181
+ <owner>
1182
+ <organization>
1183
+ <name>ISO</name>
1184
+ </organization>
1185
+ </owner>
1186
+ </copyright>
1187
+ <relation type='obsoletes'>
1188
+ <bibitem type='standard'>
1189
+ <formattedref format='text/plain'>ISO 125:2011</formattedref>
1190
+ </bibitem>
1191
+ </relation>
1192
+ <relation type='instance'>
1193
+ <bibitem type='standard'>
1194
+ <fetched/>
1195
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Natural rubber latex concentrate</title>
1196
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Determination of alkalinity</title>
1197
+ <title type='main' format='text/plain' language='en' script='Latn'>
1198
+ Natural rubber latex concentrate&#8201;&#8212;&#8201;Determination
1199
+ of alkalinity
1200
+ </title>
1201
+ <uri type='src'>https://www.iso.org/standard/72849.html</uri>
1202
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:72849:en</uri>
1203
+ <uri type='rss'>https://www.iso.org/contents/data/standard/07/28/72849.detail.rss</uri>
1204
+ <docidentifier type='ISO'>ISO 125:2020</docidentifier>
1205
+ <docidentifier type='URN'>urn:iso:std:iso:125:stage-60.60:ed-7:en</docidentifier>
1206
+ <docnumber>125</docnumber>
1207
+ <date type='published'>
1208
+ <on>2020-02</on>
1209
+ </date>
1210
+ <contributor>
1211
+ <role type='publisher'/>
1212
+ <organization>
1213
+ <name>International Organization for Standardization</name>
1214
+ <abbreviation>ISO</abbreviation>
1215
+ <uri>www.iso.org</uri>
1216
+ </organization>
1217
+ </contributor>
1218
+ <edition>7</edition>
1219
+ <language>en</language>
1220
+ <script>Latn</script>
1221
+ <abstract format='text/plain' language='en' script='Latn'>
1222
+ This document specifies a method for the determination of the
1223
+ alkalinity of natural rubber latex concentrate. The method is not
1224
+ necessarily suitable for latices from natural sources other than
1225
+ Hevea brasiliensis or for synthetic rubber latices, compounded
1226
+ latex, vulcanized latex or artificial dispersions of rubber. NOTE
1227
+ A method for the determination of the alkalinity of
1228
+ polychloroprene latex is specified in ISO 13773.
1229
+ </abstract>
1230
+ <status>
1231
+ <stage>60</stage>
1232
+ <substage>60</substage>
1233
+ </status>
1234
+ <copyright>
1235
+ <from>2020</from>
1236
+ <owner>
1237
+ <organization>
1238
+ <name>ISO</name>
1239
+ </organization>
1240
+ </owner>
1241
+ </copyright>
1242
+ <relation type='obsoletes'>
1243
+ <bibitem type='standard'>
1244
+ <formattedref format='text/plain'>ISO 125:2011</formattedref>
1245
+ </bibitem>
1246
+ </relation>
1247
+ <place>Geneva</place>
1248
+ </bibitem>
1249
+ </relation>
1250
+ <place>Geneva</place>
1251
+ </bibitem>
1252
+ </references>
1253
+ <references id='_' normative='false' obligation='informative'>
1254
+ <title>Bibliography</title>
1255
+ <bibitem id='iso125' type='standard' hidden='true'>
1256
+ <fetched/>
1257
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Natural rubber latex concentrate</title>
1258
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Determination of alkalinity</title>
1259
+ <title type='main' format='text/plain' language='en' script='Latn'>
1260
+ Natural rubber latex concentrate&#8201;&#8212;&#8201;Determination of
1261
+ alkalinity
1262
+ </title>
1263
+ <uri type='src'>https://www.iso.org/standard/72849.html</uri>
1264
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:72849:en</uri>
1265
+ <uri type='rss'>https://www.iso.org/contents/data/standard/07/28/72849.detail.rss</uri>
1266
+ <docidentifier type='ISO'>ISO 125</docidentifier>
1267
+ <docidentifier type='URN'>urn:iso:std:iso:125:stage-60.60:ed-7:en</docidentifier>
1268
+ <docnumber>125</docnumber>
1269
+ <contributor>
1270
+ <role type='publisher'/>
1271
+ <organization>
1272
+ <name>International Organization for Standardization</name>
1273
+ <abbreviation>ISO</abbreviation>
1274
+ <uri>www.iso.org</uri>
1275
+ </organization>
1276
+ </contributor>
1277
+ <edition>7</edition>
1278
+ <language>en</language>
1279
+ <script>Latn</script>
1280
+ <status>
1281
+ <stage>60</stage>
1282
+ <substage>60</substage>
1283
+ </status>
1284
+ <copyright>
1285
+ <from>2020</from>
1286
+ <owner>
1287
+ <organization>
1288
+ <name>ISO</name>
1289
+ </organization>
1290
+ </owner>
1291
+ </copyright>
1292
+ <relation type='obsoletes'>
1293
+ <bibitem type='standard'>
1294
+ <formattedref format='text/plain'>ISO 125:2011</formattedref>
1295
+ </bibitem>
1296
+ </relation>
1297
+ <relation type='instance'>
1298
+ <bibitem type='standard'>
1299
+ <fetched/>
1300
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Natural rubber latex concentrate</title>
1301
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Determination of alkalinity</title>
1302
+ <title type='main' format='text/plain' language='en' script='Latn'>
1303
+ Natural rubber latex concentrate&#8201;&#8212;&#8201;Determination
1304
+ of alkalinity
1305
+ </title>
1306
+ <uri type='src'>https://www.iso.org/standard/72849.html</uri>
1307
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:72849:en</uri>
1308
+ <uri type='rss'>https://www.iso.org/contents/data/standard/07/28/72849.detail.rss</uri>
1309
+ <docidentifier type='ISO'>ISO 125:2020</docidentifier>
1310
+ <docidentifier type='URN'>urn:iso:std:iso:125:stage-60.60:ed-7:en</docidentifier>
1311
+ <docnumber>125</docnumber>
1312
+ <date type='published'>
1313
+ <on>2020-02</on>
1314
+ </date>
1315
+ <contributor>
1316
+ <role type='publisher'/>
1317
+ <organization>
1318
+ <name>International Organization for Standardization</name>
1319
+ <abbreviation>ISO</abbreviation>
1320
+ <uri>www.iso.org</uri>
1321
+ </organization>
1322
+ </contributor>
1323
+ <edition>7</edition>
1324
+ <language>en</language>
1325
+ <script>Latn</script>
1326
+ <abstract format='text/plain' language='en' script='Latn'>
1327
+ This document specifies a method for the determination of the
1328
+ alkalinity of natural rubber latex concentrate. The method is not
1329
+ necessarily suitable for latices from natural sources other than
1330
+ Hevea brasiliensis or for synthetic rubber latices, compounded
1331
+ latex, vulcanized latex or artificial dispersions of rubber. NOTE
1332
+ A method for the determination of the alkalinity of
1333
+ polychloroprene latex is specified in ISO 13773.
1334
+ </abstract>
1335
+ <status>
1336
+ <stage>60</stage>
1337
+ <substage>60</substage>
1338
+ </status>
1339
+ <copyright>
1340
+ <from>2020</from>
1341
+ <owner>
1342
+ <organization>
1343
+ <name>ISO</name>
1344
+ </organization>
1345
+ </owner>
1346
+ </copyright>
1347
+ <relation type='obsoletes'>
1348
+ <bibitem type='standard'>
1349
+ <formattedref format='text/plain'>ISO 125:2011</formattedref>
1350
+ </bibitem>
1351
+ </relation>
1352
+ <place>Geneva</place>
1353
+ </bibitem>
1354
+ </relation>
1355
+ <place>Geneva</place>
1356
+ </bibitem>
1357
+ <bibitem id='iso126' hidden='true'>
1358
+ <formattedref format='application/x-isodoc+xml'>
1359
+ <em>Standard</em>
1360
+ </formattedref>
1361
+ <docidentifier>XYZ</docidentifier>
1362
+ </bibitem>
1363
+ <bibitem id='iso127' type='standard'>
1364
+ <fetched/>
1365
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Latex, rubber</title>
1366
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Determination of total solids content</title>
1367
+ <title type='main' format='text/plain' language='en' script='Latn'>Latex, rubber&#8201;&#8212;&#8201;Determination of total solids content</title>
1368
+ <uri type='src'>https://www.iso.org/standard/61884.html</uri>
1369
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:61884:en</uri>
1370
+ <uri type='rss'>https://www.iso.org/contents/data/standard/06/18/61884.detail.rss</uri>
1371
+ <docidentifier type='ISO'>ISO 124</docidentifier>
1372
+ <docidentifier type='URN'>urn:iso:std:iso:124:stage-90.93:ed-7:en</docidentifier>
1373
+ <docnumber>124</docnumber>
1374
+ <contributor>
1375
+ <role type='publisher'/>
1376
+ <organization>
1377
+ <name>International Organization for Standardization</name>
1378
+ <abbreviation>ISO</abbreviation>
1379
+ <uri>www.iso.org</uri>
1380
+ </organization>
1381
+ </contributor>
1382
+ <edition>7</edition>
1383
+ <language>en</language>
1384
+ <script>Latn</script>
1385
+ <status>
1386
+ <stage>90</stage>
1387
+ <substage>93</substage>
1388
+ </status>
1389
+ <copyright>
1390
+ <from>2014</from>
1391
+ <owner>
1392
+ <organization>
1393
+ <name>ISO</name>
1394
+ </organization>
1395
+ </owner>
1396
+ </copyright>
1397
+ <relation type='obsoletes'>
1398
+ <bibitem type='standard'>
1399
+ <formattedref format='text/plain'>ISO 124:2011</formattedref>
1400
+ </bibitem>
1401
+ </relation>
1402
+ <relation type='instance'>
1403
+ <bibitem type='standard'>
1404
+ <fetched/>
1405
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Latex, rubber</title>
1406
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Determination of total solids content</title>
1407
+ <title type='main' format='text/plain' language='en' script='Latn'>Latex, rubber&#8201;&#8212;&#8201;Determination of total solids content</title>
1408
+ <uri type='src'>https://www.iso.org/standard/61884.html</uri>
1409
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:61884:en</uri>
1410
+ <uri type='rss'>https://www.iso.org/contents/data/standard/06/18/61884.detail.rss</uri>
1411
+ <docidentifier type='ISO'>ISO 124:2014</docidentifier>
1412
+ <docidentifier type='URN'>urn:iso:std:iso:124:stage-90.93:ed-7:en</docidentifier>
1413
+ <docnumber>124</docnumber>
1414
+ <date type='published'>
1415
+ <on>2014-03</on>
1416
+ </date>
1417
+ <contributor>
1418
+ <role type='publisher'/>
1419
+ <organization>
1420
+ <name>International Organization for Standardization</name>
1421
+ <abbreviation>ISO</abbreviation>
1422
+ <uri>www.iso.org</uri>
1423
+ </organization>
1424
+ </contributor>
1425
+ <edition>7</edition>
1426
+ <language>en</language>
1427
+ <script>Latn</script>
1428
+ <abstract format='text/plain' language='en' script='Latn'>
1429
+ ISO 124:2014 specifies methods for the determination of the total
1430
+ solids content of natural rubber field and concentrated latices
1431
+ and synthetic rubber latex. These methods are not necessarily
1432
+ suitable for latex from natural sources other than the Hevea
1433
+ brasiliensis, for vulcanized latex, for compounded latex, or for
1434
+ artificial dispersions of rubber.
1435
+ </abstract>
1436
+ <status>
1437
+ <stage>90</stage>
1438
+ <substage>93</substage>
1439
+ </status>
1440
+ <copyright>
1441
+ <from>2014</from>
1442
+ <owner>
1443
+ <organization>
1444
+ <name>ISO</name>
1445
+ </organization>
1446
+ </owner>
1447
+ </copyright>
1448
+ <relation type='obsoletes'>
1449
+ <bibitem type='standard'>
1450
+ <formattedref format='text/plain'>ISO 124:2011</formattedref>
1451
+ </bibitem>
1452
+ </relation>
1453
+ <place>Geneva</place>
1454
+ </bibitem>
1455
+ </relation>
1456
+ <place>Geneva</place>
1457
+ </bibitem>
1458
+ <bibitem id='iso128'>
1459
+ <formattedref format='application/x-isodoc+xml'>
1460
+ <em>Standard</em>
1461
+ </formattedref>
1462
+ <docidentifier>ABC</docidentifier>
1463
+ </bibitem>
1464
+ </references>
1465
+ </bibliography>
1466
+ </standard-document>
1467
+ OUTPUT
1468
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1469
+ .to be_equivalent_to xmlpp(output)
1470
+ end
1471
+ end
1472
+
1473
+
1027
1474
  it "processes draft ISO reference" do
1028
1475
  # stub_fetch_ref no_year: true, note: "The standard is in press"
1029
1476
 
@@ -1111,8 +1558,6 @@ RSpec.describe Asciidoctor::Standoc do
1111
1558
  end
1112
1559
 
1113
1560
  it "processes all-parts ISO reference" do
1114
- # stub_fetch_ref(all_parts: true)
1115
-
1116
1561
  input = <<~INPUT
1117
1562
  #{ASCIIDOC_BLANK_HDR}
1118
1563
  [bibliography]
@@ -1170,8 +1615,29 @@ RSpec.describe Asciidoctor::Standoc do
1170
1615
  .to be_equivalent_to xmlpp(output)
1171
1616
  end
1172
1617
 
1618
+ it "processes BSI reference with year" do
1619
+ VCR.use_cassette("bsi16341",
1620
+ match_requests_on: %i[method uri body]) do
1621
+ input = <<~INPUT
1622
+ #{ISOBIB_BLANK_HDR}
1623
+ [bibliography]
1624
+ == Normative References
1625
+
1626
+ * [[[iso124,BSI BS EN ISO 19011:2018]]] _Standard_
1627
+ * [[[iso123,BSI BS EN 16341]]] _Standard_
1628
+ * [[[ref_2,BSI BS EN ISO 14044:2006+A1:2020]]], _Environmental management – Life cycle assessment – Requirements and guidelines_
1629
+ INPUT
1630
+ output = Nokogiri::XML(Asciidoctor.convert(input, *OPTIONS))
1631
+ .xpath("//xmlns:docidentifier[@type = 'BSI']").map(&:text)
1632
+ expect(output).to include("BS EN ISO 14044:2006+A2:2020")
1633
+ expect(output).to include("BS EN 16341:2012")
1634
+ expect(output).to include("BS EN 16341")
1635
+ expect(output).not_to include("BS EN ISO 19011")
1636
+ expect(output).to include("BS EN ISO 19011:2018")
1637
+ end
1638
+ end
1639
+
1173
1640
  it "processes RFC reference in Normative References" do
1174
- # mock_rfcbib_get_rfc8341
1175
1641
  VCR.use_cassette "rfcbib_get_rfc8341" do
1176
1642
  input = <<~INPUT
1177
1643
  #{ISOBIB_BLANK_HDR}
@@ -1205,7 +1671,7 @@ RSpec.describe Asciidoctor::Standoc do
1205
1671
  </uri>
1206
1672
  <uri type='src'>https://www.rfc-editor.org/info/rfc8341</uri>
1207
1673
  <docidentifier type='IETF'>RFC 8341</docidentifier>
1208
- <docidentifier type='rfc-anchor'>RFC8341</docidentifier>
1674
+ <docidentifier type='IETF' scope='anchor'>RFC8341</docidentifier>
1209
1675
  <docidentifier type='DOI'>10.17487/RFC8341</docidentifier>
1210
1676
  <docnumber>RFC8341</docnumber>
1211
1677
  <date type='published'>
@@ -1267,7 +1733,7 @@ RSpec.describe Asciidoctor::Standoc do
1267
1733
  <uri type='src'>https://www.rfc-editor.org/info/rfc8341</uri>
1268
1734
  <docidentifier type='IETF'>RFC 8341</docidentifier>
1269
1735
  <docidentifier type='metanorma'>[1]</docidentifier>
1270
- <docidentifier type='rfc-anchor'>RFC8341</docidentifier>
1736
+ <docidentifier type='IETF' scope='anchor'>RFC8341</docidentifier>
1271
1737
  <docidentifier type='DOI'>10.17487/RFC8341</docidentifier>
1272
1738
  <docnumber>RFC8341</docnumber>
1273
1739
  <date type='published'>
@@ -1335,8 +1801,8 @@ RSpec.describe Asciidoctor::Standoc do
1335
1801
  [bibliography]
1336
1802
  == Normative References
1337
1803
 
1338
- * [[[iso123,XYZ 123:1066 (all parts)]]] _Standard_
1339
- * [[[iso124,(1)XYZ 123:1066 (all parts)]]] _Standard_
1804
+ * [[[iso123,XYZ 123:1966 (all parts)]]] _Standard_
1805
+ * [[[iso124,(1)XYZ 123:1966]]] _Standard_
1340
1806
  INPUT
1341
1807
  output = <<~OUTPUT
1342
1808
  #{BLANK_HDR}
@@ -1348,16 +1814,20 @@ RSpec.describe Asciidoctor::Standoc do
1348
1814
  <formattedref format="application/x-isodoc+xml">
1349
1815
  <em>Standard</em>
1350
1816
  </formattedref>
1351
- <docidentifier>XYZ 123:1066 (all parts)</docidentifier>
1352
- <docnumber>123:1066 (all parts)</docnumber>
1817
+ <docidentifier>XYZ 123:1966 (all parts)</docidentifier>
1818
+ <docnumber>123:1966 (all parts)</docnumber>
1819
+ <date type='published'><on>1966</on></date>
1353
1820
  </bibitem>
1354
1821
  <bibitem id='iso124'>
1355
1822
  <formattedref format='application/x-isodoc+xml'>
1356
1823
  <em>Standard</em>
1357
1824
  </formattedref>
1358
1825
  <docidentifier type='metanorma'>[1]</docidentifier>
1359
- <docidentifier>XYZ 123:1066 (all parts)</docidentifier>
1360
- <docnumber>123:1066 (all parts)</docnumber>
1826
+ <docidentifier>XYZ 123</docidentifier>
1827
+ <docnumber>123</docnumber>
1828
+ <date type='published'>
1829
+ <on>1966</on>
1830
+ </date>
1361
1831
  </bibitem>
1362
1832
  </references>
1363
1833
  </bibliography>
@@ -1980,6 +2450,43 @@ RSpec.describe Asciidoctor::Standoc do
1980
2450
  end
1981
2451
  end
1982
2452
 
2453
+ it "processes formatting within bibliographic references" do
2454
+ VCR.use_cassette "isobib_get_123_1" do
2455
+ input = <<~INPUT
2456
+ #{ISOBIB_BLANK_HDR}
2457
+ [bibliography]
2458
+ == Normative References
2459
+
2460
+ * [[[reference,ISO 123]]] _Standard_
2461
+
2462
+ == Section
2463
+
2464
+ <<reference,_reference_>>
2465
+ <<reference,_**reference**_>>
2466
+ <<reference,_A_ stem:[x^2]>>
2467
+ <<reference,_A_ footnote:[_B_]>>
2468
+ <<reference,clause=3.4.2, ISO 9000:2005 footnote:[Superseded by ISO 9000:2015.]>>
2469
+
2470
+ INPUT
2471
+ output = <<~OUTPUT
2472
+ #{BLANK_HDR}
2473
+ <sections>
2474
+ <clause id="_" inline-header="false" obligation="normative">
2475
+ <title>Section</title>
2476
+ <p id="_"><eref type="inline" bibitemid="reference" citeas="ISO 123"><em>reference</em></eref>
2477
+ <eref type="inline" bibitemid="reference" citeas="ISO 123"><em><strong>reference</strong></em></eref>
2478
+ <eref type="inline" bibitemid="reference" citeas="ISO 123"><em>A</em> <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msup><mrow><mi>x</mi></mrow><mrow><mn>2</mn></mrow></msup></math></stem></eref>
2479
+ <eref type="inline" bibitemid="reference" citeas="ISO 123"><em>A</em><fn reference="1"><p id="_"><em>B</em></p></fn></eref>
2480
+ <eref type="inline" bibitemid="reference" citeas="ISO 123"><localityStack><locality type="clause"><referenceFrom>3.4.2</referenceFrom></locality></localityStack>ISO 9000:2005<fn reference="2"><p id="_">Superseded by ISO 9000:2015.</p></fn></eref></p>
2481
+ </clause></sections>
2482
+ </standard-document>
2483
+ OUTPUT
2484
+ a = Nokogiri::XML(Asciidoctor.convert(input, *OPTIONS))
2485
+ a.at("//xmlns:bibliography").remove
2486
+ expect((strip_guid(a.to_xml))).to be_equivalent_to(output)
2487
+ end
2488
+ end
2489
+
1983
2490
  private
1984
2491
 
1985
2492
  def mock_isobib_get_123