metanorma-standoc 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/macos.yml +0 -7
  3. data/.github/workflows/ubuntu.yml +6 -11
  4. data/.github/workflows/windows.yml +0 -8
  5. data/.rubocop.yml +1 -1
  6. data/Rakefile +2 -0
  7. data/lib/asciidoctor/standoc/base.rb +28 -27
  8. data/lib/asciidoctor/standoc/biblio.rng +1 -1
  9. data/lib/asciidoctor/standoc/blocks.rb +25 -95
  10. data/lib/asciidoctor/standoc/blocks_notes.rb +89 -0
  11. data/lib/asciidoctor/standoc/cleanup.rb +10 -6
  12. data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +11 -24
  13. data/lib/asciidoctor/standoc/cleanup_inline.rb +1 -1
  14. data/lib/asciidoctor/standoc/cleanup_ref.rb +47 -1
  15. data/lib/asciidoctor/standoc/cleanup_section.rb +72 -5
  16. data/lib/asciidoctor/standoc/cleanup_terms.rb +10 -0
  17. data/lib/asciidoctor/standoc/converter.rb +16 -2
  18. data/lib/asciidoctor/standoc/inline.rb +1 -1
  19. data/lib/asciidoctor/standoc/isodoc.rng +439 -6
  20. data/lib/asciidoctor/standoc/lists.rb +12 -12
  21. data/lib/asciidoctor/standoc/macros_yaml2text.rb +32 -15
  22. data/lib/asciidoctor/standoc/ref.rb +75 -34
  23. data/lib/asciidoctor/standoc/reqt.rb +11 -6
  24. data/lib/asciidoctor/standoc/reqt.rng +23 -0
  25. data/lib/asciidoctor/standoc/section.rb +27 -25
  26. data/lib/asciidoctor/standoc/table.rb +3 -2
  27. data/lib/asciidoctor/standoc/utils.rb +16 -0
  28. data/lib/asciidoctor/standoc/views/datamodel/model_representation.adoc.erb +1 -1
  29. data/lib/metanorma/standoc/processor.rb +5 -7
  30. data/lib/metanorma/standoc/version.rb +1 -1
  31. data/metanorma-standoc.gemspec +3 -2
  32. data/spec/asciidoctor-standoc/base_spec.rb +3 -2
  33. data/spec/asciidoctor-standoc/blocks_spec.rb +68 -32
  34. data/spec/asciidoctor-standoc/cleanup_spec.rb +1221 -17
  35. data/spec/asciidoctor-standoc/datamodel/attributes_table_preprocessor_spec.rb +35 -0
  36. data/spec/asciidoctor-standoc/inline_spec.rb +3 -3
  37. data/spec/asciidoctor-standoc/isobib_cache_spec.rb +4 -4
  38. data/spec/asciidoctor-standoc/lists_spec.rb +7 -5
  39. data/spec/asciidoctor-standoc/macros_spec.rb +4 -3
  40. data/spec/asciidoctor-standoc/refs_dl_spec.rb +8 -6
  41. data/spec/asciidoctor-standoc/refs_spec.rb +275 -30
  42. data/spec/asciidoctor-standoc/section_spec.rb +42 -38
  43. data/spec/asciidoctor-standoc/table_spec.rb +3 -3
  44. data/spec/asciidoctor-standoc/validate_spec.rb +56 -0
  45. data/spec/assets/{html.css → html.scss} +0 -0
  46. data/spec/assets/i18n.yaml +17 -2
  47. data/spec/assets/iso123.rxl +107 -0
  48. data/spec/assets/{word.css → word.scss} +0 -0
  49. data/spec/examples/datamodel/blank_definition_profile.adoc +4 -0
  50. data/spec/examples/datamodel/models/models/{Signature copy.yml → SignatureBlankDefinition.yml} +2 -2
  51. data/spec/fixtures/macros_datamodel/blank_definition_profile.xml +51 -0
  52. data/spec/metanorma/processor_spec.rb +5 -6
  53. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +83 -83
  54. data/spec/vcr_cassettes/isobib_get_123.yml +19 -198
  55. data/spec/vcr_cassettes/isobib_get_123_1.yml +361 -0
  56. data/spec/vcr_cassettes/isobib_get_123_2001.yml +19 -19
  57. data/spec/vcr_cassettes/isobib_get_124.yml +21 -21
  58. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +10 -10
  59. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +42 -42
  60. metadata +32 -18
  61. data/lib/asciidoctor-yaml/i18n-en.yaml +0 -20
  62. data/lib/asciidoctor-yaml/i18n-fr.yaml +0 -13
  63. data/lib/asciidoctor-yaml/i18n-zh-Hans.yaml +0 -15
  64. data/lib/asciidoctor/standoc/i18n.rb +0 -39
@@ -72,5 +72,40 @@ RSpec.describe Asciidoctor::Standoc::Datamodel::AttributesTablePreprocessor do
72
72
  .to(be_equivalent_to(xmlpp(output)))
73
73
  end
74
74
  end
