asciidoctor-iso 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/Gemfile.lock +18 -13
  4. data/README.adoc +28 -8
  5. data/asciidoctor-iso.gemspec +3 -2
  6. data/lib/asciidoctor-iso.rb +4 -0
  7. data/lib/asciidoctor/iso/base.rb +4 -17
  8. data/lib/asciidoctor/iso/cleanup.rb +16 -1
  9. data/lib/asciidoctor/iso/cleanup_ref.rb +2 -2
  10. data/lib/asciidoctor/iso/front.rb +5 -1
  11. data/lib/asciidoctor/iso/isostandard.rng +17 -1
  12. data/lib/asciidoctor/iso/ref.rb +122 -52
  13. data/lib/asciidoctor/iso/section.rb +8 -2
  14. data/lib/asciidoctor/iso/version.rb +1 -1
  15. data/lib/metanorma/iso.rb +7 -0
  16. data/lib/metanorma/iso/processor.rb +38 -0
  17. data/spec/asciidoctor-iso/base_spec.rb +37 -8
  18. data/spec/asciidoctor-iso/blocks_spec.rb +2 -2
  19. data/spec/asciidoctor-iso/cleanup_spec.rb +71 -203
  20. data/spec/asciidoctor-iso/isobib_cache_spec.rb +164 -0
  21. data/spec/asciidoctor-iso/refs_spec.rb +263 -183
  22. data/spec/asciidoctor-iso/validate_spec.rb +30 -28
  23. data/spec/examples/iso_123_.xml +3 -3
  24. data/spec/examples/iso_123_all_parts.xml +3 -3
  25. data/spec/examples/iso_123_no_year_note.xml +3 -3
  26. data/spec/examples/iso_124_.xml +3 -3
  27. data/spec/spec_helper.rb +42 -1
  28. metadata +23 -17
  29. data/lib/asciidoctor/iso/html/header.html +0 -184
  30. data/lib/asciidoctor/iso/html/html_iso_intro.html +0 -34
  31. data/lib/asciidoctor/iso/html/html_iso_titlepage.html +0 -32
  32. data/lib/asciidoctor/iso/html/htmlstyle.scss +0 -46
  33. data/lib/asciidoctor/iso/html/isodoc.scss +0 -679
  34. data/lib/asciidoctor/iso/html/scripts.html +0 -174
  35. data/lib/asciidoctor/iso/html/style-human.scss +0 -1277
  36. data/lib/asciidoctor/iso/html/style-iso.scss +0 -1257
  37. data/lib/asciidoctor/iso/html/word_iso_intro.html +0 -72
  38. data/lib/asciidoctor/iso/html/word_iso_titlepage.html +0 -58
  39. data/lib/asciidoctor/iso/html/wordstyle.scss +0 -1135
