metanorma-bsi 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of metanorma-bsi might be problematic. Click here for more details.

Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +43 -0
  3. data/.github/workflows/release_github_packages.yml +49 -0
  4. data/.hound.yml +3 -1
  5. data/.rubocop.yml +4 -8
  6. data/README.adoc +95 -11
  7. data/lib/asciidoctor/bsi/biblio.rng +1 -0
  8. data/lib/asciidoctor/bsi/bsi.rng +32 -4
  9. data/lib/asciidoctor/bsi/bsi_intro_en.xml +87 -61
  10. data/lib/asciidoctor/bsi/cleanup.rb +15 -8
  11. data/lib/asciidoctor/bsi/cleanup_ref.rb +10 -21
  12. data/lib/asciidoctor/bsi/converter.rb +7 -5
  13. data/lib/asciidoctor/bsi/front.rb +26 -5
  14. data/lib/asciidoctor/bsi/isodoc.rng +191 -3
  15. data/lib/asciidoctor/bsi/isostandard.rng +12 -0
  16. data/lib/asciidoctor/bsi/validate.rb +5 -6
  17. data/lib/asciidoctor/bsi/validate_list.rb +2 -2
  18. data/lib/isodoc/bsi/base_convert.rb +2 -1
  19. data/lib/isodoc/bsi/bsi.international-standard.xsl +3380 -2349
  20. data/lib/isodoc/bsi/html/htmlstyle.css +43 -22
  21. data/lib/isodoc/bsi/html/htmlstyle.scss +46 -22
  22. data/lib/isodoc/bsi/html_convert.rb +2 -2
  23. data/lib/isodoc/bsi/i18n-en.yaml +4 -4
  24. data/lib/isodoc/bsi/metadata.rb +2 -2
  25. data/lib/isodoc/bsi/presentation_xml_convert.rb +26 -5
  26. data/lib/isodoc/bsi/xref.rb +11 -4
  27. data/lib/metanorma/bsi/version.rb +1 -1
  28. data/metanorma-bsi.gemspec +2 -2
  29. data/spec/asciidoctor/base_spec.rb +564 -494
  30. data/spec/asciidoctor/blocks_spec.rb +192 -195
  31. data/spec/asciidoctor/cleanup_spec.rb +361 -361
  32. data/spec/asciidoctor/refs_spec.rb +8 -78
  33. data/spec/asciidoctor/section_spec.rb +227 -227
  34. data/spec/asciidoctor/validate_spec.rb +26 -1
  35. data/spec/isodoc/blocks_spec.rb +56 -21
  36. data/spec/isodoc/i18n_spec.rb +156 -234
  37. data/spec/isodoc/inline_spec.rb +7 -7
  38. data/spec/isodoc/iso_spec.rb +4 -4
  39. data/spec/isodoc/metadata_spec.rb +0 -1
  40. data/spec/isodoc/ref_spec.rb +7 -7
  41. data/spec/isodoc/section_spec.rb +400 -343
  42. data/spec/isodoc/terms_spec.rb +224 -225
  43. data/spec/isodoc/xref_spec.rb +1347 -1360
  44. data/spec/metanorma/processor_spec.rb +37 -40
  45. data/spec/spec_helper.rb +6 -4
  46. data/spec/vcr_cassettes/iso-639.yml +19 -19
  47. data/spec/vcr_cassettes/isobib_get_639_1967.yml +17 -17
  48. data/spec/vcr_cassettes/multistandard.yml +15 -193
  49. metadata +7 -5
@@ -96,15 +96,15 @@ RSpec.describe Asciidoctor::BSI do
96
96
  #{@blank_hdr}
97
97
  <preface>
98
98
  <foreword id='_' obligation='informative'>
99
- <title>FOREWORD</title>
99
+ <title>Foreword</title>
100
100
  <p id='_'>
101
101
  <eref type='inline' bibitemid='ref3' citeas='[1]'/>
102
102
  <eref type='inline' bibitemid='ref7' citeas='IETF RFC 7749'/>
103
103
  <eref type='inline' bibitemid='ref6' citeas='[N1]'/>
104
104
  <eref type='inline' bibitemid='ref1' citeas='[2]'/>