75
+
76
+ context 'when missing definition' do
77
+ let(:datamodel_file) do
78
+ examples_path('datamodel/blank_definition_profile.adoc')
79
+ end
80
+ let(:result_file) do
81
+ examples_path('datamodel/blank_definition_profile.xml')
82
+ end
83
+ let(:output) do
84
+ path = fixtures_path('macros_datamodel/blank_definition_profile.xml')
85
+ [
86
+ BLANK_HDR,
87
+ File.read(path)
88
+ ].join("\n")
89
+ end
90
+
91
+ after do
92
+ %w[doc html xml err].each do |extention|
93
+ path = examples_path(
94
+ "datamodel/blank_definition_profile.#{extention}"
95
+ )
96
+ FileUtils.rm_f(path)
97
+ FileUtils.rm_f("blank_definition_profile.#{extention}")
98
+ end
99
+ end
100
+
101
+ it 'correctly renders input' do
102
+ Asciidoctor.convert_file(datamodel_file,
103
+ backend: :standoc,
104
+ safe: :safe,
105
+ header_footer: true)
106
+ expect(xmlpp(strip_guid(File.read(result_file))))
107
+ .to(be_equivalent_to(xmlpp(output)))
108
+ end
109
+ end
75
110
  end
76
111
  end
@@ -88,7 +88,7 @@ text, including <strong><em>nest</em></strong>ed markup.</p>
88
88
  <sections>
89
89
  <p id="_">
90
90
  <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>n</mi><mo>&lt;</mo><mn>1</mn></math></stem><br/>
91
- <stem type="MathML"> <math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> <mrow> <mi>n</mi> <mo>&lt;</mo> <mn>1</mn> </mrow> </math></stem>
91
+ <stem type="MathML"> <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mi>n</mi> <mo>&lt;</mo> <mn>1</mn> </mrow> </math></stem>
92
92
  </p>
93
93
  </sections>
94
94
  </standard-document>
@@ -106,7 +106,7 @@ text, including <strong><em>nest</em></strong>ed markup.</p>
106
106
  <sections>
107
107
  <p id="_">
108
108
  <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>n</mi><mo>&lt;</mo><mn>1</mn></math></stem>
109
- <stem type="MathML"> <math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> <mrow> <mi>n</mi> <mo>&lt;</mo> <mn>1</mn> </mrow> </math></stem>
109
+ <stem type="MathML"> <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mi>n</mi> <mo>&lt;</mo> <mn>1</mn> </mrow> </math></stem>
110
110
  </p>
111
111
  </sections>
112
112
  </standard-document>
@@ -232,7 +232,7 @@ text, including <strong><em>nest</em></strong>ed markup.</p>
232
232
  <sections>
233
233
 
234
234
  </sections><bibliography><references id="_" obligation="informative" normative="true">
235
- <title>Normative References</title>
235
+ <title>Normative references</title>
236
236
  <p id="_">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>
237
237
  <bibitem id="ISO712">
238
238
  <formattedref format="application/x-isodoc+xml">Reference</formattedref>
@@ -47,10 +47,10 @@ EOS
47
47
  <fetched>#{Date.today}</fetched>
48
48
  <title type="title-intro" format="text/plain" language="en" script="Latn">Latex, rubber</title>
49
49
  <title type="title-main" format="text/plain" language="en" script="Latn">Determination of total solids content</title>
50
- <title type="main" format="text/plain" language="en" script="Latn">Latex, rubber Determination of total solids content</title>
50
+ <title type='main' format='text/plain' language='en' script='Latn'>Latex, rubber - Determination of total solids content</title>
51
51
  <title type="title-intro" format="text/plain" language="fr" script="Latn">Latex de caoutchouc</title>
52
52
  <title type="title-main" format="text/plain" language="fr" script="Latn">Détermination des matières solides totales</title>
53
- <title type="main" format="text/plain" language="fr" script="Latn">Latex de caoutchouc Détermination des matières solides totales</title>
53
+ <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc - Détermination des matières solides totales</title>
54
54
  <uri type="src">https://www.iso.org/standard/61884.html</uri>
55
55
  <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:61884:en</uri>
56
56
  <uri type="rss">https://www.iso.org/contents/data/standard/06/18/61884.detail.rss</uri>
@@ -217,10 +217,10 @@ EOS
217
217
  <fetched>#{Date.today}</fetched>
218
218
  <title type="title-intro" format="text/plain" language="en" script="Latn">Rubber latex</title>
219
219
  <title type="title-main" format="text/plain" language="en" script="Latn">Sampling</title>
220
- <title type="main" format="text/plain" language="en" script="Latn">Rubber latex Sampling</title>
220
+ <title type='main' format='text/plain' language='en' script='Latn'>Rubber latex - Sampling</title>
221
221
  <title type="title-intro" format="text/plain" language="fr" script="Latn">Latex de caoutchouc</title>
222
222
  <title type="title-main" format="text/plain" language="fr" script="Latn">Échantillonnage</title>
223
- <title type="main" format="text/plain" language="fr" script="Latn">Latex de caoutchouc Échantillonnage</title>
223
+ <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc - Échantillonnage</title>
224
224
  <uri type="src">https://www.iso.org/standard/23281.html</uri>
225
225
  <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