@@ -0,0 +1,164 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe Asciidoctor::ISO do
4
+
5
+ it "does not activate biblio caches if isobib disabled" do
6
+ system "mv ~/.relaton-bib.json ~/.relaton-bib.json1"
7
+ system "rm -f test.relaton.json"
8
+ Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
9
+ #{ASCIIDOC_BLANK_HDR}
10
+ [bibliography]
11
+ == Normative References
12
+
13
+ * [[[iso123,ISO 123]]] _Standard_
14
+ INPUT
15
+ expect(File.exist?("#{Dir.home}/.relaton-bib.json")).to be false
16
+ expect(File.exist?("test.relaton.json")).to be false
17
+
18
+ system "rm ~/.relaton-bib.json"
19
+ system "mv ~/.relaton-bib.json1 ~/.relaton-bib.json"
20
+ end
21
+
22
+
23
+ it "does not activate biblio caches if isobib caching disabled" do
24
+ system "mv ~/.relaton-bib.json ~/.relaton-bib.json1"
25
+ system "rm -f test.relaton.json"
26
+ Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
27
+ #{ISOBIB_BLANK_HDR}
28
+ [bibliography]
29
+ == Normative References
30
+
31
+ * [[[iso123,ISO 123]]] _Standard_
32
+ INPUT
33
+ expect(File.exist?("#{Dir.home}/.relaton-bib.json")).to be false
34
+ expect(File.exist?("test.relaton.json")).to be false
35
+
36
+ system "rm ~/.relaton-bib.json"
37
+ system "mv ~/.relaton-bib.json1 ~/.relaton-bib.json"
38
+ end
39
+
40
+ it "flushes biblio caches" do
41
+ system "cp ~/.relaton-bib.json ~/.relaton-bib.json1"
42
+ system "echo 'XXX' > ~/.relaton-bib.json"
43
+ Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
44
+ #{FLUSH_CACHE_ISOBIB_BLANK_HDR}
45
+ [bibliography]
46
+ == Normative References
47
+
48
+ * [[[iso123,ISO 123]]] _Standard_
49
+ INPUT
50
+ expect(File.exist?("#{Dir.home}/.relaton-bib.json")).to be true
51
+ json = File.read("#{Dir.home}/.relaton-bib.json", encoding: "utf-8")
52
+ expect(json).to be_equivalent_to <<~"OUTPUT"
53
+ {"ISO 123":"<bibitem type=\\"international-standard\\" id=\\"ISO123\\">\\n <title format=\\"text/plain\\" language=\\"en\\" script=\\"Latn\\">Rubber latex -- Sampling</title>\\n <title format=\\"text/plain\\" language=\\"fr\\" script=\\"Latn\\">Latex de caoutchouc -- ?chantillonnage</title>\\n <source type=\\"src\\">https://www.iso.org/standard/23281.html</source>\\n <source type=\\"obp\\">https://www.iso.org/obp/ui/#!iso:std:23281:en</source>\\n <source type=\\"rss\\">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</source>\\n <docidentifier>ISO 123</docidentifier>\\n <date type=\\"published\\">\\n <on>2001</on>\\n </date>\\n <contributor>\\n <role type=\\"publisher\\"/>\\n <organization>\\n <name>International Organization for Standardization</name>\\n <abbreviation>ISO</abbreviation>\\n <uri>www.iso.org</uri>\\n </organization>\\n </contributor>\\n <edition>3</edition>\\n <language>en</language>\\n <language>fr</language>\\n <script>Latn</script>\\n <status>Published</status>\\n <copyright>\\n <from>2001</from>\\n <owner>\\n <organization>\\n <name>ISO</name>\\n <abbreviation></abbreviation>\\n </organization>\\n </owner>\\n </copyright>\\n <relation type=\\"obsoletes\\">\\n <bibitem>\\n <formattedref>ISO 123:1985</formattedref>\\n <docidentifier>ISO 123:1985</docidentifier>\\n </bibitem>\\n </relation>\\n <relation type=\\"updates\\">\\n <bibitem>\\n <formattedref>ISO 123:2001</formattedref>\\n <docidentifier>ISO 123:2001</docidentifier>\\n </bibitem>\\n </relation>\\n</bibitem>"}
54
+ OUTPUT
55
+
56
+ system "rm ~/.relaton-bib.json"
57
+ system "mv ~/.relaton-bib.json1 ~/.relaton-bib.json"
58
+ end
59
+
60
+
61
+ it "activates global cache" do
62
+ system "mv ~/.relaton-bib.json ~/.relaton-bib.json1"
63
+ system "rm -f test.relaton.json"
64
+ Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
65
+ #{CACHED_ISOBIB_BLANK_HDR}
66
+ [bibliography]
67
+ == Normative References
68
+
69
+ * [[[iso123,ISO 123]]] _Standard_
70
+ INPUT
71
+ expect(File.exist?("#{Dir.home}/.relaton-bib.json")).to be true
72
+ expect(File.exist?("test.relaton.json")).to be false
73
+
74
+ json = File.read("#{Dir.home}/.relaton-bib.json", encoding: "utf-8")
75
+ expect(json).to match(%r{"ISO 123"})
76
+
77
+ system "rm ~/.relaton-bib.json"
78
+ system "mv ~/.relaton-bib.json1 ~/.relaton-bib.json"
79
+ end
80
+
81
+ it "activates local cache" do
82
+ system "mv ~/.relaton-bib.json ~/.relaton-bib.json1"
83
+ system "rm -f test.relaton.json"
84
+ Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
85
+ #{LOCAL_CACHED_ISOBIB_BLANK_HDR}
86
+ [bibliography]
87
+ == Normative References
88
+
89
+ * [[[iso123,ISO 123]]] _Standard_
90
+ INPUT
91
+ expect(File.exist?("#{Dir.home}/.relaton-bib.json")).to be true
92
+ expect(File.exist?("test.relaton.json")).to be true
93
+
94
+ json = File.read("#{Dir.home}/.relaton-bib.json", encoding: "utf-8")
95
+ expect(json).to match(%r{"ISO 123"})
96
+ json = File.read("test.relaton.json", encoding: "utf-8")
97
+ expect(json).to match(%r{"ISO 123"})
98
+
99
+ system "rm ~/.relaton-bib.json"
100
+ system "mv ~/.relaton-bib.json1 ~/.relaton-bib.json"
101
+ end
102
+
103
+ it "fetches uncached references" do
104
+ system "mv ~/.relaton-bib.json ~/.relaton-bib.json1"
105
+ system %q(echo '{"ISO 123":"<bibitem type=\\"international-standard\\" id=\\"ISO123\\"> <title format=\\"text/plain\\" language=\\"en\\" script=\\"Latn\\">Rubber latex -- Sampling</title><docidentifier>ISO 123</docidentifier></bibitem>"}' > ~/.relaton-bib.json)
106
+
107
+ Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
108
+ #{CACHED_ISOBIB_BLANK_HDR}
109
+ [bibliography]
110
+ == Normative References
111
+
112
+ * [[[iso123,ISO 123]]] _Standard_
113
+ * [[[iso124,ISO 124]]] _Standard_
114
+ INPUT
115
+
116
+ json = File.read("#{Dir.home}/.relaton-bib.json", encoding: "utf-8")
117
+ expect(json).to be_equivalent_to <<~"OUTPUT"
118
+ {"ISO 123":"<bibitem type=\\"international-standard\\" id=\\"ISO123\\"> <title format=\\"text/plain\\" language=\\"en\\" script=\\"Latn\\">Rubber latex -- Sampling</title><docidentifier>ISO 123</docidentifier></bibitem>","ISO 124":"<bibitem type=\\"international-standard\\" id=\\"ISO124\\">\\n <title format=\\"text/plain\\" language=\\"en\\" script=\\"Latn\\">Latex, rubber -- Determination of total solids content</title>\\n <title format=\\"text/plain\\" language=\\"fr\\" script=\\"Latn\\">Latex de caoutchouc -- Détermination des matières solides totales</title>\\n <source type=\\"src\\">https://www.iso.org/standard/61884.html</source>\\n <source type=\\"obp\\">https://www.iso.org/obp/ui/#!iso:std:61884:en</source>\\n <source type=\\"rss\\">https://www.iso.org/contents/data/standard/06/18/61884.detail.rss</source>\\n <docidentifier>ISO 124</docidentifier>\\n <date type=\\"published\\">\\n <on>2014</on>\\n </date>\\n <contributor>\\n <role type=\\"publisher\\"/>\\n <organization>\\n <name>International Organization for Standardization</name>\\n <abbreviation>ISO</abbreviation>\\n <uri>www.iso.org</uri>\\n </organization>\\n </contributor>\\n <edition>7</edition>\\n <language>en</language>\\n <language>fr</language>\\n <script>Latn</script>\\n <abstract format=\\"plain\\" language=\\"en\\" script=\\"Latn\\">ISO 124:2014 specifies methods for the determination of the total solids content of natural rubber field and concentrated latices and synthetic rubber latex. These methods are not necessarily suitable for latex from natural sources other than the Hevea brasiliensis, for vulcanized latex, for compounded latex, or for artificial dispersions of rubber.</abstract>\\n <abstract format=\\"plain\\" language=\\"fr\\" script=\\"Latn\\">L'ISO 124:2014 spécifie des méthodes pour la détermination des matières solides totales dans le latex de plantation, le latex de concentré de caoutchouc naturel et le latex de caoutchouc synthétique. Ces méthodes ne conviennent pas nécessairement au latex d'origine naturelle autre que celui de l'Hevea brasiliensis, au latex vulcanisé, aux mélanges de latex, ou aux dispersions artificielles de caoutchouc.</abstract>\\n <status>Published</status>\\n <copyright>\\n <from>2014</from>\\n <owner>\\n <organization>\\n <name>ISO</name>\\n <abbreviation></abbreviation>\\n </organization>\\n </owner>\\n </copyright>\\n <relation type=\\"obsoletes\\">\\n <bibitem>\\n <formattedref>ISO 124:2011</formattedref>\\n <docidentifier>ISO 124:2011</docidentifier>\\n </bibitem>\\n </relation>\\n</bibitem>"}
119
+ OUTPUT
120
+
121
+ system "rm ~/.relaton-bib.json"
122
+ system "mv ~/.relaton-bib.json1 ~/.relaton-bib.json"
123
+ end
124
+
125
+
126
+ it "prioritises local over global cache values" do
127
+ system "mv ~/.relaton-bib.json ~/.relaton-bib.json1"
128
+ system "rm test.relaton.json"
129
+ system %q(echo '{"ISO 123":"<bibitem type=\\"international-standard\\" id=\\"ISO123\\"> <title format=\\"text/plain\\" language=\\"en\\" script=\\"Latn\\">Rubber latex -- Sampling</title><docidentifier>ISO 123</docidentifier></bibitem>", "ISO 124":"<bibitem type=\\"international-standard\\" id=\\"ISO124\\"> <title format=\\"text/plain\\" language=\\"en\\" script=\\"Latn\\">Latex, rubber -- Determination of total solids content</docidentifier></bibitem>"}' > ~/.relaton-bib.json)
130
+ system %q(echo '{"ISO 124":"<bibitem type=\\"international-standard\\" id=\\"ISO124\\"> <title format=\\"text/plain\\" language=\\"fr\\" script=\\"Latn\\">Latex de caoutchouc -- Détermination des matières solides totales</title><docidentifier>ISO 124</docidentifier></bibitem>"}' > test.relaton.json)
131
+
132
+ expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
133
+ #{LOCAL_CACHED_ISOBIB_BLANK_HDR}
134
+ [bibliography]
135
+ == Normative References
136
+
137
+ * [[[iso123,ISO 123]]] _Standard_
138
+ * [[[iso124,ISO 124]]] _Standard_
139
+ INPUT
140
+ #{BLANK_HDR}
141
+ <sections>
142
+
143
+ </sections><bibliography><references id="_" obligation="informative">
144
+ <title>Normative References</title>
145
+ <bibitem type="international-standard" id="iso123"> <title format="text/plain" language="en" script="Latn">Rubber latex -- Sampling</title><docidentifier>ISO 123</docidentifier></bibitem>
146
+ <bibitem type="international-standard" id="iso124"> <title format="text/plain" language="fr" script="Latn">Latex de caoutchouc -- Détermination des matières solides totales</title><docidentifier>ISO 124</docidentifier></bibitem>
147
+ </references></bibliography>
148
+ </iso-standard>
149
+ OUTPUT
150
+
151
+ json = File.read("#{Dir.home}/.relaton-bib.json", encoding: "utf-8")
152
+ expect(json).to be_equivalent_to <<~"OUTPUT"
153
+ {"ISO 123":"<bibitem type=\\"international-standard\\" id=\\"ISO123\\"> <title format=\\"text/plain\\" language=\\"en\\" script=\\"Latn\\">Rubber latex -- Sampling</title><docidentifier>ISO 123</docidentifier></bibitem>","ISO 124":"<bibitem type=\\"international-standard\\" id=\\"ISO124\\"> <title format=\\"text/plain\\" language=\\"en\\" script=\\"Latn\\">Latex, rubber -- Determination of total solids content</docidentifier></bibitem>"}
154
+ OUTPUT
155
+ json = File.read("test.relaton.json", encoding: "utf-8")
156
+ expect(json).to be_equivalent_to <<~"OUTPUT"
157
+ {"ISO 124":"<bibitem type=\\"international-standard\\" id=\\"ISO124\\"> <title format=\\"text/plain\\" language=\\"fr\\" script=\\"Latn\\">Latex de caoutchouc -- Détermination des matières solides totales</title><docidentifier>ISO 124</docidentifier></bibitem>","ISO 123":"<bibitem type=\\"international-standard\\" id=\\"ISO123\\"> <title format=\\"text/plain\\" language=\\"en\\" script=\\"Latn\\">Rubber latex -- Sampling</title><docidentifier>ISO 123</docidentifier></bibitem>"}
158
+ OUTPUT
159
+
160
+ system "rm ~/.relaton-bib.json"
161
+ system "mv ~/.relaton-bib.json1 ~/.relaton-bib.json"
162
+ end
163
+
164
+ end
@@ -1,8 +1,7 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe Asciidoctor::ISO do
4
- it "processes simple ISO reference" do
5
- stub_fetch_ref
4
+ it "processes simple ISO reference" do
6
5
  expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
