metanorma-iso 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74f562a97f61ede014047ff5de43c57d8bb2533f5f6af5c66c5dffb6e1d3258d
4
- data.tar.gz: 8b1580aec30059481d83adf7332739af65e401829aafb0231733c38d108c1dc5
3
+ metadata.gz: 7e608abed8ce4aa5c4ca053f1f144fa46e1e613bdd4727054e2e55f86caf8fe4
4
+ data.tar.gz: c156d095288a2d586c0780fbca85b0fc775580ba9725b3ef4b821449e4a646fa
5
5
  SHA512:
6
- metadata.gz: 7a410beff5aa39e6d68283e207d16e9ee8d35e593bac34475aa8b8b22bc134dcf6394fc11dee3f5fc7495fb28ec3685167d5da848927d8ae8778e3b04ff76e7a
7
- data.tar.gz: 2e5a08f9f9d6da7bc9bf72fa0352324c38eaac424bc5decbf133550ed5adf662a1d8bcc944e1316809132a0528ca581d8511f73af12160d25049a7e35052488f
6
+ metadata.gz: 426a44d2e547b14919eda3726cd9c7df60f59122b94a3e50db3b2f783e2ade2552d142f138750b4601c90e429eaf2293c9e15e23f38fb1e5018e924cc348f4de
7
+ data.tar.gz: 6ac6979ee3394d59b80ad02e46d713eee22a2691c73334c95ec9f792b9e4cc450b95efa1866805ec77789d7f10b70e992d37676e0e3291483eeaddb82200f96a
@@ -44,6 +44,20 @@ module Asciidoctor
44
44
  result << "</iso-standard>"
45
45
  textcleanup(result)
46
46
  end
47
+
48
+ def load_yaml(lang, script)
49
+ y = if @i18nyaml then YAML.load_file(@i18nyaml)
50
+ elsif lang == "en"
51
+ YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
52
+ elsif lang == "fr"
53
+ YAML.load_file(File.join(File.dirname(__FILE__), "i18n-fr.yaml"))
54
+ elsif lang == "zh" && script == "Hans"
55
+ YAML.load_file(File.join(File.dirname(__FILE__), "i18n-zh-Hans.yaml"))
56
+ else
57
+ YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
58
+ end
59
+ super.merge(y)
60
+ end
47
61
  end
48
62
  end
49
63
  end
@@ -88,7 +88,7 @@ module Asciidoctor
88
88
  type = id['type'] if id
89
89
  title = bib&.at("./title[@type = 'main']")&.text ||
90
90
  bib&.at("./title")&.text || bib&.at("./formattedref")&.text
91
- "#{pubclass} :: #{num} :: #{type} :: #{id&.text} :: #{title}"
91
+ "#{pubclass} :: #{type} :: #{num.nil? ? "" : num % "09%d"} :: #{id&.text} :: #{title}"
92
92
  end
93
93
  end
94
94
  end
@@ -11,9 +11,9 @@ module Asciidoctor
11
11
  class Converter < Standoc::Converter
12
12
  def metadata_id(node, xml)
13
13
  iso_id(node, xml)
14
- node.attr("tc-docnumber") and
15
- xml.docidentifier(node.attr("tc-docnumber"),
16
- **attr_code(type: "iso-tc"))
14
+ node&.attr("tc-docnumber")&.split(/,\s*/)&.each do |n|
15
+ xml.docidentifier(n, **attr_code(type: "iso-tc"))
16
+ end
17
17
  xml.docnumber node&.attr("docnumber")
18
18
  end
19
19
 
@@ -45,14 +45,18 @@ module Asciidoctor
45
45
  dn
46
46
  end
47
47
 
48
+ def id_stage_abbr(stage, substage, node)
49
+ IsoDoc::Iso::Metadata.new("en", "Latn", {}).
50
+ stage_abbrev(stage, substage, node.attr("iteration"),
51
+ node.attr("draft"))
52
+ end
53
+
48
54
  def id_stage_prefix(dn, node)
49
55
  stage = get_stage(node)
50
56
  substage = get_substage(node)
51
57
  if stage && (stage.to_i < 60 || stage.to_i == 60 && substage.to_i < 60)