105
105
  <eref type='inline' bibitemid='ref4' citeas='[N2]'/>
106
- <eref type='inline' bibitemid='ref5' citeas='ISO/R 639:1967'/>
107
- <eref type='inline' bibitemid='ref2' citeas='ISO/IEC ISP 15124-1:1998'/>
106
+ <eref type='inline' bibitemid='ref5' citeas='ISO 639:1967'/>
107
+ <eref type='inline' bibitemid='ref2' citeas='ISO 15124'/>
108
108
  </p>
109
109
  </foreword>
110
110
  </preface>
@@ -171,41 +171,19 @@ RSpec.describe Asciidoctor::BSI do
171
171
  <place>Fremont, CA</place>
172
172
  </bibitem>
173
173
  <bibitem id='ref5' type='standard'>
174
- <fetched>#{Date.today}</fetched>
175
- <title type='title-main' format='text/plain' language='en' script='Latn'>Symbols for languages, countries and authorities</title>
176
- <title type='main' format='text/plain' language='en' script='Latn'>Symbols for languages, countries and authorities</title>
177
- <uri type='src'>https://www.iso.org/standard/4765.html</uri>
178
- <uri type='rss'>https://www.iso.org/contents/data/standard/00/47/4765.detail.rss</uri>
179
- <docidentifier type='ISO'>ISO/R 639:1967</docidentifier>
180
- <docidentifier type='URN'>urn:iso:std:iso-r:r:639:stage-95.99:ed-1:en</docidentifier>
174
+ <title format='text/plain'>REF5</title>
175
+ <docidentifier type='ISO'>ISO 639:1967</docidentifier>
181
176
  <docnumber>639</docnumber>
182
177
  <date type='published'>
183
- <on>1967-11</on>
178
+ <on>1967</on>
184
179
  </date>
185
180
  <contributor>
186
181
  <role type='publisher'/>
187
182
  <organization>
188
183
  <name>International Organization for Standardization</name>
189
184
  <abbreviation>ISO</abbreviation>
190
- <uri>www.iso.org</uri>
191
185
  </organization>
192
186
  </contributor>
193
- <edition>1</edition>
194
- <language>en</language>
195
- <script>Latn</script>
196
- <status>
197
- <stage>95</stage>
198
- <substage>99</substage>
199
- </status>
200
- <copyright>
201
- <from>1967</from>
202
- <owner>
203
- <organization>
204
- <name>ISO/R</name>
205
- </organization>
206
- </owner>
207
- </copyright>
208
- <place>Geneva</place>
209
187
  </bibitem>
210
188
  </references>
211
189
  <references normative='true' unnumbered='true'>
@@ -234,64 +212,16 @@ RSpec.describe Asciidoctor::BSI do
234
212
  any amendments) applies.
235
213
  </p>
236
214
  <bibitem id='ref2' type='standard'>
237
- <fetched>#{Date.today}</fetched>
238
- <title type='title-intro' format='text/plain' language='en' script='Latn'>Information technology</title>
239
- <title type='title-main' format='text/plain' language='en' script='Latn'>International Standardized Profile FOD126</title>
240
- <title type='title-part' format='text/plain' language='en' script='Latn'>
241
- Open Document Format: Image
242
- Applications&#8201;&#8212;&#8201;Enhanced document
243
- structure&#8201;&#8212;&#8201;Character, raster graphics, and
244
- geometric graphics content architecture&#8201;&#8212;&#8201;Part 1:
245
- Document Application Profile (DAP)
246
- </title>
247
- <title type='main' format='text/plain' language='en' script='Latn'>
248
- Information technology&#8201;&#8212;&#8201;International
249
- Standardized Profile FOD126&#8201;&#8212;&#8201;Open Document
250
- Format: Image Applications&#8201;&#8212;&#8201;Enhanced document
251
- structure&#8201;&#8212;&#8201;Character, raster graphics, and
252
- geometric graphics content architecture&#8201;&#8212;&#8201;Part 1:
253
- Document Application Profile (DAP)
254
- </title>
255
- <uri type='src'>https://www.iso.org/standard/26440.html</uri>
256
- <uri type='rss'>https://www.iso.org/contents/data/standard/02/64/26440.detail.rss</uri>
257
- <docidentifier type='ISO'>ISO/IEC ISP 15124-1:1998</docidentifier>
258
- <docidentifier type='URN'>urn:iso:std:iso-iec:isp:15124:-1:stage-95.99:ed-1:en</docidentifier>
215
+ <title format='text/plain'>REF2</title>
216
+ <docidentifier type='ISO'>ISO 15124</docidentifier>
259
217
  <docnumber>15124</docnumber>