226
226
  <uri type="rss">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
@@ -73,6 +73,7 @@ RSpec.describe Asciidoctor::Standoc do
73
73
  output = Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
74
74
  #{ASCIIDOC_BLANK_HDR}
75
75
  [[id]]
76
+ [keep-with-next=true,keep-lines-together=true]
76
77
  * First
77
78
  * Second
78
79
  +
@@ -83,6 +84,7 @@ RSpec.describe Asciidoctor::Standoc do
83
84
  --
84
85
 
85
86
  [[id1]]
87
+ [keep-with-next=true,keep-lines-together=true]
86
88
  [loweralpha]
87
89
  . First
88
90
  . Second
@@ -101,8 +103,7 @@ RSpec.describe Asciidoctor::Standoc do
101
103
  [arabic]
102
104
  ... E
103
105
  ... F
104
-
105
-
106
+ [keep-with-next=true,keep-lines-together=true]
106
107
  Notes1::
107
108
  Notes:: Note 1.
108
109
  +
@@ -113,14 +114,14 @@ RSpec.describe Asciidoctor::Standoc do
113
114
  INPUT
114
115
  expect(xmlpp(strip_guid(output))).to be_equivalent_to xmlpp(<<~"OUTPUT")
115
116
  #{BLANK_HDR}
116
- <sections><ul id="id">
117
+ <sections><ul id="id" keep-with-next="true" keep-lines-together="true">
117
118
  <li>
118
119
  <p id="_">First</p>
119
120
  </li>
120
121
  <li><p id="_">Second</p><p id="_">entry1</p>
121
122
  <p id="_">entry2</p></li>
122
123
  </ul>
123
- <ol id="id1" type="alphabet">
124
+ <ol id="id1" type="alphabet" keep-with-next="true" keep-lines-together="true">
124
125
  <li>
125
126
  <p id="_">First</p>
126
127
  </li>
@@ -160,7 +161,8 @@ RSpec.describe Asciidoctor::Standoc do
160
161
  </li>
161
162
  <li>
162
163
  <p id="_">F</p>
163
- <dl id="_">
164
+
165
+ <dl id="_" keep-with-next="true" keep-lines-together="true">
164
166
  <dt>Notes1</dt>
165
167
  <dd/>
166
168
  <dt>Notes</dt>
@@ -223,7 +223,7 @@ OUTPUT
223
223
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
224
224
  #{ASCIIDOC_BLANK_HDR}
225
225
 
226
- [pseudocode,subsequence="A"]
226
+ [pseudocode,subsequence="A",number="3",keep-with-next=true,keep-lines-together=true]
227
227
  [%unnumbered]
228
228
  ====
229
229
  *A* +
@@ -234,7 +234,8 @@ OUTPUT
234
234
  INPUT
235
235
  #{BLANK_HDR}
236
236
  <sections>
237
- <figure id="_" subsequence='A' class="pseudocode" unnumbered="true"><p id="_">  <strong>A</strong><br/>
237
+ <figure id="_" subsequence='A' class="pseudocode" unnumbered="true" number="3" keep-with-next="true" keep-lines-together="true">
238
+ <p id="_">  <strong>A</strong><br/>
238
239
          <smallcap>B</smallcap></p>
239
240
  <p id="_">  <em>C</em></p></figure>
240
241
  </sections>
@@ -296,7 +297,7 @@ OUTPUT
296
297
  <mi>X</mi>
297
298
  <mo>¯</mo>
298
299
  </mover>
299
- <mi>'</mi>
300
+ <mo>′</mo>
300
301
  <mo>=</mo>
301
302
  <mfrac>
302
303
  <mn>1</mn>
@@ -39,11 +39,12 @@ RSpec.describe Asciidoctor::Standoc do
39
39
  #{BLANK_HDR}
40
40
  <sections>
41
41
  </sections><bibliography><references id="_" obligation="informative" normative="true">
42
- <title>Normative References</title>
42
+ <title>Normative references</title>
43
43
  #{NORM_REF_BOILERPLATE}
44
44
  <bibitem id="iso123" type="standard">
45
45
  <fetched>#{Date.today}</fetched>
46
- <title type="main" format="text/plain" language="en" script="Latn">Standard</title>
46
+ <title type='title-main' format='text/plain'>Standard</title>
47
+ <title type='main' format='text/plain'>Standard</title>
47
48
  <docidentifier type="ISO">ISO 123</docidentifier>
48
49
  <contributor>
49
50
  <role type="publisher"/>
@@ -288,7 +289,7 @@ formattedref::
288
289
  #{BLANK_HDR}
289
290
  <sections>
290
291
  </sections><bibliography><references id="_" obligation="informative" normative="true">
291
- <title>Normative References</title>
292
+ <title>Normative references</title>
292
293
  #{NORM_REF_BOILERPLATE}
293
294
  <bibitem id="TC211" type="standard">
294
295
  <fetched>2019-06-30</fetched>
@@ -606,7 +607,7 @@ series.formattedref.script:: Latn
606
607
  #{BLANK_HDR}
607
608
  <sections>
608
609
  </sections><bibliography><references id="_" obligation="informative" normative="true">