7
6
  #{ASCIIDOC_BLANK_HDR}
8
7
  [bibliography]
@@ -14,16 +13,77 @@ RSpec.describe Asciidoctor::ISO do
14
13
  <sections>
15
14
  </sections><bibliography><references id="_" obligation="informative">
16
15
  <title>Normative References</title>
17
- <bibitem type="international-standard" id="ISO123">
18
- <title format="text/plain" language="en" script="Latn">Rubber latex -- Sampling -- </title>
19
- <title format="text/plain" language="fr" script="Latn">Latex de caoutchouc -- Échantillonnage -- </title>
16
+ <bibitem id="iso123" type="standard">
17
+ <title format="text/plain">Standard</title>
18
+ <docidentifier>ISO 123</docidentifier>
19
+ <contributor>
20
+ <role type="publisher"/>
21
+ <organization>
22
+ <name>International Organization for Standardization</name>
23
+ <abbreviation>ISO</abbreviation>
24
+ </organization>
25
+ </contributor>
26
+ </bibitem>
27
+ </references>
28
+ </bibliography>
29
+ </iso-standard>
30
+ OUTPUT
31
+ end
32
+
33
+ it "processes simple ISO reference with date range" do
34
+ expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
35
+ #{ASCIIDOC_BLANK_HDR}
36
+ [bibliography]
37
+ == Normative References
38
+
39
+ * [[[iso123,ISO 123:1066-1067]]] _Standard_
40
+ INPUT
41
+ #{BLANK_HDR}
42
+ <sections>
43
+ </sections><bibliography><references id="_" obligation="informative">
44
+ <title>Normative References</title>
45
+ <bibitem id="iso123" type="standard">
46
+ <title format="text/plain">Standard</title>
47
+ <docidentifier>ISO 123</docidentifier>
48
+ <date type="published">
49
+ <from>1066</from>
50
+ <to>1067</to>
51
+ </date>
52
+ <contributor>
53
+ <role type="publisher"/>
54
+ <organization>
55
+ <name>International Organization for Standardization</name>
56
+ <abbreviation>ISO</abbreviation>
57
+ </organization>
58
+ </contributor>
59
+ </bibitem>
60
+ </references>
61
+ </bibliography>
62
+ </iso-standard>
63
+ OUTPUT
64
+ end
65
+
66
+
67
+ it "fetches simple ISO reference" do
68
+ #stub_fetch_ref
69
+ expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
70
+ #{ISOBIB_BLANK_HDR}
71
+ [bibliography]
72
+ == Normative References
73
+
74
+ * [[[iso123,ISO 123]]] _Standard_
75
+ INPUT
76
+ #{BLANK_HDR}
77
+ <sections>
78
+ </sections><bibliography><references id="_" obligation="informative">
79
+ <title>Normative References</title>
80
+ <bibitem type="international-standard" id="iso123">
81
+ <title format="text/plain" language="en" script="Latn">Rubber latex -- Sampling</title>
82
+ <title format="text/plain" language="fr" script="Latn">Latex de caoutchouc -- Échantillonnage</title>
20
83
  <source type="src">https://www.iso.org/standard/23281.html</source>