260
- <date type='published'>
261
- <on>1998-07</on>
262
- </date>
263
218
  <contributor>
264
219
  <role type='publisher'/>
265
220
  <organization>
266
221
  <name>International Organization for Standardization</name>
267
222
  <abbreviation>ISO</abbreviation>
268
- <uri>www.iso.org</uri>
269
223
  </organization>
270
224
  </contributor>
271
- <contributor>
272
- <role type='publisher'/>
273
- <organization>
274
- <name>International Electrotechnical Commission</name>
275
- <abbreviation>IEC</abbreviation>
276
- <uri>www.iec.ch</uri>
277
- </organization>
278
- </contributor>
279
- <edition>1</edition>
280
- <language>en</language>
281
- <script>Latn</script>
282
- <status>
283
- <stage>95</stage>
284
- <substage>99</substage>
285
- </status>
286
- <copyright>
287
- <from>1998</from>
288
- <owner>
289
- <organization>
290
- <name>ISO/IEC</name>
291
- </organization>
292
- </owner>
293
- </copyright>
294
- <place>Geneva</place>
295
225
  </bibitem>
296
226
  </references>
297
227
  <references normative='false' unnumbered='true'>
@@ -1,9 +1,9 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe Asciidoctor::BSI do
4
- before(:all) do
5
- @blank_hdr = blank_hdr_gen
6
- end
4
+ before(:all) do
5
+ @blank_hdr = blank_hdr_gen
6
+ end
7
7
 
8
8
  it "processes sections" do
9
9
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
@@ -56,88 +56,66 @@ end
56
56
 
57
57
  === Bibliography Subsection
58
58
  INPUT