609
- <title>Normative References</title>
610
+ <title>Normative references</title>
610
611
  #{NORM_REF_BOILERPLATE}
611
612
  <bibitem id="TC211" type="standard">
612
613
  <fetched>2019-06-30</fetched>
@@ -806,14 +807,15 @@ OUTPUT
806
807
  <title>Subsection</title>
807
808
  </clause>
808
809
  <references id='_' obligation='informative' normative="true">
809
- <title>Normative References</title>
810
+ <title>Normative references</title>
810
811
  <bibitem id='A'>
811
812
  <formattedref format='application/x-isodoc+xml'>Title</formattedref>
812
813
  <docidentifier>B</docidentifier>
813
814
  </bibitem>
814
815
  <bibitem id='iso123' type='standard'>
815
816
  <fetched>#{Date.today.to_s}</fetched>
816
- <title type='main' format='text/plain' language='en' script='Latn'>Standard</title>
817
+ <title type='title-main' format='text/plain'>Standard</title>
818
+ <title type='main' format='text/plain'>Standard</title>
817
819
  <docidentifier type='ISO'>ISO 123</docidentifier>
818
820
  <contributor>
819
821
  <role type='publisher'/>
@@ -15,7 +15,7 @@ RSpec.describe Asciidoctor::Standoc do
15
15
  #{BLANK_HDR}
16
16
  <sections>
17
17
  </sections><bibliography><references id="_" obligation="informative" normative="true">
18
- <title>Normative References</title>
18
+ <title>Normative references</title>
19
19
  #{NORM_REF_BOILERPLATE}
20
20
  <bibitem id="iso123" type="standard">
21
21
  <title format="text/plain">Standard</title>
@@ -58,7 +58,7 @@ RSpec.describe Asciidoctor::Standoc do
58
58
  #{BLANK_HDR}
59
59
  <sections>
60
60
  </sections><bibliography><references id="_" obligation="informative" normative="true">
61
- <title>Normative References</title>
61
+ <title>Normative references</title>
62
62
  #{NORM_REF_BOILERPLATE}
63
63
  <bibitem id="iso123" type="standard">
64
64
  <title format="text/plain">Standard</title>
@@ -125,7 +125,7 @@ RSpec.describe Asciidoctor::Standoc do
125
125
  </foreword>
126
126
  </preface>
127
127
  <sections>
128
- </sections><bibliography><references id="_" obligation="informative" normative="true"><title>Normative References</title>
128
+ </sections><bibliography><references id="_" obligation="informative" normative="true"><title>Normative references</title>
129
129
  #{NORM_REF_BOILERPLATE}
130
130
  <bibitem type="standard" id="iso123">
131
131
  <uri type="src">https://www.iso.org/standard/23281.html</uri>
@@ -224,7 +224,7 @@ RSpec.describe Asciidoctor::Standoc do
224
224
 
225
225
  it "fetches simple ISO reference" do
226
226
  # mock_isobib_get_123
227
- VCR.use_cassette "isobib_get_123" do
227
+ VCR.use_cassette "isobib_get_123_1" do
228
228
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp( <<~"OUTPUT")
229
229
  #{ISOBIB_BLANK_HDR}
230
230
  [bibliography]
@@ -236,7 +236,7 @@ RSpec.describe Asciidoctor::Standoc do
236
236
  #{BLANK_HDR}
237
237
  <sections>
238
238
 
239
- </sections><bibliography><references id="_" obligation="informative" normative="true"><title>Normative References</title>
239
+ </sections><bibliography><references id="_" obligation="informative" normative="true"><title>Normative references</title>
240
240
  #{NORM_REF_BOILERPLATE}
241
241
  <bibitem id='iso123' type='standard'>
242
242
  <fetched>#{Date.today}</fetched>
@@ -288,10 +288,10 @@ RSpec.describe Asciidoctor::Standoc do
288
288
  <fetched>#{Date.today}</fetched>
289
289
  <title type='title-intro' format='text/plain' language='en' script='Latn'>Rubber latex</title>
290
290
  <title type='title-main' format='text/plain' language='en' script='Latn'>Sampling</title>
291
- <title type='main' format='text/plain' language='en' script='Latn'>Rubber latexSampling</title>
291
+ <title type='main' format='text/plain' language='en' script='Latn'>Rubber latex — Sampling</title>
292
292
  <title type='title-intro' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc</title>
293
293
  <title type='title-main' format='text/plain' language='fr' script='Latn'>Échantillonnage</title>
294
- <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchoucÉchantillonnage</title>
294
+ <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc — Échantillonnage</title>
295
295
  <uri type='src'>https://www.iso.org/standard/23281.html</uri>
296
296
  <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
297
297
  <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
@@ -395,10 +395,10 @@ RSpec.describe Asciidoctor::Standoc do
395
395
  <fetched>#{Date.today}</fetched>
396
396
  <title type='title-intro' format='text/plain' language='en' script='Latn'>Rubber latex</title>
397
397
  <title type='title-main' format='text/plain' language='en' script='Latn'>Sampling</title>
