metanorma-standoc 1.11.4 → 2.0.0
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 +3 -31
- data/.gitignore +23 -0
- data/lib/asciidoctor/standoc/base.rb +2 -145
- data/lib/asciidoctor/standoc/blocks.rb +2 -238
- data/lib/asciidoctor/standoc/blocks_notes.rb +2 -100
- data/lib/asciidoctor/standoc/cleanup.rb +2 -208
- data/lib/asciidoctor/standoc/cleanup_amend.rb +2 -53
- data/lib/asciidoctor/standoc/cleanup_block.rb +2 -172
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +2 -212
- data/lib/asciidoctor/standoc/cleanup_footnotes.rb +2 -108
- data/lib/asciidoctor/standoc/cleanup_image.rb +2 -69
- data/lib/asciidoctor/standoc/cleanup_inline.rb +2 -189
- data/lib/asciidoctor/standoc/cleanup_maths.rb +2 -221
- data/lib/asciidoctor/standoc/cleanup_ref.rb +2 -169
- data/lib/asciidoctor/standoc/cleanup_ref_dl.rb +2 -103
- data/lib/asciidoctor/standoc/cleanup_reqt.rb +2 -110
- data/lib/asciidoctor/standoc/cleanup_section.rb +2 -184
- data/lib/asciidoctor/standoc/cleanup_section_names.rb +2 -91
- data/lib/asciidoctor/standoc/cleanup_symbols.rb +2 -47
- data/lib/asciidoctor/standoc/cleanup_table.rb +2 -67
- data/lib/asciidoctor/standoc/cleanup_terms.rb +2 -139
- data/lib/asciidoctor/standoc/cleanup_terms_designations.rb +2 -198
- data/lib/asciidoctor/standoc/cleanup_text.rb +2 -95
- data/lib/asciidoctor/standoc/cleanup_toc.rb +3 -0
- data/lib/asciidoctor/standoc/cleanup_xref.rb +2 -106
- data/lib/asciidoctor/standoc/converter.rb +2 -123
- data/lib/asciidoctor/standoc/datamodel/attributes_table_preprocessor.rb +2 -56
- data/lib/asciidoctor/standoc/datamodel/diagram_preprocessor.rb +2 -102
- data/lib/asciidoctor/standoc/datamodel/plantuml_renderer.rb +3 -404
- data/lib/asciidoctor/standoc/deprecated.rb +5 -0
- data/lib/asciidoctor/standoc/front.rb +2 -223
- data/lib/asciidoctor/standoc/front_contributor.rb +2 -191
- data/lib/asciidoctor/standoc/inline.rb +2 -231
- data/lib/asciidoctor/standoc/lists.rb +2 -119
- data/lib/asciidoctor/standoc/macros.rb +2 -203
- data/lib/asciidoctor/standoc/macros_form.rb +2 -62
- data/lib/asciidoctor/standoc/macros_note.rb +2 -44
- data/lib/asciidoctor/standoc/macros_plantuml.rb +2 -112
- data/lib/asciidoctor/standoc/macros_terms.rb +2 -180
- data/lib/asciidoctor/standoc/ref.rb +2 -251
- data/lib/asciidoctor/standoc/ref_sect.rb +2 -153
- data/lib/asciidoctor/standoc/ref_utility.rb +2 -0
- data/lib/asciidoctor/standoc/render.rb +2 -114
- data/lib/asciidoctor/standoc/reqt.rb +2 -89
- data/lib/asciidoctor/standoc/section.rb +2 -207
- data/lib/asciidoctor/standoc/table.rb +2 -84
- data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +2 -178
- data/lib/asciidoctor/standoc/terms.rb +2 -159
- data/lib/asciidoctor/standoc/utils.rb +2 -100
- data/lib/asciidoctor/standoc/validate.rb +2 -157
- data/lib/asciidoctor/standoc/validate_section.rb +2 -54
- data/lib/metanorma/standoc/base.rb +149 -0
- data/lib/{asciidoctor → metanorma}/standoc/basicdoc.rng +0 -0
- data/lib/{asciidoctor → metanorma}/standoc/biblio.rng +0 -0
- data/lib/metanorma/standoc/blocks.rb +239 -0
- data/lib/metanorma/standoc/blocks_notes.rb +101 -0
- data/lib/metanorma/standoc/cleanup.rb +146 -0
- data/lib/metanorma/standoc/cleanup_amend.rb +54 -0
- data/lib/metanorma/standoc/cleanup_block.rb +173 -0
- data/lib/metanorma/standoc/cleanup_boilerplate.rb +213 -0
- data/lib/metanorma/standoc/cleanup_footnotes.rb +109 -0
- data/lib/metanorma/standoc/cleanup_image.rb +70 -0
- data/lib/metanorma/standoc/cleanup_inline.rb +190 -0
- data/lib/metanorma/standoc/cleanup_maths.rb +222 -0
- data/lib/metanorma/standoc/cleanup_ref.rb +170 -0
- data/lib/metanorma/standoc/cleanup_ref_dl.rb +104 -0
- data/lib/metanorma/standoc/cleanup_reqt.rb +111 -0
- data/lib/metanorma/standoc/cleanup_section.rb +212 -0
- data/lib/metanorma/standoc/cleanup_section_names.rb +92 -0
- data/lib/metanorma/standoc/cleanup_symbols.rb +48 -0
- data/lib/metanorma/standoc/cleanup_table.rb +68 -0
- data/lib/metanorma/standoc/cleanup_terms.rb +140 -0
- data/lib/metanorma/standoc/cleanup_terms_designations.rb +199 -0
- data/lib/metanorma/standoc/cleanup_text.rb +96 -0
- data/lib/metanorma/standoc/cleanup_toc.rb +98 -0
- data/lib/metanorma/standoc/cleanup_xref.rb +107 -0
- data/lib/metanorma/standoc/converter.rb +124 -0
- data/lib/metanorma/standoc/datamodel/attributes_table_preprocessor.rb +57 -0
- data/lib/metanorma/standoc/datamodel/diagram_preprocessor.rb +103 -0
- data/lib/metanorma/standoc/datamodel/plantuml_renderer.rb +409 -0
- data/lib/metanorma/standoc/front.rb +224 -0
- data/lib/metanorma/standoc/front_contributor.rb +192 -0
- data/lib/metanorma/standoc/inline.rb +232 -0
- data/lib/{asciidoctor → metanorma}/standoc/isodoc.rng +29 -0
- data/lib/metanorma/standoc/lists.rb +120 -0
- data/lib/metanorma/standoc/macros.rb +204 -0
- data/lib/metanorma/standoc/macros_form.rb +63 -0
- data/lib/metanorma/standoc/macros_note.rb +45 -0
- data/lib/metanorma/standoc/macros_plantuml.rb +113 -0
- data/lib/metanorma/standoc/macros_terms.rb +181 -0
- data/lib/metanorma/standoc/ref.rb +243 -0
- data/lib/metanorma/standoc/ref_sect.rb +153 -0
- data/lib/{asciidoctor/standoc/ref_date_id.rb → metanorma/standoc/ref_utility.rb} +43 -5
- data/lib/metanorma/standoc/render.rb +115 -0
- data/lib/metanorma/standoc/reqt.rb +90 -0
- data/lib/{asciidoctor → metanorma}/standoc/reqt.rng +0 -0
- data/lib/metanorma/standoc/section.rb +209 -0
- data/lib/metanorma/standoc/table.rb +85 -0
- data/lib/metanorma/standoc/term_lookup_cleanup.rb +179 -0
- data/lib/metanorma/standoc/terms.rb +160 -0
- data/lib/metanorma/standoc/utils.rb +101 -0
- data/lib/metanorma/standoc/validate.rb +158 -0
- data/lib/metanorma/standoc/validate_section.rb +55 -0
- data/lib/metanorma/standoc/version.rb +1 -1
- data/lib/{asciidoctor → metanorma}/standoc/views/datamodel/model_representation.adoc.erb +0 -0
- data/lib/{asciidoctor → metanorma}/standoc/views/datamodel/plantuml_representation.adoc.erb +0 -0
- data/lib/metanorma-standoc.rb +1 -1
- data/metanorma-standoc.gemspec +1 -1
- data/spec/{asciidoctor → metanorma}/base_spec.rb +27 -10
- data/spec/{asciidoctor → metanorma}/blank_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/blocks_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/cleanup_blocks_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/cleanup_sections_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/cleanup_spec.rb +5 -5
- data/spec/{asciidoctor → metanorma}/cleanup_terms_spec.rb +2 -2
- data/spec/{asciidoctor → metanorma}/datamodel/attributes_table_preprocessor_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/datamodel/diagram_preprocessor_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/inline_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/isobib_cache_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/lists_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/macros_json2text_spec.rb +0 -0
- data/spec/{asciidoctor → metanorma}/macros_plantuml_spec.rb +3 -3
- data/spec/{asciidoctor → metanorma}/macros_spec.rb +6 -6
- data/spec/{asciidoctor → metanorma}/macros_yaml2text_spec.rb +0 -0
- data/spec/metanorma/refs_dl_spec.rb +863 -0
- data/spec/{asciidoctor → metanorma}/refs_spec.rb +399 -25
- data/spec/{asciidoctor → metanorma}/section_spec.rb +42 -17
- data/spec/{asciidoctor → metanorma}/table_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/validate_spec.rb +2 -2
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +42 -42
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +11 -11
- data/spec/vcr_cassettes/isobib_get_123.yml +12 -12
- data/spec/vcr_cassettes/isobib_get_123_1.yml +21 -21
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +81 -81
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +10 -10
- data/spec/vcr_cassettes/isobib_get_124.yml +11 -11
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +13 -13
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +46 -46
- metadata +82 -32
- 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
|
5
|
+
RSpec.describe Metanorma::Standoc do
|
6
6
|
it "processes simple ISO reference" do
|
7
7
|
input = <<~INPUT
|
8
8
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -970,8 +970,9 @@ RSpec.describe Asciidoctor::Standoc do
|
|
970
970
|
<formattedref format='application/x-isodoc+xml'>
|
971
971
|
<em>Standard</em>
|
972
972
|
</formattedref>
|
973
|
-
<docidentifier type='ISO'>ISO/IEC TR 12382
|
974
|
-
<docnumber>12382
|
973
|
+
<docidentifier type='ISO'>ISO/IEC TR 12382</docidentifier>
|
974
|
+
<docnumber>12382</docnumber>
|
975
|
+
<date type='published'><on>1992</on></date>
|
975
976
|
</bibitem>
|
976
977
|
<bibitem id='iso124' type='standard'>
|
977
978
|
<fetched/>
|
@@ -1025,6 +1026,356 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1025
1026
|
end
|
1026
1027
|
end
|
1027
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 — 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 — 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 — 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 — 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' hidden='true'>
|
1256
|
+
<formattedref format='application/x-isodoc+xml'>
|
1257
|
+
<em>Standard</em>
|
1258
|
+
</formattedref>
|
1259
|
+
<docidentifier type='ISO'>ISO 125</docidentifier>
|
1260
|
+
<docnumber>125</docnumber>
|
1261
|
+
</bibitem>
|
1262
|
+
<bibitem id='iso126' hidden='true'>
|
1263
|
+
<formattedref format='application/x-isodoc+xml'>
|
1264
|
+
<em>Standard</em>
|
1265
|
+
</formattedref>
|
1266
|
+
<docidentifier>XYZ</docidentifier>
|
1267
|
+
</bibitem>
|
1268
|
+
<bibitem id='iso127' type='standard'>
|
1269
|
+
<fetched/>
|
1270
|
+
<title type='title-intro' format='text/plain' language='en' script='Latn'>Latex, rubber</title>
|
1271
|
+
<title type='title-main' format='text/plain' language='en' script='Latn'>Determination of total solids content</title>
|
1272
|
+
<title type='main' format='text/plain' language='en' script='Latn'>Latex, rubber — Determination of total solids content</title>
|
1273
|
+
<uri type='src'>https://www.iso.org/standard/61884.html</uri>
|
1274
|
+
<uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:61884:en</uri>
|
1275
|
+
<uri type='rss'>https://www.iso.org/contents/data/standard/06/18/61884.detail.rss</uri>
|
1276
|
+
<docidentifier type='ISO'>ISO 124</docidentifier>
|
1277
|
+
<docidentifier type='URN'>urn:iso:std:iso:124:stage-90.93:ed-7:en</docidentifier>
|
1278
|
+
<docnumber>124</docnumber>
|
1279
|
+
<contributor>
|
1280
|
+
<role type='publisher'/>
|
1281
|
+
<organization>
|
1282
|
+
<name>International Organization for Standardization</name>
|
1283
|
+
<abbreviation>ISO</abbreviation>
|
1284
|
+
<uri>www.iso.org</uri>
|
1285
|
+
</organization>
|
1286
|
+
</contributor>
|
1287
|
+
<edition>7</edition>
|
1288
|
+
<language>en</language>
|
1289
|
+
<script>Latn</script>
|
1290
|
+
<status>
|
1291
|
+
<stage>90</stage>
|
1292
|
+
<substage>93</substage>
|
1293
|
+
</status>
|
1294
|
+
<copyright>
|
1295
|
+
<from>2014</from>
|
1296
|
+
<owner>
|
1297
|
+
<organization>
|
1298
|
+
<name>ISO</name>
|
1299
|
+
</organization>
|
1300
|
+
</owner>
|
1301
|
+
</copyright>
|
1302
|
+
<relation type='obsoletes'>
|
1303
|
+
<bibitem type='standard'>
|
1304
|
+
<formattedref format='text/plain'>ISO 124:2011</formattedref>
|
1305
|
+
</bibitem>
|
1306
|
+
</relation>
|
1307
|
+
<relation type='instance'>
|
1308
|
+
<bibitem type='standard'>
|
1309
|
+
<fetched/>
|
1310
|
+
<title type='title-intro' format='text/plain' language='en' script='Latn'>Latex, rubber</title>
|
1311
|
+
<title type='title-main' format='text/plain' language='en' script='Latn'>Determination of total solids content</title>
|
1312
|
+
<title type='main' format='text/plain' language='en' script='Latn'>Latex, rubber — Determination of total solids content</title>
|
1313
|
+
<uri type='src'>https://www.iso.org/standard/61884.html</uri>
|
1314
|
+
<uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:61884:en</uri>
|
1315
|
+
<uri type='rss'>https://www.iso.org/contents/data/standard/06/18/61884.detail.rss</uri>
|
1316
|
+
<docidentifier type='ISO'>ISO 124:2014</docidentifier>
|
1317
|
+
<docidentifier type='URN'>urn:iso:std:iso:124:stage-90.93:ed-7:en</docidentifier>
|
1318
|
+
<docnumber>124</docnumber>
|
1319
|
+
<date type='published'>
|
1320
|
+
<on>2014-03</on>
|
1321
|
+
</date>
|
1322
|
+
<contributor>
|
1323
|
+
<role type='publisher'/>
|
1324
|
+
<organization>
|
1325
|
+
<name>International Organization for Standardization</name>
|
1326
|
+
<abbreviation>ISO</abbreviation>
|
1327
|
+
<uri>www.iso.org</uri>
|
1328
|
+
</organization>
|
1329
|
+
</contributor>
|
1330
|
+
<edition>7</edition>
|
1331
|
+
<language>en</language>
|
1332
|
+
<script>Latn</script>
|
1333
|
+
<abstract format='text/plain' language='en' script='Latn'>
|
1334
|
+
ISO 124:2014 specifies methods for the determination of the total
|
1335
|
+
solids content of natural rubber field and concentrated latices
|
1336
|
+
and synthetic rubber latex. These methods are not necessarily
|
1337
|
+
suitable for latex from natural sources other than the Hevea
|
1338
|
+
brasiliensis, for vulcanized latex, for compounded latex, or for
|
1339
|
+
artificial dispersions of rubber.
|
1340
|
+
</abstract>
|
1341
|
+
<status>
|
1342
|
+
<stage>90</stage>
|
1343
|
+
<substage>93</substage>
|
1344
|
+
</status>
|
1345
|
+
<copyright>
|
1346
|
+
<from>2014</from>
|
1347
|
+
<owner>
|
1348
|
+
<organization>
|
1349
|
+
<name>ISO</name>
|
1350
|
+
</organization>
|
1351
|
+
</owner>
|
1352
|
+
</copyright>
|
1353
|
+
<relation type='obsoletes'>
|
1354
|
+
<bibitem type='standard'>
|
1355
|
+
<formattedref format='text/plain'>ISO 124:2011</formattedref>
|
1356
|
+
</bibitem>
|
1357
|
+
</relation>
|
1358
|
+
<place>Geneva</place>
|
1359
|
+
</bibitem>
|
1360
|
+
</relation>
|
1361
|
+
<place>Geneva</place>
|
1362
|
+
</bibitem>
|
1363
|
+
<bibitem id='iso128'>
|
1364
|
+
<formattedref format='application/x-isodoc+xml'>
|
1365
|
+
<em>Standard</em>
|
1366
|
+
</formattedref>
|
1367
|
+
<docidentifier>ABC</docidentifier>
|
1368
|
+
</bibitem>
|
1369
|
+
</references>
|
1370
|
+
</bibliography>
|
1371
|
+
</standard-document>
|
1372
|
+
OUTPUT
|
1373
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1374
|
+
.to be_equivalent_to xmlpp(output)
|
1375
|
+
end
|
1376
|
+
end
|
1377
|
+
|
1378
|
+
|
1028
1379
|
it "processes draft ISO reference" do
|
1029
1380
|
# stub_fetch_ref no_year: true, note: "The standard is in press"
|
1030
1381
|
|
@@ -1112,8 +1463,6 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1112
1463
|
end
|
1113
1464
|
|
1114
1465
|
it "processes all-parts ISO reference" do
|
1115
|
-
# stub_fetch_ref(all_parts: true)
|
1116
|
-
|
1117
1466
|
input = <<~INPUT
|
1118
1467
|
#{ASCIIDOC_BLANK_HDR}
|
1119
1468
|
[bibliography]
|
@@ -1171,8 +1520,29 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1171
1520
|
.to be_equivalent_to xmlpp(output)
|
1172
1521
|
end
|
1173
1522
|
|
1523
|
+
it "processes BSI reference with year" do
|
1524
|
+
VCR.use_cassette("bsi16341",
|
1525
|
+
match_requests_on: %i[method uri body]) do
|
1526
|
+
input = <<~INPUT
|
1527
|
+
#{ISOBIB_BLANK_HDR}
|
1528
|
+
[bibliography]
|
1529
|
+
== Normative References
|
1530
|
+
|
1531
|
+
* [[[iso124,BSI BS EN ISO 19011:2018]]] _Standard_
|
1532
|
+
* [[[iso123,BSI BS EN 16341]]] _Standard_
|
1533
|
+
* [[[ref_2,BSI BS EN ISO 14044:2006+A1:2020]]], _Environmental management – Life cycle assessment – Requirements and guidelines_
|
1534
|
+
INPUT
|
1535
|
+
output = Nokogiri::XML(Asciidoctor.convert(input, *OPTIONS))
|
1536
|
+
.xpath("//xmlns:docidentifier[@type = 'BSI']").map(&:text)
|
1537
|
+
expect(output).to include("BS EN ISO 14044:2006+A2:2020")
|
1538
|
+
expect(output).to include("BS EN 16341:2012")
|
1539
|
+
expect(output).to include("BS EN 16341")
|
1540
|
+
expect(output).not_to include("BS EN ISO 19011")
|
1541
|
+
expect(output).to include("BS EN ISO 19011:2018")
|
1542
|
+
end
|
1543
|
+
end
|
1544
|
+
|
1174
1545
|
it "processes RFC reference in Normative References" do
|
1175
|
-
# mock_rfcbib_get_rfc8341
|
1176
1546
|
VCR.use_cassette "rfcbib_get_rfc8341" do
|
1177
1547
|
input = <<~INPUT
|
1178
1548
|
#{ISOBIB_BLANK_HDR}
|
@@ -1206,7 +1576,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1206
1576
|
</uri>
|
1207
1577
|
<uri type='src'>https://www.rfc-editor.org/info/rfc8341</uri>
|
1208
1578
|
<docidentifier type='IETF'>RFC 8341</docidentifier>
|
1209
|
-
<docidentifier type='
|
1579
|
+
<docidentifier type='IETF' scope='anchor'>RFC8341</docidentifier>
|
1210
1580
|
<docidentifier type='DOI'>10.17487/RFC8341</docidentifier>
|
1211
1581
|
<docnumber>RFC8341</docnumber>
|
1212
1582
|
<date type='published'>
|
@@ -1268,7 +1638,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1268
1638
|
<uri type='src'>https://www.rfc-editor.org/info/rfc8341</uri>
|
1269
1639
|
<docidentifier type='IETF'>RFC 8341</docidentifier>
|
1270
1640
|
<docidentifier type='metanorma'>[1]</docidentifier>
|
1271
|
-
<docidentifier type='
|
1641
|
+
<docidentifier type='IETF' scope='anchor'>RFC8341</docidentifier>
|
1272
1642
|
<docidentifier type='DOI'>10.17487/RFC8341</docidentifier>
|
1273
1643
|
<docnumber>RFC8341</docnumber>
|
1274
1644
|
<date type='published'>
|
@@ -1336,8 +1706,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1336
1706
|
[bibliography]
|
1337
1707
|
== Normative References
|
1338
1708
|
|
1339
|
-
* [[[iso123,XYZ 123:
|
1340
|
-
* [[[iso124,(1)XYZ 123:
|
1709
|
+
* [[[iso123,XYZ 123:1966 (all parts)]]] _Standard_
|
1710
|
+
* [[[iso124,(1)XYZ 123:1966]]] _Standard_
|
1341
1711
|
INPUT
|
1342
1712
|
output = <<~OUTPUT
|
1343
1713
|
#{BLANK_HDR}
|
@@ -1349,16 +1719,20 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1349
1719
|
<formattedref format="application/x-isodoc+xml">
|
1350
1720
|
<em>Standard</em>
|
1351
1721
|
</formattedref>
|
1352
|
-
<docidentifier>XYZ 123:
|
1353
|
-
<docnumber>123:
|
1722
|
+
<docidentifier>XYZ 123:1966 (all parts)</docidentifier>
|
1723
|
+
<docnumber>123:1966 (all parts)</docnumber>
|
1724
|
+
<date type='published'><on>1966</on></date>
|
1354
1725
|
</bibitem>
|
1355
1726
|
<bibitem id='iso124'>
|
1356
1727
|
<formattedref format='application/x-isodoc+xml'>
|
1357
1728
|
<em>Standard</em>
|
1358
1729
|
</formattedref>
|
1359
1730
|
<docidentifier type='metanorma'>[1]</docidentifier>
|
1360
|
-
<docidentifier>XYZ 123
|
1361
|
-
|
1731
|
+
<docidentifier>XYZ 123</docidentifier>
|
1732
|
+
<docnumber>123</docnumber>
|
1733
|
+
<date type='published'>
|
1734
|
+
<on>1966</on>
|
1735
|
+
</date>
|
1362
1736
|
</bibitem>
|
1363
1737
|
</references>
|
1364
1738
|
</bibliography>
|
@@ -2000,17 +2374,17 @@ RSpec.describe Asciidoctor::Standoc do
|
|
2000
2374
|
|
2001
2375
|
INPUT
|
2002
2376
|
output = <<~OUTPUT
|
2003
|
-
|
2004
|
-
|
2005
|
-
|
2006
|
-
|
2007
|
-
|
2008
|
-
|
2009
|
-
|
2010
|
-
|
2011
|
-
|
2012
|
-
|
2013
|
-
|
2377
|
+
#{BLANK_HDR}
|
2378
|
+
<sections>
|
2379
|
+
<clause id="_" inline-header="false" obligation="normative">
|
2380
|
+
<title>Section</title>
|
2381
|
+
<p id="_"><eref type="inline" bibitemid="reference" citeas="ISO 123"><em>reference</em></eref>
|
2382
|
+
<eref type="inline" bibitemid="reference" citeas="ISO 123"><em><strong>reference</strong></em></eref>
|
2383
|
+
<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>
|
2384
|
+
<eref type="inline" bibitemid="reference" citeas="ISO 123"><em>A</em><fn reference="1"><p id="_"><em>B</em></p></fn></eref>
|
2385
|
+
<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>
|
2386
|
+
</clause></sections>
|
2387
|
+
</standard-document>
|
2014
2388
|
OUTPUT
|
2015
2389
|
a = Nokogiri::XML(Asciidoctor.convert(input, *OPTIONS))
|
2016
2390
|
a.at("//xmlns:bibliography").remove
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
RSpec.describe
|
3
|
+
RSpec.describe Metanorma::Standoc do
|
4
4
|
it "processes sections" do
|
5
5
|
input = <<~INPUT
|
6
6
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -1264,30 +1264,55 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1264
1264
|
input = <<~INPUT
|
1265
1265
|
#{ASCIIDOC_BLANK_HDR}
|
1266
1266
|
|
1267
|
+
ABC
|
1268
|
+
|
1269
|
+
[discrete]
|
1270
|
+
== I am a top-level _floating_ title
|
1271
|
+
|
1267
1272
|
== Clause 1
|
1268
1273
|
|
1269
1274
|
[discrete]
|
1270
|
-
|
1275
|
+
=== I am a _floating_ title
|
1276
|
+
|
1277
|
+
=== Clause 1.2
|
1278
|
+
|
1279
|
+
[discrete]
|
1280
|
+
== Another top-level floating title
|
1271
1281
|
|
1272
|
-
|
1282
|
+
== Clause 2
|
1273
1283
|
|
1274
1284
|
INPUT
|
1275
1285
|
output = <<~OUTPUT
|
1276
1286
|
#{BLANK_HDR}
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1287
|
+
<preface>
|
1288
|
+
<foreword id='_' obligation='informative'>
|
1289
|
+
<title>Foreword</title>
|
1290
|
+
<p id='_'>ABC</p>
|
1291
|
+
</foreword>
|
1292
|
+
</preface>
|
1293
|
+
<sections>
|
1294
|
+
<floating-title id='_' depth='1' type='floating-title'>
|
1295
|
+
I am a top-level
|
1296
|
+
<em>floating</em>
|
1297
|
+
title
|
1298
|
+
</floating-title>
|
1299
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
1300
|
+
<title>Clause 1</title>
|
1301
|
+
<floating-title id='_' depth='2' type='floating-title'>
|
1302
|
+
I am a
|
1303
|
+
<em>floating</em>
|
1304
|
+
title
|
1305
|
+
</floating-title>
|
1306
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
1307
|
+
<title>Clause 1.2</title>
|
1308
|
+
</clause>
|
1309
|
+
</clause>
|
1310
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
1311
|
+
<title>Clause 2</title>
|
1312
|
+
</clause>
|
1313
|
+
<floating-title id='_' depth='1' type='floating-title'>Another top-level floating title</floating-title>
|
1314
|
+
</sections>
|
1315
|
+
</standard-document>
|
1291
1316
|
OUTPUT
|
1292
1317
|
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1293
1318
|
.to be_equivalent_to xmlpp(output)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
RSpec.describe
|
3
|
+
RSpec.describe Metanorma::Standoc do
|
4
4
|
it "processes basic tables" do
|
5
5
|
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
6
6
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
require "relaton_iec"
|
3
3
|
require "fileutils"
|
4
4
|
|
5
|
-
RSpec.describe
|
5
|
+
RSpec.describe Metanorma::Standoc do
|
6
6
|
it "generates error file" do
|
7
7
|
FileUtils.rm_f "spec/assets/xref_error.err"
|
8
8
|
Asciidoctor.convert_file "spec/assets/xref_error.adoc",
|
@@ -334,7 +334,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
334
334
|
end
|
335
335
|
|
336
336
|
# it "No warning if attributes on formatted strong or stem extraneous to Metanomra XML" do
|
337
|
-
# expect {
|
337
|
+
# expect { Metanorma::Standoc::Converter.new(nil,nil).validate(Nokogiri::XML(<<~INPUT)) }.not_to output('found attribute "close", but no attributes allowed here').to_stderr
|
338
338
|
# <standard-document>
|
339
339
|
# <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mfenced open="(" close=")"><mi>r</mi></mfenced></stem>
|
340
340
|
# </standard-document>
|