21
84
  <source type="obp">https://www.iso.org/obp/ui/#!iso:std:23281:en</source>
22
85
  <source type="rss">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</source>
23
86
  <docidentifier>ISO 123</docidentifier>
24
- <date type="published">
25
- <from>2001</from>
26
- </date>
27
87
  <contributor>
28
88
  <role type="publisher"/>
29
89
  <organization>
@@ -58,6 +118,61 @@ RSpec.describe Asciidoctor::ISO do
58
118
  <docidentifier>ISO 123:2001</docidentifier>
59
119
  </bibitem>
60
120
  </relation>
121
+ <ics>
122
+ <code>83.040.10</code>
123
+ <text>Latex and raw rubber</text>
124
+ </ics>
125
+ <relation type="instance">
126
+ <bibitem type="international-standard" id="ISO123">
127
+ <title format="text/plain" language="en" script="Latn">Rubber latex -- Sampling</title>
128
+ <title format="text/plain" language="fr" script="Latn">Latex de caoutchouc -- Échantillonnage</title>
129
+ <source type="src">https://www.iso.org/standard/23281.html</source>
130
+ <source type="obp">https://www.iso.org/obp/ui/#!iso:std:23281:en</source>
131
+ <source type="rss">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</source>
132
+ <docidentifier>ISO 123</docidentifier>
133
+ <date type="published">
134
+ <on>2001</on>
135
+ </date>
136
+ <contributor>
137
+ <role type="publisher"/>
138
+ <organization>
139
+ <name>International Organization for Standardization</name>
140
+ <abbreviation>ISO</abbreviation>
141
+ <uri>www.iso.org</uri>
142
+ </organization>
143
+ </contributor>
144
+ <edition>3</edition>
145
+ <language>en</language>
146
+ <language>fr</language>
147
+ <script>Latn</script>
148
+ <status>Published</status>
149
+ <copyright>
150
+ <from>2001</from>
151
+ <owner>
152
+ <organization>
153
+ <name>ISO</name>
154
+ <abbreviation/>
155
+ </organization>
156
+ </owner>
157
+ </copyright>
158
+ <relation type="obsoletes">
159
+ <bibitem>
160
+ <formattedref>ISO 123:1985</formattedref>
161
+ <docidentifier>ISO 123:1985</docidentifier>
162
+ </bibitem>
163
+ </relation>
164
+ <relation type="updates">
165
+ <bibitem>
166
+ <formattedref>ISO 123:2001</formattedref>
167
+ <docidentifier>ISO 123:2001</docidentifier>
168
+ </bibitem>
169
+ </relation>
170
+ <ics>
171
+ <code>83.040.10</code>
172
+ <text>Latex and raw rubber</text>
173
+ </ics>
174
+ </bibitem>
175
+ </relation>
61
176
  </bibitem>