398
- <title type='main' format='text/plain' language='en' script='Latn'>Rubber latexSampling</title>
398
+ <title type='main' format='text/plain' language='en' script='Latn'>Rubber latex — Sampling</title>
399
399
  <title type='title-intro' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc</title>
400
400
  <title type='title-main' format='text/plain' language='fr' script='Latn'>Échantillonnage</title>
401
- <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchoucÉchantillonnage</title>
401
+ <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc — Échantillonnage</title>
402
402
  <uri type='src'>https://www.iso.org/standard/23281.html</uri>
403
403
  <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
404
404
  <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
@@ -470,7 +470,7 @@ RSpec.describe Asciidoctor::Standoc do
470
470
  #{BLANK_HDR}
471
471
  <sections>
472
472
  </sections><bibliography><references id="_" obligation="informative" normative="true">
473
- <title>Normative References</title>
473
+ <title>Normative references</title>
474
474
  #{NORM_REF_BOILERPLATE}
475
475
  <bibitem id="iso123" type="standard">
476
476
  <title format="text/plain">Standard</title>
@@ -519,7 +519,7 @@ RSpec.describe Asciidoctor::Standoc do
519
519
  <sections>
520
520
 
521
521
  </sections><bibliography><references id="_" obligation="informative" normative="true">
522
- <title>Normative References</title>
522
+ <title>Normative references</title>
523
523
  #{NORM_REF_BOILERPLATE}
524
524
  <bibitem type="standard" id="iso123">
525
525
  <fetched>#{Date.today}</fetched>
@@ -575,10 +575,10 @@ RSpec.describe Asciidoctor::Standoc do
575
575
  <fetched>#{Date.today}</fetched>
576
576
  <title type="title-intro" format="text/plain" language="en" script="Latn">Latex, rubber</title>
577
577
  <title type="title-main" format="text/plain" language="en" script="Latn">Determination of total solids content</title>
578
- <title type="main" format="text/plain" language="en" script="Latn">Latex, rubberDetermination of total solids content</title>
578
+ <title type='main' format='text/plain' language='en' script='Latn'>Latex, rubber — Determination of total solids content</title>
579
579
  <title type="title-intro" format="text/plain" language="fr" script="Latn">Latex de caoutchouc</title>
580
580
  <title type="title-main" format="text/plain" language="fr" script="Latn">Détermination des matières solides totales</title>
581
- <title type="main" format="text/plain" language="fr" script="Latn">Latex de caoutchoucDétermination des matières solides totales</title>
581
+ <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc — Détermination des matières solides totales</title>
582
582
  <uri type="src">https://www.iso.org/standard/61884.html</uri>
583
583
  <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:61884:en</uri>
584
584
  <uri type="rss">https://www.iso.org/contents/data/standard/06/18/61884.detail.rss</uri>
@@ -623,9 +623,9 @@ RSpec.describe Asciidoctor::Standoc do
623
623
  <bibitem type="standard" id="iso125">
624
624
  <fetched>#{Date.today}</fetched>
625
625
  <title type="title-main" format="text/plain" language="en" script="Latn">Permuted index of the vocabulary of information technology</title>
626
- <title type="main" format="text/plain" language="en" script="Latn">Permuted index of the vocabulary of information technology</title>
626
+ <title type='main' format='text/plain' language='en' script='Latn'>Permuted index of the vocabulary of information technology</title>
627
627
  <title type="title-main" format="text/plain" language="fr" script="Latn">Index permuté du vocabulaire des technologies de l’information</title>
628
- <title type="main" format="text/plain" language="fr" script="Latn">Index permuté du vocabulaire des technologies de l’information</title>
628
+ <title type='main' format='text/plain' language='fr' script='Latn'>Index permuté du vocabulaire des technologies de l’information</title>
629
629
  <uri type="src">https://www.iso.org/standard/21071.html</uri>
630
630
  <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:21071:en</uri>
631
631
  <uri type="rss">https://www.iso.org/contents/data/standard/02/10/21071.detail.rss</uri>
@@ -675,10 +675,10 @@ RSpec.describe Asciidoctor::Standoc do
675
675
  <fetched>#{Date.today}</fetched>
676
676
  <title type="title-intro" format="text/plain" language="en" script="Latn">Latex, rubber</title>
677
677
  <title type="title-main" format="text/plain" language="en" script="Latn">Determination of total solids content</title>
678
- <title type="main" format="text/plain" language="en" script="Latn">Latex, rubberDetermination of total solids content</title>
678
+ <title type='main' format='text/plain' language='en' script='Latn'>Latex, rubber — Determination of total solids content</title>
679
679
  <title type="title-intro" format="text/plain" language="fr" script="Latn">Latex de caoutchouc</title>
680
680
  <title type="title-main" format="text/plain" language="fr" script="Latn">Détermination des matières solides totales</title>
681
- <title type="main" format="text/plain" language="fr" script="Latn">Latex de caoutchoucDétermination des matières solides totales</title>
681
+ <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc — Détermination des matières solides totales</title>
682
682
  <uri type="src">https://www.iso.org/standard/61884.html</uri>
683
683
  <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:61884:en</uri>