59
- #{@blank_hdr}
60
- <preface><foreword id="_" obligation="informative">
61
- <title>FOREWORD</title>
62
- <p id="_">Text</p>
63
- </foreword><introduction id="_" obligation="informative">
64
- <title>INTRODUCTION</title><clause id="_" inline-header="false" obligation="informative">
65
- <title>Introduction Subsection</title>
66
- </clause>
67
- </introduction></preface><sections>
68
- <clause id="_" obligation="normative" type="scope" inline-header='false'>
69
- <title>Scope</title>
70
- <p id="_">Text</p>
71
- </clause>
72
-
73
- <terms id="_" obligation="normative">
74
- <title>Terms and definitions</title>
75
- <p id="_">For the purposes of this British Standard, the following terms and definitions apply.</p>
76
- #{TERMS_BOILERPLATE}
77
- <term id="term-term1">
78
- <preferred>Term1</preferred>
79
- </term>
80
- </terms>
81
- <clause id="_" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="_" obligation="normative">
82
- <title>Normal Terms</title>
83
- <p id='_'>For the purposes of this British Standard, the following terms and definitions apply.</p>
84
- <p id='_'>
85
- ISO and IEC maintain terminological databases for use in
86
- standardization at the following addresses:
87
- </p>
88
- <ul id='_'>
89
- <li>
90
- <p id='_'>
91
- IEC Electropedia: available at
92
- <link target='http://www.electropedia.org'/>
93
- </p>
94
- </li>
95
- <li>
96
- <p id='_'>
97
- ISO Online browsing platform: available at
98
- <link target='http://www.iso.org/obp'/>
99
- </p>
100
- </li>
101
- </ul>
102
- <term id="term-term2">
103
- <preferred>Term2</preferred>
104
- </term>
105
- </terms>
106
- <definitions id="_" obligation="normative"><title>Symbols and abbreviated terms</title></definitions></clause>
107
- <definitions id="_" obligation="normative"><title>Symbols and abbreviated terms</title></definitions>
108
- <clause id="_" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="_" inline-header="false" obligation="normative">
109
- <title>Introduction</title>
110
- </clause>
111
- <clause id="_" inline-header="false" obligation="normative">
112
- <title>Clause 4.2</title>
113
- </clause></clause>
114
- <clause id="_" inline-header="false" obligation="normative">
115
- <title>Terms and Definitions</title>
116
- </clause>
117
-
118
-
119
- </sections><annex id="_" inline-header="false" obligation="normative">
120
- <title>Annex</title>
121
- <clause id="_" inline-header="false" obligation="normative">
122
- <title>Annex A.1</title>
123
- </clause>
124
- <appendix id="_" inline-header="false" obligation="normative">
125
- <title>Appendix 1</title>
126
- </appendix></annex><bibliography><references id="_" obligation="informative" normative="true">
127
- <title>Normative references</title><p id="_">There are no normative references in this document.</p>
128
- </references><clause id="_" obligation="informative">
129
- <title>Bibliography</title>
130
- <references id="_" obligation="informative" normative="false">
131
- <title>Bibliography Subsection</title>
132
- <p id='_'>
133
- For dated references, only the edition cited applies. For undated
134
- references, the latest edition of the referenced document (including
135
- any amendments) applies.
136
- </p>
137
- </references>
138
- </clause>
139
- </bibliography>
140
- </bsi-standard>
59
+ #{@blank_hdr}
60
+ <preface><foreword id="_" obligation="informative">
61
+ <title>Foreword</title>
62
+ <p id="_">Text</p>
63
+ </foreword><introduction id="_" obligation="informative">
64
+ <title>Introduction</title><clause id="_" inline-header="false" obligation="informative">
65
+ <title>Introduction Subsection</title>
66
+ </clause>
67
+ </introduction></preface><sections>
68
+ <clause id="_" obligation="normative" type="scope" inline-header='false'>
69
+ <title>Scope</title>
70
+ <p id="_">Text</p>
71
+ </clause>
72
+ <terms id="_" obligation="normative">
73
+ <title>Terms and definitions</title>
74
+ <p id="_">For the purposes of this British Standard, the following terms and definitions apply.</p>
75
+ #{TERMS_BOILERPLATE}
76
+ <term id="term-term1">
77
+ <preferred>Term1</preferred>
78
+ </term>
79
+ </terms>
80
+ <clause id="_" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="_" obligation="normative">
81
+ <title>Normal Terms</title>
82
+ <term id="term-term2">
83
+ <preferred>Term2</preferred>
84
+ </term>
85
+ </terms>
86
+ <definitions id="_" obligation="normative"><title>Symbols and abbreviated terms</title></definitions></clause>
87
+ <definitions id="_" obligation="normative"><title>Symbols and abbreviated terms</title></definitions>
88
+ <clause id="_" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="_" inline-header="false" obligation="normative">
89
+ <title>Introduction</title>
90
+ </clause>
91
+ <clause id="_" inline-header="false" obligation="normative">
92
+ <title>Clause 4.2</title>
93
+ </clause></clause>
94
+ <clause id="_" inline-header="false" obligation="normative">
95
+ <title>Terms and Definitions</title>
96
+ </clause>
97
+ </sections><annex id="_" inline-header="false" obligation="normative">
98
+ <title>Annex</title>
99
+ <clause id="_" inline-header="false" obligation="normative">
100
+ <title>Annex A.1</title>
101
+ </clause>
102
+ <appendix id="_" inline-header="false" obligation="normative">
103
+ <title>Appendix 1</title>
104
+ </appendix></annex><bibliography><references id="_" obligation="informative" normative="true">
105
+ <title>Normative references</title><p id="_">There are no normative references in this document.</p>
106
+ </references><clause id="_" obligation="informative">
107
+ <title>Bibliography</title>
108
+ <references id="_" obligation="informative" normative="false">
109
+ <title>Bibliography Subsection</title>
110
+ <p id='_'>
111
+ For dated references, only the edition cited applies. For undated
112
+ references, the latest edition of the referenced document (including
113
+ any amendments) applies.
114
+ </p>
115
+ </references>
116
+ </clause>
117
+ </bibliography>
118
+ </bsi-standard>
141
119
  OUTPUT
142
120
  end
143
121
 