52
- abbr = IsoDoc::Iso::Metadata.new("en", "Latn", {}).
53
- stage_abbrev(stage, substage, node.attr("iteration"),
54
- node.attr("draft"))
55
- dn = "/#{abbr} #{dn}" # prefixes added in cleanup
58
+ abbr = id_stage_abbr(stage, substage, node)
59
+ dn = "/#{abbr} #{dn}" unless abbr.nil? || abbr.empty? # prefixes added in cleanup
56
60
  else
57
61
  dn += ":#{node.attr("copyright-year")}" if node.attr("copyright-year")
58
62
  end
@@ -4,8 +4,8 @@ term_def_boilerplate: |
4
4
 
5
5
  <ul>
6
6
  <li> <p>ISO Online browsing platform: available at
7
- <a href=http://www.iso.org/obp>http://www.iso.org/obp</a></p> </li>
7
+ <link target="http://www.iso.org/obp"/></p> </li>
8
8
  <li> <p>IEC Electropedia: available at
9
- <a href=http://www.electropedia.org>http://www.electropedia.org</a>
9
+ <link target="http://www.electropedia.org"/>
10
10
  </p> </li> </ul>
11
11
 
@@ -4,7 +4,7 @@ term_def_boilerplate: |
4
4
  suivantes:</p>
5
5
  <ul>
6
6
  <li> <p>ISO Online browsing platform: disponible à l'adresse
7
- <a href=http://www.iso.org/obp>http://www.iso.org/obp</a></p> </li>
7
+ <link target="http://www.iso.org/obp"/></p> </li>
8
8
  <li> <p>IEC Electropedia: disponible à l'adresse
9
- <a href=http://www.electropedia.org>http://www.electropedia.org</a>
9
+ <link target="http://www.electropedia.org"/>
10
10
  </p> </li> </ul>
@@ -2,7 +2,7 @@ term_def_boilerplate: |
2
2
  <p>ISO和IEC用于标准化的术语数据库地址如下:</p>
3
3
  <ul>
4
4
  <li> <p>ISO在线浏览平台:
5
- 位于<a href=http://www.iso.org/obp>http://www.iso.org/obp</a></p> </li>
5
+ 位于<link target="http://www.iso.org/obp"/></p></li>
6
6
  <li> <p>IEC Electropedia:
7
- 位于<a href=http://www.electropedia.org>http://www.electropedia.org</a>
7
+ 位于<link target="http://www.electropedia.org"/>
8
8
  </p> </li> </ul>
@@ -170,21 +170,6 @@ module IsoDoc
170
170
  def clausedelim
171
171
  ""
172
172
  end
173
-
174
- def load_yaml(lang, script)
175
- y = if @i18nyaml then YAML.load_file(@i18nyaml)
176
- elsif lang == "en"
177
- YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
178
- elsif lang == "fr"
179
- YAML.load_file(File.join(File.dirname(__FILE__), "i18n-fr.yaml"))
180
- elsif lang == "zh" && script == "Hans"
181
- YAML.load_file(File.join(File.dirname(__FILE__), "i18n-zh-Hans.yaml"))
182
- else
183
- YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
184
- end
185
- super.merge(y)
186
- end
187
-
188
173
  end
189
174
  end
190
175
  end
@@ -1,6 +1,8 @@
1
1
  <div id='toggle'> <span>•</span> </div>
2
- {% if tc_docnumber %}
3
- <p class="coverpage_docnumber">{{ tc_docnumber }}</p>
2
+ {% if tc_docnumber.size > 0 %}
3
+ {% for num in tc_docnumber %}
4
+ <p class="coverpage_docnumber">{{ num }}</p>
5
+ {% endfor %}
4
6
  {% else %}
5
7
  <p class="coverpage_docnumber">{{ docnumber }}(E) {{ draftinfo }}</p>
6
8
  {% endif %}
@@ -9,7 +11,7 @@
9
11
  <p class="coverpage_docnumber">Date: {{ revdate }}</p>
10
12
  {% endif %}
11
13
 
12
- {% if tc_docnumber %}
14
+ {% if tc_docnumber.size > 0 %}
13
15
  <p class="coverpage_docnumber">{{ docnumber }}(E) {{ draftinfo }}</p>
14
16
  {% endif %}
15
17
 
@@ -727,6 +727,10 @@ td.example p.MsoListParagraph {
727
727
  font-size: 10.0pt;
728
728
  }
729
729
 