62
177
  </references>
63
178
  </bibliography>
@@ -65,6 +180,20 @@ RSpec.describe Asciidoctor::ISO do
65
180
  OUTPUT
66
181
  end
67
182
 
183
+ it "fetches simple ISO reference" do
184
+ system "mv ~/.relaton-bib.json ~/.relaton-bib.json1"
185
+ system "rm -f test.relation.json"
186
+ Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
187
+ #{CACHED_ISOBIB_BLANK_HDR}
188
+ [bibliography]
189
+ == Normative References
190
+
191
+ * [[[iso123,ISO 123]]] _Standard_
192
+ INPUT
193
+ system "mv ~/.relaton-bib.json1 ~/.relaton-bib.json"
194
+ end
195
+
196
+
68
197
  it "processes simple IEC reference" do
69
198
  expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
70
199
  #{ASCIIDOC_BLANK_HDR}
@@ -95,110 +224,122 @@ RSpec.describe Asciidoctor::ISO do
95
224
  end
96
225
 
97
226
  it "processes dated ISO reference and joint ISO/IEC references" do
98
- stub_fetch_ref
227
+ #stub_fetch_ref
99
228
 
100
229
  expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
101
- #{ASCIIDOC_BLANK_HDR}
230
+ #{ISOBIB_BLANK_HDR}
102
231
  [bibliography]
103
232
  == Normative References
104
233
 
105
- * [[[iso123,ISO/IEC 12382:1066]]] _Standard_
106
- * [[[iso124,ISO 124:1066-1067]]] _Standard_
234
+ * [[[iso123,ISO/IEC TR 12382:1992]]] _Standard_
235
+ * [[[iso124,ISO 124:2014]]] _Standard_
107
236
  INPUT
108
237
  #{BLANK_HDR}
109
238
  <sections>
110
239
 
111
240
  </sections><bibliography><references id="_" obligation="informative">
112
241
  <title>Normative References</title>