@@ -198,107 +176,88 @@ end
198
176
 
199
177
  === Bibliography Subsection
200
178
  INPUT
201
- #{@blank_hdr}
202
- <preface>
203
- <foreword id="_" obligation="informative">
204
- <title>FOREWORD</title>
205
- <p id="_">Text</p>
206
- </foreword>
207
- <introduction id="_" obligation="informative">
208
- <title>INTRODUCTION</title><clause id="_" inline-header="false" obligation="informative">
209
- <title>Introduction Subsection</title>
210
- </clause>
211
- </introduction>
212
- </preface>
213
- <sections>
214
- <clause id="_" obligation="normative" type="scope" inline-header='false'>
215
- <title>Scope</title>
216
- <p id="_">Text</p>
217
- </clause>
218
- <terms id="_" obligation="normative">
219
- <title>Terms and definitions</title>
220
- <p id="_">For the purposes of this British Standard, the following terms and definitions apply.</p>
221
- #{TERMS_BOILERPLATE}
222
- <term id="term-term1">
223
- <preferred>Term1</preferred>
224
- </term>
225
- </terms>
226
- <clause id='_' obligation='normative'>
227
- <title>Terms, definitions, symbols and abbreviated terms</title>
228
- <terms id='_' obligation='normative'>
229
- <title>Normal Terms</title>
230
- <p id='_'>For the purposes of this British Standard, the following terms and definitions apply.</p>
231
- <p id='_'>
232
- ISO and IEC maintain terminological databases for use in
233
- standardization at the following addresses:
234
- </p>
235
- <ul id='_'>
236
- <li>
237
- <p id='_'>
238
- IEC Electropedia: available at
239
- <link target='http://www.electropedia.org'/>
240
- </p>
241
- </li>
242
- <li>
243
- <p id='_'>
244
- ISO Online browsing platform: available at
245
- <link target='http://www.iso.org/obp'/>
246
- </p>
247
- </li>
248
- </ul>
249
- <term id='term-term2'>
250
- <preferred>Term2</preferred>
251
- </term>
252
- </terms>
253
- <definitions id='_' obligation="normative">
254
- <title>Symbols and abbreviated terms</title>
255
- </definitions>
256
- </clause>
257
- <definitions id='_' obligation="normative">
258
- <title>Symbols and abbreviated terms</title>
259
- </definitions>
260
- <clause id='_' inline-header='false' obligation='normative'>
261
- <title>Clause 4</title>
262
- <clause id='_' inline-header='false' obligation='normative'>
263
- <title>Introduction</title>
179
+ #{@blank_hdr}
180
+ <preface>
181
+ <foreword id="_" obligation="informative">
182
+ <title>Foreword</title>
183
+ <p id="_">Text</p>
184
+ </foreword>
185
+ <introduction id="_" obligation="informative">
186
+ <title>Introduction</title><clause id="_" inline-header="false" obligation="informative">
187
+ <title>Introduction Subsection</title>
264
188
  </clause>
265
- <clause id='_' inline-header='false' obligation='normative'>
266
- <title>Clause 4.2</title>
189
+ </introduction>
190
+ </preface>
191
+ <sections>
192
+ <clause id="_" obligation="normative" type="scope" inline-header='false'>
193
+ <title>Scope</title>
194
+ <p id="_">Text</p>
267
195
  </clause>