684
684
  <uri type="rss">https://www.iso.org/contents/data/standard/06/18/61884.detail.rss</uri>
@@ -742,23 +742,23 @@ RSpec.describe Asciidoctor::Standoc do
742
742
  <sections>
743
743
 
744
744
  </sections><bibliography><references id="_" obligation="informative" normative="true">
745
- <title>Normative References</title>
745
+ <title>Normative references</title>
746
746
  #{NORM_REF_BOILERPLATE}
747
747
  <bibitem id='iso123'>
748
748
  <formattedref format='application/x-isodoc+xml'>
749
749
  <em>Standard</em>
750
750
  </formattedref>
751
- <docidentifier>ISO/IEC TR 12382:1992</docidentifier>
752
- <docnumber>12382:1992)</docnumber>
751
+ <docidentifier type='ISO'>ISO/IEC TR 12382:1992</docidentifier>
752
+ <docnumber>12382:1992</docnumber>
753
753
  </bibitem>
754
754
  <bibitem id='iso124' type='standard'>
755
755
  <fetched>#{Date.today}</fetched>
756
756
  <title type='title-intro' format='text/plain' language='en' script='Latn'>Latex, rubber</title>
757
757
  <title type='title-main' format='text/plain' language='en' script='Latn'>Determination of total solids content</title>
758
- <title type='main' format='text/plain' language='en' script='Latn'>Latex, rubberDetermination of total solids content</title>
758
+ <title type='main' format='text/plain' language='en' script='Latn'>Latex, rubber — Determination of total solids content</title>
759
759
  <title type='title-intro' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc</title>
760
760
  <title type='title-main' format='text/plain' language='fr' script='Latn'>Détermination des matières solides totales</title>
761
- <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchoucDétermination des matières solides totales</title>
761
+ <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc — Détermination des matières solides totales</title>
762
762
  <uri type='src'>https://www.iso.org/standard/61884.html</uri>
763
763
  <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:61884:en</uri>
764
764
  <uri type='rss'>https://www.iso.org/contents/data/standard/06/18/61884.detail.rss</uri>
@@ -821,7 +821,7 @@ OUTPUT
821
821
  #{BLANK_HDR}
822
822
  <sections>
823
823
  </sections><bibliography><references id="_" obligation="informative" normative="true">
824
- <title>Normative References</title>
824
+ <title>Normative references</title>
825
825
  #{NORM_REF_BOILERPLATE}
826
826
  <bibitem id="iso123" type="standard">
827
827
  <title format="text/plain">Standard</title>
@@ -850,7 +850,7 @@ OUTPUT
850
850
  <name>ISO</name>
851
851
  </organization>
852
852
  </contributor>
853
- <note format="text/plain">ISO DATE: The standard is in press</note>
853
+ <note format="text/plain" type="ISO DATE">The standard is in press</note>
854
854
  </bibitem>
855
855
  <bibitem id="iso125" type="standard">
856
856
  <title format="text/plain">Standard</title>
@@ -865,7 +865,7 @@ OUTPUT
865
865
  <name>ISO</name>
866
866
  </organization>
867
867
  </contributor>
868
- <note format="text/plain">ISO DATE: The standard is in press</note>
868
+ <note format="text/plain" type="ISO DATE">The standard is in press</note>
869
869
  </bibitem>
870
870
  <bibitem id='iso126' type='standard'>
871
871
  <title format='text/plain'>Standard</title>
@@ -902,7 +902,7 @@ OUTPUT
902
902
  #{BLANK_HDR}
903
903
  <sections>
904
904
  </sections><bibliography><references id="_" obligation="informative" normative="true">
905
- <title>Normative References</title>
905
+ <title>Normative references</title>
906
906
  #{NORM_REF_BOILERPLATE}
907
907
  <bibitem id="iso123" type="standard">
908
908
  <title format="text/plain">Standard</title>
@@ -969,7 +969,7 @@ OUTPUT
969
969
  </p>
970
970
  </clause>
971
971
  </sections><bibliography><references id="_" obligation="informative" normative="true">
972
- <title>Normative References</title>
972
+ <title>Normative references</title>
973
973
  #{NORM_REF_BOILERPLATE}
974
974
  <bibitem id="iso123" type="standard">
975
975
  <fetched>#{Date.today}</fetched>
@@ -1110,7 +1110,7 @@ OUTPUT
1110
1110
  <sections>
1111
1111
 
1112
1112
  </sections><bibliography><references id="_" obligation="informative" normative="true">
1113
- <title>Normative References</title>
1113
+ <title>Normative references</title>
1114
1114
  #{NORM_REF_BOILERPLATE}
1115
1115
  <bibitem id="iso123">
1116
1116
  <formattedref format="application/x-isodoc+xml">
@@ -1214,7 +1214,7 @@ OUTPUT
1214
1214
  <sections>
1215
1215
 
1216
1216
  </sections><bibliography><references id="_" obligation="informative" normative="true">
1217
- <title>Normative References</title>
1217
+ <title>Normative references</title>
1218
1218
  #{NORM_REF_BOILERPLATE}
1219
1219
  <bibitem id="iso123" type="standard">
1220
1220
  <title format="text/plain">Standard</title>