113
- <bibitem type="technicalReport" id="ISO/IEC12382">
114
- <title format="text/plain" language="en" script="Latn">Permuted index of the vocabulary of information technology -- -- </title>
115
- <title format="text/plain" language="fr" script="Latn">Index permuté du vocabulaire des technologies de l'information -- -- </title>
116
- <source type="src">https://www.iso.org/standard/21071.html</source>
117
- <source type="obp">https://www.iso.org/obp/ui/#!iso:std:21071:en</source>
118
- <source type="rss">https://www.iso.org/contents/data/standard/02/10/21071.detail.rss</source>
119
- <docidentifier>ISO/IEC 12382</docidentifier>
120
- <date type="published">
121
- <from>1992</from>
122
- </date>
123
- <contributor>
124
- <role type="publisher"/>
125
- <organization>
126
- <name>International Organization for Standardization</name>
127
- <abbreviation>ISO</abbreviation>
128
- <uri>www.iso.org</uri>
129
- </organization>
130
- </contributor>
131
- <contributor>
132
- <role type="publisher"/>
133
- <organization>
134
- <name>International Electrotechnical Commission</name>
135
- <abbreviation>IEC</abbreviation>
136
- <uri>www.iec.ch</uri>
137
- </organization>
138
- </contributor>
139
- <edition>2</edition>
140
- <language>en</language>
141
- <language>fr</language>
142
- <script>Latn</script>
143
- <abstract format="plain" language="en" script="Latn">Contains a permuted index of all terms included in the parts 1 - 28 of ISO 2382. If any of these parts has been revised, the present TR refers to the revision.</abstract>
144
- <status>Published</status>
145
- <copyright>
146
- <from>1992</from>
147
- <owner>
148
- <organization>
149
- <name>ISO/IEC</name>
150
- <abbreviation></abbreviation>
151
- </organization>
152
- </owner>
153
- </copyright>
154
- <relation type="updates">
155
- <bibitem>
156
- <formattedref>ISO/IEC TR 12382:1992</formattedref>
157
- <docidentifier>ISO/IEC TR 12382:1992</docidentifier>
158
- </bibitem>
159
- </relation>
160
- </bibitem>
161
- <bibitem type="international-standard" id="ISO124">
162
- <title format="text/plain" language="en" script="Latn">Latex, rubber -- Determination of total solids content -- </title>
163
- <title format="text/plain" language="fr" script="Latn">Latex de caoutchouc -- Détermination des matières solides totales -- </title>
164
- <source type="src">https://www.iso.org/standard/61884.html</source>
165
- <source type="obp">https://www.iso.org/obp/ui/#!iso:std:61884:en</source>
166
- <source type="rss">https://www.iso.org/contents/data/standard/06/18/61884.detail.rss</source>
167
- <docidentifier>ISO 124</docidentifier>
168
- <date type="published">
169
- <from>2014</from>
170
- </date>
171
- <contributor>
172
- <role type="publisher"/>
173
- <organization>
174
- <name>International Organization for Standardization</name>
175
- <abbreviation>ISO</abbreviation>
176
- <uri>www.iso.org</uri>
177
- </organization>
178
- </contributor>
179
- <edition>7</edition>
180
- <language>en</language>
181
- <language>fr</language>
182
- <script>Latn</script>
183
- <abstract format="plain" language="en" script="Latn">ISO 124:2014 specifies methods for the determination of the total solids content of natural rubber field and concentrated latices and synthetic rubber latex. These methods are not necessarily suitable for latex from natural sources other than the Hevea brasiliensis, for vulcanized latex, for compounded latex, or for artificial dispersions of rubber.</abstract>
184
- <abstract format="plain" language="fr" script="Latn">L'ISO 124:2014 spécifie des méthodes pour la détermination des matières solides totales dans le latex de plantation, le latex de concentré de caoutchouc naturel et le latex de caoutchouc synthétique. Ces méthodes ne conviennent pas nécessairement au latex d'origine naturelle autre que celui de l'Hevea brasiliensis, au latex vulcanisé, aux mélanges de latex, ou aux dispersions artificielles de caoutchouc.</abstract>
185
- <status>Published</status>
186
- <copyright>
187
- <from>2014</from>
188
- <owner>
189
- <organization>
190
- <name>ISO</name>
191
- <abbreviation/>
192
- </organization>
193
- </owner>
194
- </copyright>
195
- <relation type="obsoletes">
196
- <bibitem>
197
- <formattedref>ISO 124:2011</formattedref>
198
- <docidentifier>ISO 124:2011</docidentifier>
199
- </bibitem>
200
- </relation>
201
- </bibitem>
242
+ <bibitem type="international-standard" id="iso123">
243
+ <title format="text/plain" language="en" script="Latn">Permuted index of the vocabulary of information technology</title>
244
+ <title format="text/plain" language="fr" script="Latn">Index permuté du vocabulaire des technologies de l'information</title>
245
+ <source type="src">https://www.iso.org/standard/21071.html</source>
246
+ <source type="obp">https://www.iso.org/obp/ui/#!iso:std:21071:en</source>
247
+ <source type="rss">https://www.iso.org/contents/data/standard/02/10/21071.detail.rss</source>
248
+ <docidentifier>ISO/IEC 12382</docidentifier>
249
+ <date type="published">
250
+ <on>1992</on>
251
+ </date>
252
+ <contributor>
253
+ <role type="publisher"/>
254
+ <organization>
255
+ <name>International Organization for Standardization</name>
256
+ <abbreviation>ISO</abbreviation>
257
+ <uri>www.iso.org</uri>
258
+ </organization>
259
+ </contributor>
260
+ <contributor>
261
+ <role type="publisher"/>
262
+ <organization>
263
+ <name>International Electrotechnical Commission</name>
264
+ <abbreviation>IEC</abbreviation>
265
+ <uri>www.iec.ch</uri>
266
+ </organization>
267
+ </contributor>
268
+ <edition>2</edition>
269
+ <language>en</language>
270
+ <language>fr</language>
271
+ <script>Latn</script>
272
+ <abstract format="plain" language="en" script="Latn">Contains a permuted index of all terms included in the parts 1 - 28 of ISO 2382. If any of these parts has been revised, the present TR refers to the revision.</abstract>
273
+ <status>Published</status>
274
+ <copyright>
275
+ <from>1992</from>
276
+ <owner>
277
+ <organization>
278
+ <name>ISO/IEC</name>
279
+ <abbreviation/>
280
+ </organization>
281
+ </owner>
282
+ </copyright>
283
+ <relation type="updates">
284
+ <bibitem>
285
+ <formattedref>ISO/IEC TR 12382:1992</formattedref>
286
+ <docidentifier>ISO/IEC TR 12382:1992</docidentifier>
287
+ </bibitem>
288
+ </relation>
289
+ <ics>
290
+ <code>35.020</code>
291
+ <text>Information technology (IT) in general</text>
292
+ </ics>
293
+ <ics>
294
+ <code>01.040.35</code>
295
+ <text>Information technology (Vocabularies)</text>
296
+ </ics>
297
+ </bibitem>
298
+ <bibitem type="international-standard" id="iso124">
299
+ <title format="text/plain" language="en" script="Latn">Latex, rubber -- Determination of total solids content</title>
300
+ <title format="text/plain" language="fr" script="Latn">Latex de caoutchouc -- Détermination des matières solides totales</title>
301
+ <source type="src">https://www.iso.org/standard/61884.html</source>
302
+ <source type="obp">https://www.iso.org/obp/ui/#!iso:std:61884:en</source>
303
+ <source type="rss">https://www.iso.org/contents/data/standard/06/18/61884.detail.rss</source>
304
+ <docidentifier>ISO 124</docidentifier>
305
+ <date type="published">
306
+ <on>2014</on>
307
+ </date>
308
+ <contributor>
309
+ <role type="publisher"/>
310
+ <organization>
311
+ <name>International Organization for Standardization</name>
312
+ <abbreviation>ISO</abbreviation>
313
+ <uri>www.iso.org</uri>
314
+ </organization>
315
+ </contributor>
316
+ <edition>7</edition>
317
+ <language>en</language>
318
+ <language>fr</language>
319
+ <script>Latn</script>
320
+ <abstract format="plain" language="en" script="Latn">ISO 124:2014 specifies methods for the determination of the total solids content of natural rubber field and concentrated latices and synthetic rubber latex. These methods are not necessarily suitable for latex from natural sources other than the Hevea brasiliensis, for vulcanized latex, for compounded latex, or for artificial dispersions of rubber.</abstract>
321
+ <abstract format="plain" language="fr" script="Latn">L'ISO 124:2014 spécifie des méthodes pour la détermination des matières solides totales dans le latex de plantation, le latex de concentré de caoutchouc naturel et le latex de caoutchouc synthétique. Ces méthodes ne conviennent pas nécessairement au latex d'origine naturelle autre que celui de l'Hevea brasiliensis, au latex vulcanisé, aux mélanges de latex, ou aux dispersions artificielles de caoutchouc.</abstract>
322
+ <status>Published</status>
323
+ <copyright>
324
+ <from>2014</from>
325
+ <owner>
326
+ <organization>
327
+ <name>ISO</name>
328
+ <abbreviation/>
329
+ </organization>
330
+ </owner>
331
+ </copyright>
332
+ <relation type="obsoletes">
333
+ <bibitem>
334
+ <formattedref>ISO 124:2011</formattedref>
335
+ <docidentifier>ISO 124:2011</docidentifier>
336
+ </bibitem>
337
+ </relation>
338
+ <ics>
339
+ <code>83.040.10</code>
340
+ <text>Latex and raw rubber</text>
341
+ </ics>
342
+ </bibitem>
202
343
  </references>