268
- </clause>
269
- </sections>
270
- <annex id='_' inline-header='false' obligation='normative'>
271
- <title>Annex</title>
272
- <clause id='_' inline-header='false' obligation='normative'>
273
- <title>Annex A.1</title>
274
- </clause>
275
- <appendix id='_' inline-header='false' obligation='normative'>
276
- <title>Appendx 1</title>
277
- </appendix>
278
- </annex>
279
- <bibliography>
280
- <references id='_' obligation='informative' normative="true">
281
- <title>Normative references</title>
282
- <p id="_">There are no normative references in this document.</p>
283
- </references>
284
- <clause id='_' obligation='informative'>
285
- <title>Bibliography</title>
286
- <references id='_' obligation='informative' normative="false">
287
- <title>Bibliography Subsection</title>
288
- <p id='_'>
289
- For dated references, only the edition cited applies. For undated
290
- references, the latest edition of the referenced document (including
291
- any amendments) applies.
292
- </p>
293
- </references>
294
- </clause>
295
- </bibliography>
296
- </bsi-standard>
196
+ <terms id="_" obligation="normative">
197
+ <title>Terms and definitions</title>
198
+ <p id="_">For the purposes of this British Standard, the following terms and definitions apply.</p>
199
+ #{TERMS_BOILERPLATE}
200
+ <term id="term-term1">
201
+ <preferred>Term1</preferred>
202
+ </term>
203
+ </terms>
204
+ <clause id='_' obligation='normative'>
205
+ <title>Terms, definitions, symbols and abbreviated terms</title>
206
+ <terms id='_' obligation='normative'>
207
+ <title>Normal Terms</title>
208
+ <term id='term-term2'>
209
+ <preferred>Term2</preferred>
210
+ </term>
211
+ </terms>
212
+ <definitions id='_' obligation="normative">
213
+ <title>Symbols and abbreviated terms</title>
214
+ </definitions>
215
+ </clause>
216
+ <definitions id='_' obligation="normative">
217
+ <title>Symbols and abbreviated terms</title>
218
+ </definitions>
219
+ <clause id='_' inline-header='false' obligation='normative'>
220
+ <title>Clause 4</title>
221
+ <clause id='_' inline-header='false' obligation='normative'>
222
+ <title>Introduction</title>
223
+ </clause>
224
+ <clause id='_' inline-header='false' obligation='normative'>
225
+ <title>Clause 4.2</title>
226
+ </clause>
227
+ </clause>
228
+ </sections>
229
+ <annex id='_' inline-header='false' obligation='normative'>
230
+ <title>Annex</title>
231
+ <clause id='_' inline-header='false' obligation='normative'>
232
+ <title>Annex A.1</title>
233
+ </clause>
234
+ <appendix id='_' inline-header='false' obligation='normative'>
235
+ <title>Appendx 1</title>
236
+ </appendix>
237
+ </annex>
238
+ <bibliography>
239
+ <references id='_' obligation='informative' normative="true">
240
+ <title>Normative references</title>
241
+ <p id="_">There are no normative references in this document.</p>
242
+ </references>
243
+ <clause id='_' obligation='informative'>
244
+ <title>Bibliography</title>
245
+ <references id='_' obligation='informative' normative="false">
246
+ <title>Bibliography Subsection</title>
247
+ <p id='_'>
248
+ For dated references, only the edition cited applies. For undated
249
+ references, the latest edition of the referenced document (including
250
+ any amendments) applies.
251
+ </p>
252
+ </references>
253
+ </clause>
254
+ </bibliography>
255
+ </bsi-standard>
297
256
  OUTPUT
298
257
  end
299
258
 
300
259
  it "processes section obligations" do
301
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
260
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
302
261
  #{ASCIIDOC_BLANK_HDR}
303
262
  [obligation=informative]
304
263
  == Clause 1
@@ -310,26 +269,26 @@ end
310
269
 
311
270
  [appendix,obligation=informative]
312
271
  == Annex
313
- INPUT
314
- #{@blank_hdr}
315
- <sections><clause id="_" inline-header="false" obligation="informative">
316
- <title>Clause 1</title>
317
- <clause id="_" inline-header="false" obligation="informative">
318
- <title>Clause 1a</title>
319
- </clause>
320
- </clause>
321
- <clause id="_" inline-header="false" obligation="normative">
322
- <title>Clause 2</title>
323
- </clause>
324
- </sections><annex id="_" inline-header="false" obligation="informative">
325
- <title>Annex</title>
326
- </annex>
327
- </bsi-standard>
328
- OUTPUT
272
+ INPUT
273
+ #{@blank_hdr}
274
+ <sections><clause id="_" inline-header="false" obligation="informative">
275
+ <title>Clause 1</title>
276
+ <clause id="_" inline-header="false" obligation="informative">
277
+ <title>Clause 1a</title>
278
+ </clause>
279
+ </clause>
280
+ <clause id="_" inline-header="false" obligation="normative">
281
+ <title>Clause 2</title>
282
+ </clause>
283
+ </sections><annex id="_" inline-header="false" obligation="informative">
284
+ <title>Annex</title>
285
+ </annex>
286
+ </bsi-standard>
287
+ OUTPUT
329
288
  end