@@ -1244,7 +1244,252 @@ OUTPUT
1244
1244
  OUTPUT
1245
1245
  end
1246
1246
 
1247
- private
1247
+ it "processes repository reference" do
1248
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp( <<~"OUTPUT")
1249
+ #{ISOBIB_BLANK_HDR}
1250
+ == Scope
1251
+
1252
+ <<iso123>>
1253
+
1254
+ <<iso123,clause=1>>
1255
+
1256
+ [bibliography]
1257
+ == Normative References
1258
+
1259
+ * [[[iso123,repo:(a/b,ISO 123)]]] _Standard_
1260
+ INPUT
1261
+ #{BLANK_HDR}
1262
+ <sections>
1263
+ <clause id='_' inline-header='false' obligation='normative' type="scope">
1264
+ <title>Scope</title>
1265
+ <p id='_'>
1266
+ <eref type='inline' bibitemid='iso123' citeas='ISO 123'/>
1267
+ </p>
1268
+ <p id='_'>
1269
+ <eref type='inline' bibitemid='iso123' citeas='ISO 123'>
1270
+ <localityStack>
1271
+ <locality type='clause'>
1272
+ <referenceFrom>1</referenceFrom>
1273
+ </locality>
1274
+ </localityStack>
1275
+ </eref>
1276
+ </p>
1277
+ </clause>
1278
+ </sections>
1279
+ <bibliography>
1280
+ <references id='_' normative='true' obligation='informative'>
1281
+ <title>Normative references</title>
1282
+ <p id='_'>
1283
+ The following documents are referred to in the text in such a way that
1284
+ some or all of their content constitutes requirements of this document.
1285
+ For dated references, only the edition cited applies. For undated
1286
+ references, the latest edition of the referenced document (including any
1287
+ amendments) applies.
1288
+ </p>
1289
+ <bibitem id='iso123'>
1290
+ <formattedref format='application/x-isodoc+xml'>
1291
+ <em>Standard</em>
1292
+ </formattedref>
1293
+ <docidentifier type="ISO">ISO 123</docidentifier>
1294
+ <docidentifier type="repository">a/b</docidentifier>
1295
+ <docnumber>123</docnumber>
1296
+ </bibitem>
1297
+ </references>
1298
+ </bibliography>
1299
+ </standard-document>
1300
+ OUTPUT
1301
+ end
1302
+
1303
+ it "processes hyperlink reference, ingest RXL or XML if available" do
1304
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp( <<~"OUTPUT")
1305
+ #{ISOBIB_BLANK_HDR}
1306
+ == Scope
1307
+
1308
+ <<iso123>>
1309
+
1310
+ <<iso124,clause=1>>
1311
+
1312
+ <<iso123,anchor=xyz>>
1313
+
1314
+ <<iso124,clause=1,anchor=xyz>>
1315
+
1316
+ [bibliography]
1317
+ == Normative References
1318
+
1319
+ * [[[iso123,path:(spec/assets/iso123,ISO 123)]]] _Standard_
1320
+ * [[[iso124,path:(a/b.adoc,ISO 124)]]] _Standard_
1321
+ INPUT
1322
+ #{BLANK_HDR}
1323
+ <sections>
1324
+ <clause id='_' inline-header='false' obligation='normative' type="scope">
1325
+ <title>Scope</title>
1326
+ <p id='_'>
1327
+ <eref type='inline' bibitemid='iso123' citeas='ISO 123 (all parts)'/>
1328
+ </p>
1329
+ <p id='_'>
1330
+ <eref type='inline' bibitemid='iso124' citeas='ISO 124'>
1331
+ <localityStack>
1332
+ <locality type='clause'>
1333
+ <referenceFrom>1</referenceFrom>
1334
+ </locality>
1335
+ </localityStack>
1336
+ </eref>
1337
+ </p>
1338
+ <p id='_'>
1339
+ <eref type='inline' bibitemid='iso123' citeas='ISO 123 (all parts)'>
1340
+ <localityStack>
1341
+ <locality type='anchor'>
1342
+ <referenceFrom>xyz</referenceFrom>
1343
+ </locality>
1344
+ </localityStack>
1345
+ </eref>
1346
+ </p>
1347
+ <p id='_'>
1348
+ <eref type='inline' bibitemid='iso124' citeas='ISO 124'>
1349
+ <localityStack>
1350
+ <locality type='clause'>
1351
+ <referenceFrom>1</referenceFrom>
1352
+ </locality>
1353
+ <locality type='anchor'>
1354
+ <referenceFrom>xyz</referenceFrom>
1355
+ </locality>
1356
+ </localityStack>
1357
+ </eref>
1358
+ </p>
1359
+ </clause>
1360
+ </sections>
1361
+ <bibliography>
1362
+ <references id='_' normative='true' obligation='informative'>
1363
+ <title>Normative references</title>
1364
+ <p id='_'>
1365
+ The following documents are referred to in the text in such a way that
1366
+ some or all of their content constitutes requirements of this document.
1367
+ For dated references, only the edition cited applies. For undated
1368
+ references, the latest edition of the referenced document (including any
1369
+ amendments) applies.
1370
+ </p>
1371
+ <bibitem id='iso123' type='standard'>
1372
+ <fetched>2020-06-12</fetched>
1373
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Rubber latex</title>
1374
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Sampling</title>
1375
+ <title type='main' format='text/plain' language='en' script='Latn'>Rubber latex – Sampling</title>
1376
+ <title type='title-intro' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc</title>
1377
+ <title type='title-main' format='text/plain' language='fr' script='Latn'>Échantillonnage</title>
1378
+ <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc – Échantillonnage</title>
1379
+ <uri type='src'>https://www.iso.org/standard/23281.html</uri>
1380
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
1381
+ <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
1382
+ <uri type='citation'>spec/assets/iso123</uri>
1383
+ <docidentifier type='ISO'>ISO 123 (all parts)</docidentifier>
1384
+ <docnumber>123</docnumber>
1385
+ <date type='published'>
1386
+ <on>2001</on>
1387
+ </date>
1388
+ <contributor>
1389
+ <role type='publisher'/>
1390
+ <organization>
1391
+ <name>International Organization for Standardization</name>
1392
+ <abbreviation>ISO</abbreviation>
1393
+ <uri>www.iso.org</uri>
1394
+ </organization>
1395
+ </contributor>
1396
+ <edition>3</edition>
1397
+ <language>en</language>
1398
+ <language>fr</language>
1399
+ <script>Latn</script>
1400
+ <status>
1401
+ <stage>90</stage>
1402
+ <substage>93</substage>
1403
+ </status>
1404
+ <copyright>
1405
+ <from>2001</from>
1406
+ <owner>
1407
+ <organization>
1408
+ <name>ISO</name>
1409
+ </organization>
1410
+ </owner>
1411
+ </copyright>
1412
+ <relation type='obsoletes'>
1413
+ <bibitem type='standard'>
1414
+ <formattedref format='text/plain'>ISO 123:1985</formattedref>
1415
+ </bibitem>
1416
+ </relation>
1417
+ <relation type='instance'>
1418
+ <bibitem type='standard'>
1419
+ <fetched>2020-06-12</fetched>
1420
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Rubber latex</title>
1421
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Sampling</title>
1422
+ <title type='main' format='text/plain' language='en' script='Latn'>Rubber latex – Sampling</title>
1423
+ <title type='title-intro' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc</title>
1424
+ <title type='title-main' format='text/plain' language='fr' script='Latn'>Échantillonnage</title>
1425
+ <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc – Échantillonnage</title>
1426
+ <uri type='src'>https://www.iso.org/standard/23281.html</uri>
1427
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
1428
+ <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
1429
+ <docidentifier type='ISO'>ISO 123:2001</docidentifier>
1430
+ <docnumber>123</docnumber>
1431
+ <date type='published'>
1432
+ <on>2001</on>
1433
+ </date>
1434
+ <contributor>
1435
+ <role type='publisher'/>
1436
+ <organization>
1437
+ <name>International Organization for Standardization</name>
1438
+ <abbreviation>ISO</abbreviation>
1439
+ <uri>www.iso.org</uri>
1440
+ </organization>
1441
+ </contributor>
1442
+ <edition>3</edition>
1443
+ <language>en</language>
1444
+ <language>fr</language>
1445
+ <script>Latn</script>
1446
+ <status>
1447
+ <stage>90</stage>
1448
+ <substage>93</substage>
1449
+ </status>
1450
+ <copyright>
1451
+ <from>2001</from>
1452
+ <owner>
1453
+ <organization>
1454
+ <name>ISO</name>
1455
+ </organization>
1456
+ </owner>
1457
+ </copyright>
1458
+ <relation type='obsoletes'>
1459
+ <bibitem type='standard'>
1460
+ <formattedref format='text/plain'>ISO 123:1985</formattedref>
1461
+ </bibitem>
1462
+ </relation>
1463
+ <place>Geneva</place>
1464
+ </bibitem>
1465
+ </relation>
1466
+ <relation type='instance'>
1467
+ <bibitem type='standard'>
1468
+ <formattedref format='text/plain'>ISO 123:1985</formattedref>
1469
+ </bibitem>
1470
+ </relation>
1471
+ <relation type='instance'>
1472
+ <bibitem type='standard'>
1473
+ <formattedref format='text/plain'>ISO 123:1974</formattedref>
1474
+ </bibitem>
1475
+ </relation>
1476
+ <place>Geneva</place>
1477
+ </bibitem>
1478
+ <bibitem id='iso124'>
1479
+ <formattedref format='application/x-isodoc+xml'>
1480
+ <em>Standard</em>
1481
+ </formattedref>
1482
+ <uri type='URI'>a/b</uri>
1483
+ <uri type='citation'>a/b</uri>
1484
+ <docidentifier type="ISO">ISO 124</docidentifier>
1485
+ <docnumber>124</docnumber>
1486
+ </bibitem>
1487
+ </references>
1488
+ </bibliography>
1489
+ </standard-document>
1490
+ OUTPUT
1491
+ end
1492
+
1248
1493
 
1249
1494
  private
1250
1495