203
344
  </bibliography>
204
345
  </iso-standard>
@@ -206,7 +347,7 @@ RSpec.describe Asciidoctor::ISO do
206
347
  end
207
348
 
208
349
  it "processes draft ISO reference" do
209
- stub_fetch_ref no_year: true, note: "The standard is in press"
350
+ #stub_fetch_ref no_year: true, note: "The standard is in press"
210
351
 
211
352
  expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
212
353
  #{ASCIIDOC_BLANK_HDR}
@@ -219,12 +360,8 @@ RSpec.describe Asciidoctor::ISO do
219
360
  <sections>
220
361
  </sections><bibliography><references id="_" obligation="informative">
221
362
  <title>Normative References</title>
222
- <bibitem type="international-standard" id="ISO123">
223
- <title format="text/plain" language="en" script="Latn">Rubber latex -- Sampling -- </title>
224
- <title format="text/plain" language="fr" script="Latn">Latex de caoutchouc -- Échantillonnage -- </title>
225
- <source type="src">https://www.iso.org/standard/23281.html</source>
226
- <source type="obp">https://www.iso.org/obp/ui/#!iso:std:23281:en</source>
227
- <source type="rss">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</source>
363
+ <bibitem id="iso123" type="standard">
364
+ <title format="text/plain">Standard</title>
228
365
  <docidentifier>ISO 123</docidentifier>