330
289
 
331
- it "processes inline headers" do
332
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
290
+ it "processes inline headers" do
291
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
333
292
  #{ASCIIDOC_BLANK_HDR}
334
293
  == Clause 1
335
294
 
@@ -341,42 +300,83 @@ end
341
300
 
342
301
  [%inline-header]
343
302
  === Clause Aa
344
- INPUT
345
- #{@blank_hdr}
346
- <sections><clause id="_" inline-header="false" obligation="normative">
347
- <title>Clause 1</title>
348
- <clause id="_" inline-header="true" obligation="normative">
349
- <title>Clause 1a</title>
350
- </clause>
351
- </clause>
352
- </sections><annex id="_" inline-header="false" obligation="normative">
353
- <title>Annex A</title>
354
- <clause id="_" inline-header="true" obligation="normative">
355
- <title>Clause Aa</title>
356
- </clause>
357
- </annex>
358
- </bsi-standard>
359
- OUTPUT
360
- end
303
+ INPUT
304
+ #{@blank_hdr}
305
+ <sections><clause id="_" inline-header="false" obligation="normative">
306
+ <title>Clause 1</title>
307
+ <clause id="_" inline-header="true" obligation="normative">
308
+ <title>Clause 1a</title>
309
+ </clause>
310
+ </clause>
311
+ </sections><annex id="_" inline-header="false" obligation="normative">
312
+ <title>Annex A</title>
313
+ <clause id="_" inline-header="true" obligation="normative">
314
+ <title>Clause Aa</title>
315
+ </clause>
316
+ </annex>
317
+ </bsi-standard>
318
+ OUTPUT
319
+ end
361
320
 
362
321
  it "processes blank headers" do
363
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
322
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
364
323
  #{ASCIIDOC_BLANK_HDR}
365
324
  == Clause 1
366
325
 
367
326
  === {blank}
368
327
 
369
- INPUT
370
- #{@blank_hdr}
371
- <sections>
372
- <clause id="_" inline-header="false" obligation="normative">
373
- <title>Clause 1</title>
374
- <clause id="_" inline-header="false" obligation="normative">
375
- </clause>
376
- </clause>
377
- </sections>
378
- </bsi-standard>
379
- OUTPUT
328
+ INPUT
329
+ #{@blank_hdr}
330
+ <sections>
331
+ <clause id="_" inline-header="false" obligation="normative">
332
+ <title>Clause 1</title>
333
+ <clause id="_" inline-header="false" obligation="normative">
334
+ </clause>
335
+ </clause>
336
+ </sections>
337
+ </bsi-standard>
338
+ OUTPUT
380
339
  end
381
340
 
341
+ it "handles corrigenda section" do
342
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
343
+ #{ASCIIDOC_BLANK_HDR}
344
+
345
+ [.preface,type=corrigenda]
346
+ == Amendments/corrigenda issued since publication
347
+ [[tab_ace_nat]]
348
+ [cols="1,1",options="header,unnumbered"]
349
+ |===
350
+ |Date |Text affected
351
+ |===
352
+
353
+ == Clause 1
354
+
355
+ INPUT
356
+ #{@blank_hdr}
357
+ <preface>
358
+ <clause id='_' type='corrigenda' inline-header='false' obligation='informative'>
359
+ <title>Amendments/corrigenda issued since publication</title>
360
+ <table id='tab_ace_nat' unnumbered='true'>
361
+ <colgroup>
362
+ <col width='50%'/>
363
+ <col width='50%'/>
364
+ </colgroup>
365
+ <thead>
366
+ <tr>
367
+ <th valign='top' align='left'>Date</th>
368
+ <th valign='top' align='left'>Text affected</th>
369
+ </tr>
370
+ </thead>
371
+ </table>
372
+ </clause>
373
+ </preface>
374
+ <sections>
375
+ <clause id="_" inline-header="false" obligation="normative">
376
+ <title>Clause 1</title>
377
+ </clause>
378
+ </sections>
379
+ </bsi-standard>
380
+ OUTPUT
381
+ end
382
382
  end