730
+ div.example p.MsoListParagraph {
731
+ font-size: 10.0pt;
732
+ }
733
+
730
734
  span.note_label, span.example_label, td.example_label, td.note_label
731
735
  {
732
736
  font-size: 10.0pt;
@@ -1,7 +1,9 @@
1
- {% if tc_docnumber %}
1
+ {% if tc_docnumber.size > 0 %}
2
+ {% for num in tc_docnumber %}
2
3
  <p class="MsoNormal" align="right" style='text-align:right'><b style='mso-bidi-font-weight:
3
- normal'><span lang="EN-GB" style='font-size:14.0pt;mso-no-proof:yes'>{{ tc_docnumber }}</span></b><b
4
+ normal'><span lang="EN-GB" style='font-size:14.0pt;mso-no-proof:yes'>{{ num }}</span></b><b
4
5
  style='mso-bidi-font-weight:normal'><span lang="EN-GB" style='font-size:14.0pt'><o:p></o:p></span></b></p>
6
+ {% endfor %}
5
7
  {% else %}
6
8
  <p class="MsoNormal" align="right" style='text-align:right'><b style='mso-bidi-font-weight:
7
9
  normal'><span lang="EN-GB" style='font-size:14.0pt;mso-no-proof:yes'>{{ docnumber }}(E) {{ draftinfo }}</span></b><b
@@ -12,7 +14,7 @@ style='mso-bidi-font-weight:normal'><span lang="EN-GB" style='font-size:14.0pt'>
12
14
  <p class="MsoNormal" align="right" style='text-align:right'><span lang="EN-GB" style='mso-no-proof:yes'>Date: {{ revdate }}</span></p>
13
15
  {% endif %}
14
16
 
15
- {% if tc_docnumber %}
17
+ {% if tc_docnumber.size > 0 %}
16
18
  <p class="MsoNormal" align="right" style='text-align:right'><span lang="EN-GB" style='mso-no-proof:yes'>{{ docnumber }}(E) {{ draftinfo }}</span></p>
17
19
  {% endif %}
18
20
 
@@ -57,8 +57,8 @@ module IsoDoc
57
57
  def docid(isoxml, _out)
58
58
  dn = isoxml.at(ns("//bibdata/docidentifier[@type = 'iso']"))
59
59
  set(:docnumber, dn&.text)
60
- tcdn = isoxml.at(ns("//bibdata/docidentifier[@type = 'iso-tc']"))
61
- set(:tc_docnumber, tcdn&.text)
60
+ tcdn = isoxml.xpath(ns("//bibdata/docidentifier[@type = 'iso-tc']"))
61
+ set(:tc_docnumber, tcdn.map { |n| n.text })
62
62
  end
63
63
 
64
64
  # we don't leave this to i18n.rb, because we have both English and
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ISO
3
- VERSION = "1.3.0".freeze
3
+ VERSION = "1.3.1".freeze
4
4
  end
5
5
  end
@@ -177,7 +177,7 @@ RSpec.describe Asciidoctor::ISO do
177
177
  :no-isobib:
178
178
  :docnumber: 1000
179
179
  :partnumber: 1-1
180
- :tc-docnumber: 2000
180
+ :tc-docnumber: 2000, 2003
181
181
  :language: el
182
182
  :script: Grek
183
183
  :publisher: IEC,IETF,ISO
@@ -188,6 +188,7 @@ RSpec.describe Asciidoctor::ISO do
188
188
  <bibdata type="standard">
189
189
  <docidentifier type="iso">ISO/IEC/IETF 1000-1-1:2001</docidentifier>
190
190
  <docidentifier type="iso-tc">2000</docidentifier>
191
+ <docidentifier type="iso-tc">2003</docidentifier>
191
192
  <docnumber>1000</docnumber>
192
193
  <contributor>
193
194
  <role type="author"/>
@@ -113,6 +113,7 @@ RSpec.describe Asciidoctor::ISO do
113
113
  <sections>
114
114
  <terms id="_" obligation="normative">
115
115
  <title>Terms and definitions</title>
116
+ #{TERM_BOILERPLATE}
116
117
  <term id="_">
117
118
  <preferred>Term1</preferred>
118
119
  <termnote id="_">
@@ -222,6 +223,7 @@ RSpec.describe Asciidoctor::ISO do
222
223
  <sections>
223
224
  <terms id="_" obligation="normative">
224
225
  <title>Terms and definitions</title>
226
+ #{TERM_BOILERPLATE}
225
227
  <term id="_">
226
228
  <preferred>Term1</preferred>
227
229
  <termexample id="_">
@@ -422,6 +424,7 @@ RSpec.describe Asciidoctor::ISO do
422
424
  <sections>
423
425
  <terms id="_" obligation="normative">
424
426
  <title>Terms and definitions</title>
427
+ #{TERM_BOILERPLATE}
425
428
  <term id="_">
426
429
  <preferred>Term1</preferred>
427
430
  <termsource status="identical">
@@ -448,6 +451,7 @@ RSpec.describe Asciidoctor::ISO do
448
451
  <sections>
449
452
  <terms id="_" obligation="normative">
450
453
  <title>Terms and definitions</title>
454
+ #{TERM_BOILERPLATE}
451
455
  <term id="_">
452
456
  <preferred>Term1</preferred>
453
457
  <termsource status="modified">
@@ -31,6 +31,7 @@ RSpec.describe Asciidoctor::ISO do
31
31
  <sections>
32
32
  <terms id="_" obligation="normative">
33
33
  <title>Terms and definitions</title>
34
+ #{TERM_BOILERPLATE}
34
35
  <term id="_"><preferred><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mn>90</mn></msub></math></stem></preferred><admitted><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mn>91</mn></msub></math></stem></admitted>
35
36
  <definition><p id="_">Time</p></definition></term>
36
37
  </terms>
@@ -52,6 +53,7 @@ RSpec.describe Asciidoctor::ISO do
52
53
  <sections>
53
54
  <terms id="_" obligation="normative">
54
55
  <title>Terms and definitions</title>
56
+ #{TERM_BOILERPLATE}
55
57
  <term id="_">
56
58
  <preferred>Tempus</preferred>
57
59
  <domain>relativity</domain><definition><p id="_"> Time</p></definition>
@@ -87,6 +89,7 @@ RSpec.describe Asciidoctor::ISO do
87
89
  <sections>
88
90
  <terms id="_" obligation="normative">
89
91
  <title>Terms and definitions</title>
92
+ #{TERM_BOILERPLATE}
90
93
  <term id="_"><preferred><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mn>90</mn></msub></math></stem></preferred><definition><formula id="_">
91
94
  <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mi>A</mi></msub></math></stem>
92
95
  </formula><p id="_">This paragraph is extraneous</p></definition>
@@ -114,6 +117,7 @@ RSpec.describe Asciidoctor::ISO do
114
117
  <sections>
115
118
  <terms id="_" obligation="normative"><title>Terms and definitions</title>
116
119
 
120
+ #{TERM_BOILERPLATE}
117
121
  <term id="_">
118
122
  <preferred>Time</preferred>
119
123
  <definition><p id="_">This paragraph is extraneous</p></definition>
@@ -188,6 +192,7 @@ r = 1 %</stem>
188
192
  </foreword></preface><sections>
189
193
  </sections><bibliography><references id="_" obligation="informative">
190
194
  <title>Normative References</title>
195
+ <p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
191
196
  <bibitem id="iso216" type="standard">
192
197
  <title format="text/plain">Reference</title>
193
198
  <docidentifier>ISO 216:2001</docidentifier>
@@ -226,6 +231,7 @@ r = 1 %</stem>
226
231
  </foreword></preface><sections>
227
232
  </sections><bibliography><references id="_" obligation="informative">
228
233
  <title>Normative References</title>
234
+ <p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
229
235
  <bibitem id="iso216" type="standard">
230
236
  <title format="text/plain">Reference</title>
231
237
  <docidentifier>ISO 216</docidentifier>
@@ -293,6 +299,7 @@ r = 1 %</stem>
293
299
  <sections>
294
300
  <terms id="_" obligation="normative">
295
301
  <title>Terms and definitions</title>
302
+ #{TERM_BOILERPLATE}
296
303
  <term id="_">
297
304
  <preferred>Term1</preferred>
298
305
  <termsource status="identical">
@@ -318,6 +325,7 @@ r = 1 %</stem>
318
325
  #{BLANK_HDR}
319
326
  <sections></sections>
320
327
  <bibliography><references id="_" obligation="informative"><title>Normative References</title>
328
+ <p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
321
329
  <bibitem id="iso216" type="standard">
322
330
  <title format="text/plain">Reference</title>
323
331
  <docidentifier>ISO 216</docidentifier>
@@ -655,6 +663,7 @@ r = 1 %</stem>
655
663
  </p>
656
664
  </clause></sections><bibliography><references id="_" obligation="informative">
657
665
  <title>Normative References</title>
666
+ <p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
658
667
  <bibitem id="iso123" type="standard">
659
668
  <title format="text/plain">Standard</title>
660
669
  <docidentifier>ISO 123:—</docidentifier>
@@ -129,6 +129,7 @@ RSpec.describe Asciidoctor::ISO do
129
129
 
130
130
  </sections><bibliography><references id="_" obligation="informative">
131
131
  <title>Normative References</title>
132
+ <p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
132
133
  <bibitem id="ISO712">
133
134
  <formattedref format="application/x-isodoc+xml">Reference</formattedref>
134
135
  <docidentifier>x</docidentifier>
@@ -17,6 +17,7 @@ RSpec.describe Asciidoctor::ISO do
17
17
  <sections>
18
18
  </sections><bibliography><references id="_" obligation="informative">
19
19
  <title>Normative References</title>
20
+ <p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
20
21
  <bibitem id="iso123" type="standard">
21
22
  <title format="text/plain">Standard</title>
22
23
  <docidentifier>ISO 123:—</docidentifier>
@@ -52,6 +53,7 @@ RSpec.describe Asciidoctor::ISO do
52
53
  <sections>
53
54
  </sections><bibliography><references id="_" obligation="informative">
54
55
  <title>Normative References</title>
56
+ <p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
55
57
  <bibitem id="iso123" type="standard">
56
58
  <title format="text/plain">Standard</title>
57
59
  <docidentifier>ISO 123:1066 (all parts)</docidentifier>
@@ -86,6 +88,7 @@ RSpec.describe Asciidoctor::ISO do
86
88
 
87
89
  </sections><bibliography><references id="_" obligation="informative">
88
90
  <title>Normative References</title>
91
+ <p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
89
92
  <bibitem id="iso123">
90
93
  <formattedref format="application/x-isodoc+xml">
91
94
  <em>Standard</em>
@@ -67,6 +67,17 @@ RSpec.describe Asciidoctor::ISO do
67
67
 
68
68
  <terms id="_" obligation="normative">
69
69
  <title>Terms and definitions</title>
70
+ <p>For the purposes of this document, the following terms and definitions apply.</p>
71
+ <p>ISO and IEC maintain terminological databases for use in
72
+ standardization at the following addresses:</p>
73
+
74
+ <ul>
75
+ <li> <p>ISO Online browsing platform: available at
76
+ <link target="http://www.iso.org/obp"/></p> </li>
77
+ <li> <p>IEC Electropedia: available at
78
+ <link target="http://www.electropedia.org"/>
79
+ </p> </li> </ul>
80
+
70
81
  <term id="_">
71
82
  <preferred>Term1</preferred>
72
83
  </term>
@@ -99,6 +110,7 @@ RSpec.describe Asciidoctor::ISO do
99
110
  <title>Appendix 1</title>
100
111
  </appendix></annex><bibliography><references id="_" obligation="informative">
101
112
  <title>Normative References</title>
113
+ <p>There are no normative references in this document.</p>
102
114
  </references><clause id="_" obligation="informative">
103
115
  <title>Bibliography</title>
104
116
  <references id="_" obligation="informative">
@@ -186,6 +198,16 @@ RSpec.describe Asciidoctor::ISO do
186
198
 
187
199
  <terms id="_" obligation="normative">
188
200
  <title>Terms and definitions</title>
201
+ <p>For the purposes of this document, the following terms and definitions apply.</p>
202
+ <p>ISO and IEC maintain terminological databases for use in
203
+ standardization at the following addresses:</p>
204
+
205
+ <ul>
206
+ <li> <p>ISO Online browsing platform: available at
207
+ <link target="http://www.iso.org/obp"/></p> </li>
208
+ <li> <p>IEC Electropedia: available at
209
+ <link target="http://www.electropedia.org"/>
210
+ </p> </li> </ul>
189
211
  <term id="_">
190
212
  <preferred>Term1</preferred>
191
213
  </term>
@@ -219,6 +241,7 @@ RSpec.describe Asciidoctor::ISO do
219
241
  <title>Appendx 1</title>
220
242
  </appendix></annex><bibliography><references id="_" obligation="informative">
221
243
  <title>Normative References</title>
244
+ <p>There are no normative references in this document.</p>
222
245
  </references><clause id="_" obligation="informative">
223
246
  <title>Bibliography</title>
224
247
  <references id="_" obligation="informative">
@@ -312,7 +335,80 @@ RSpec.describe Asciidoctor::ISO do
312
335
  OUTPUT
313
336
  end
314
337
 
315
- it "processes term document sources" do
338
+ it "processes terms & definitions with external source" do
339
+ expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
340
+ #{ASCIIDOC_BLANK_HDR}
341
+
342
+ Foreword
343
+
344
+ [source="iso1234,iso5678"]
345
+ == Terms and Definitions
346
+
347
+ === Term1
348
+
349
+ INPUT
350
+ #{BLANK_HDR}
351
+ <termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/>
352
+ <preface><foreword obligation="informative">
353
+ <title>Foreword</title>
354
+ <p id="_">Foreword</p>
355
+ </foreword></preface><sections>
356
+ <terms id="_" obligation="normative">
357
+ <title>Terms and definitions</title><p>For the purposes of this document, the terms and definitions
358
+ given in <eref bibitem="iso1234"/> and <eref bibitem="iso5678"/> and the following apply.</p>
359
+ <p>ISO and IEC maintain terminological databases for use in
360
+ standardization at the following addresses:</p>
361
+
362
+ <ul>
363
+ <li> <p>ISO Online browsing platform: available at
364
+ <link target="http://www.iso.org/obp"/></p> </li>
365
+ <li> <p>IEC Electropedia: available at
366
+ <link target="http://www.electropedia.org"/>
367
+ </p> </li> </ul>
368
+
369
+ <term id="_">
370
+ <preferred>Term1</preferred>
371
+ </term>
372
+ </terms></sections>
373
+ </standard-document>
374
+
375
+ OUTPUT
376
+ end
377
+
378
+ it "processes empty terms & definitions" do
379
+ expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
380
+ #{ASCIIDOC_BLANK_HDR}
381
+
382
+ Foreword
383
+
384
+ == Terms and Definitions
385
+
386
+
387
+ INPUT
388
+ #{BLANK_HDR}
389
+ <preface><foreword obligation="informative">
390
+ <title>Foreword</title>
391
+ <p id="_">Foreword</p>
392
+ </foreword></preface><sections>
393
+ <terms id="_" obligation="normative">
394
+ <title>Terms and definitions</title><p>No terms and definitions are listed in this document.</p>
395
+ <p>ISO and IEC maintain terminological databases for use in
396
+ standardization at the following addresses:</p>
397
+
398
+ <ul>
399
+ <li> <p>ISO Online browsing platform: available at
400
+ <link target="http://www.iso.org/obp"/></p> </li>
401
+ <li> <p>IEC Electropedia: available at
402
+ <link target="http://www.electropedia.org"/>
403
+ </p> </li> </ul>
404
+
405
+ </terms></sections>
406
+ </iso-document>
407
+
408
+ OUTPUT
409
+ end
410
+
411
+ it "processes empty terms & definitions with external source" do
316
412
  expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
317
413
  #{ASCIIDOC_BLANK_HDR}
318
414
 
@@ -330,10 +426,22 @@ RSpec.describe Asciidoctor::ISO do
330
426
  </foreword></preface><sections>
331
427
  <terms id="_" obligation="normative">
332
428
  <title>Terms and definitions</title>
429
+ <p>For the purposes of this document,
430
+ the terms and definitions given in <eref bibitem="iso1234"/> and <eref bibitem="iso5678"/> apply.</p>
431
+ <p>ISO and IEC maintain terminological databases for use in
432
+ standardization at the following addresses:</p>
433
+
434
+ <ul>
435
+ <li> <p>ISO Online browsing platform: available at
436
+ <link target="http://www.iso.org/obp"/></p> </li>
437
+ <li> <p>IEC Electropedia: available at
438
+ <link target="http://www.electropedia.org"/>
439
+ </p> </li> </ul>
440
+
333
441
 
334
442
 
335
443
  </terms></sections>
336
- </iso-standard>
444
+ </iso-document>
337
445
 
338
446
  OUTPUT
339
447
  end