229
366
  <date type="published">
230
367
  <on>--</on>
@@ -234,35 +371,8 @@ RSpec.describe Asciidoctor::ISO do
234
371
  <organization>
235
372
  <name>International Organization for Standardization</name>
236
373
  <abbreviation>ISO</abbreviation>
237
- <uri>www.iso.org</uri>
238
374
  </organization>
239
375
  </contributor>
240
- <edition>3</edition>
241
- <language>en</language>
242
- <language>fr</language>
243
- <script>Latn</script>
244
- <status>Published</status>
245
- <copyright>
246
- <from>2001</from>
247
- <owner>
248
- <organization>
249
- <name>ISO</name>
250
- <abbreviation/>
251
- </organization>
252
- </owner>
253
- </copyright>
254
- <relation type="obsoletes">
255
- <bibitem>
256
- <formattedref>ISO 123:1985</formattedref>
257
- <docidentifier>ISO 123:1985</docidentifier>
258
- </bibitem>
259
- </relation>
260
- <relation type="updates">
261
- <bibitem>
262
- <formattedref>ISO 123:2001</formattedref>
263
- <docidentifier>ISO 123:2001</docidentifier>
264
- </bibitem>
265
- </relation>
266
376
  <note format="text/plain" reference="1">ISO DATE: The standard is in press</note>
267
377
  </bibitem>
268
378
  </references>
@@ -272,7 +382,7 @@ RSpec.describe Asciidoctor::ISO do
272
382
  end
273
383
 
274
384
  it "processes all-parts ISO reference" do
275
- stub_fetch_ref(all_parts: true)
385
+ #stub_fetch_ref(all_parts: true)
276
386
 
277
387
  expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
278
388
  #{ASCIIDOC_BLANK_HDR}
@@ -285,51 +395,21 @@ RSpec.describe Asciidoctor::ISO do
285
395
  <sections>
286
396
  </sections><bibliography><references id="_" obligation="informative">
287
397
  <title>Normative References</title>
288
- <bibitem type="international-standard" id="ISO123">
289
- <title format="text/plain" language="en" script="Latn">Rubber latex -- Sampling -- </title>
290
- <title format="text/plain" language="fr" script="Latn">Latex de caoutchouc -- Échantillonnage -- </title>
291
- <source type="src">https://www.iso.org/standard/23281.html</source>
292
- <source type="obp">https://www.iso.org/obp/ui/#!iso:std:23281:en</source>
293
- <source type="rss">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</source>
294
- <docidentifier>ISO 123:All Parts</docidentifier>
295
- <date type="published">
296
- <from>2001</from>
297
- </date>
298
- <contributor>
299
- <role type="publisher"/>
300
- <organization>
301
- <name>International Organization for Standardization</name>
302
- <abbreviation>ISO</abbreviation>
303
- <uri>www.iso.org</uri>
304
- </organization>
305
- </contributor>
306
- <edition>3</edition>
307
- <language>en</language>
308
- <language>fr</language>
309
- <script>Latn</script>
310
- <status>Published</status>
311
- <copyright>
312
- <from>2001</from>
313
- <owner>
314
- <organization>
315
- <name>ISO</name>
316
- <abbreviation/>
317
- </organization>
318
- </owner>
319
- </copyright>
320
- <relation type="obsoletes">
321
- <bibitem>
322
- <formattedref>ISO 123:1985</formattedref>
323
- <docidentifier>ISO 123:1985</docidentifier>
324
- </bibitem>
325
- </relation>
326
- <relation type="updates">
327
- <bibitem>
328
- <formattedref>ISO 123:2001</formattedref>
329
- <docidentifier>ISO 123:2001</docidentifier>
330
- </bibitem>
331
- </relation>
332
- </bibitem>
398
+ <bibitem id="iso123" type="standard">
399
+ <title format="text/plain">Standard</title>
400
+ <docidentifier>ISO 123</docidentifier>
401
+ <date type="published">
402
+ <on>1066</on>
403
+ </date>
404
+ <contributor>
405
+ <role type="publisher"/>
406
+ <organization>
407
+ <name>International Organization for Standardization</name>
408
+ <abbreviation>ISO</abbreviation>
409
+ </organization>
410
+ </contributor>
411
+ <allParts>true</allParts>
412
+ </bibitem>
333
413
  </references>
334
414
  </bibliography>
335
415
  </iso-standard>
@@ -391,7 +471,7 @@ RSpec.describe Asciidoctor::ISO do
391
471
  raise Algolia::AlgoliaProtocolError.new "getaddrinfo", "nodename nor servname provided, or not known (JCL49WV5AR-dsn.algolia.net:443)"
392
472
  end.at_least :once
393
473
  expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
394
- #{ASCIIDOC_BLANK_HDR}
474
+ #{ISOBIB_BLANK_HDR}
395
475
  [bibliography]
396
476
  == Normative References
397
477
 
@@ -407,7 +487,7 @@ RSpec.describe Asciidoctor::ISO do
407
487
 
408
488
  </title>
409
489
  <docidentifier>
410
- <project-number/>
490
+ <project-number>ISO </project-number>
411
491
  </docidentifier>
412
492
  <contributor>
413
493
  <role type="author"/>