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
@@ -253,7 +253,7 @@ RSpec.describe Asciidoctor::BSI do
253
253
 
254
254
  [bibliography]
255
255
  == Normative References
256
- * [[[XYZ,ISO 639:1967]]] _Standard_
256
+ * [[[XYZ,ISO 639:1988]]] _Standard_
257
257
  INPUT
258
258
  expect(File.read("test.err"))
259
259
  .to include "Do not cite withdrawn standards"
@@ -377,6 +377,31 @@ RSpec.describe Asciidoctor::BSI do
377
377
  .to include "Third annex should be annex #1"
378
378
  end
379
379
 
380
+ it "Warning if annexes do not appear in citation order: ignore uncited annexes" do
381
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
382
+ #{VALIDATING_BLANK_HDR}
383
+
384
+ <<a3>>
385
+ <<a2>>
386
+
387
+ [[a1]]
388
+ [appendix]
389
+ == First annex
390
+
391
+ [[a2]]
392
+ [appendix]
393
+ == Second annex
394
+
395
+ [[a3]]
396
+ [appendix]
397
+ == Third annex
398
+ INPUT
399
+ expect(File.read("test.err"))
400
+ .not_to include "First annex should be annex #3"
401
+ expect(File.read("test.err"))
402
+ .to include "Third annex should be annex #1"
403
+ end
404
+
380
405
  it "Warning if annexes not cited properly" do
381
406
  Asciidoctor.convert(<<~"INPUT", *OPTIONS)
382
407
  = Document title
@@ -14,7 +14,7 @@ RSpec.describe IsoDoc::BSI do
14
14
  INPUT
15
15
  #{HTML_HDR}
16
16
  <div>
17
- <h1 class='ForewordTitle'>FOREWORD</h1>
17
+ <h1 class='ForewordTitle'>Foreword</h1>
18
18
  <div class='boilerplate_legal'/>
19
19
  <div id='_70234f78-64e5-4dfc-8b6f-f3f037348b6a' class='Note'>
20
20
  <p>
@@ -73,13 +73,20 @@ RSpec.describe IsoDoc::BSI do
73
73
  </table>
74
74
  </clause>
75
75
  </sections>
76
+ <annex id="sec_C" inline-header="false" obligation="informative"><title>Recognized levels of competence in SM</title><admonition id="_0a120252-23b6-423c-b5b5-e5e5fcb9c8e7" type="commentary" target="sec_C">
77
+ <p id="_70c1c77a-dba1-4239-a76f-5610db24835d">This annex provides examples of the levels of competence in SM expected
78
+ from individuals working in various roles throughout an organization.
79
+ The level of competence required for an individual is determined by the organization.</p>
80
+ </admonition>
81
+ <p id="_c873a8f4-a2ea-4509-b28c-b85212cca301">Hello</p>
82
+ </annex>
76
83
  </iso-standard>
77
84
  INPUT
78
85
 
79
86
  presxml = <<~OUTPUT
80
87
  <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
81
88
  <sections>
82
- <clause id="reag2" inline-header="false" obligation="normative">
89
+ <clause id="reag2" inline-header="false" obligation="normative" displayorder='1'>
83
90
  <title depth="1">1<tab/>Reagents</title>
84
91
  <admonition id="A1" type="commentary" target="reag"><name>COMMENTARY ON ???</name>
85
92
  <p id="p2">This is a commentary on the reagents</p>
@@ -100,11 +107,12 @@ RSpec.describe IsoDoc::BSI do
100
107
  </tbody>
101
108
  </table>
102
109
  </clause>
103
- <clause id="reag3" inline-header="false" obligation="normative">
110
+ <clause id="reag3" inline-header="false" obligation="normative" displayorder='2'>
104
111
  <title depth="1">2<tab/>Reagents</title>
105
- <admonition id="A4" type="commentary" target="table3"><name>COMMENTARY ON TABLE 2</name>
106
- <p id="p3">This is a commentary on the reagents</p>
107
- </admonition>
112
+ <admonition id='A4' type='commentary' target='table3'>
113
+ <name>COMMENTARY ON TABLE 2</name>
114
+ <p id='p3'>This is a commentary on the reagents</p>
115
+ </admonition>
108
116
  <table id="table3">
109
117
  <name>Table 2&#xA0;&#x2014; Reagents in use</name>
110
118
  <tbody>
@@ -116,13 +124,32 @@ RSpec.describe IsoDoc::BSI do
116
124
  </table>
117
125
  </clause>
118
126
  </sections>
127
+ <annex id='sec_C' inline-header='false' obligation='informative' displayorder='3'>
128
+ <title>
129
+ <strong>Annex A</strong>
130
+ <tab/>
131
+ (informative)
132
+ <br/>
133
+ <strong>Recognized levels of competence in SM</strong>
134
+ </title>
135
+ <admonition id='_0a120252-23b6-423c-b5b5-e5e5fcb9c8e7' type='commentary' target='sec_C'>
136
+ <name>COMMENTARY ON ANNEX A</name>
137
+ <p id='_70c1c77a-dba1-4239-a76f-5610db24835d'>
138
+ This annex provides examples of the levels of competence in SM expected
139
+ from individuals working in various roles throughout an organization.
140
+ The level of competence required for an individual is determined by the
141
+ organization.
142
+ </p>
143
+ </admonition>
144
+ <p id='_c873a8f4-a2ea-4509-b28c-b85212cca301'>Hello</p>
145
+ </annex>
119
146
  </iso-standard>
120
147
  OUTPUT
121
148
 
122
149
  html = <<~OUTPUT
123
150
  #{HTML_HDR}
124
151
  <div id=''>
125
- <h1 class='ForewordTitle'>FOREWORD</h1>
152
+ <h1 class='ForewordTitle'>Foreword</h1>
126
153
  <div class='boilerplate_legal'/>
127
154
  </div>
128
155
  <p class='zzSTDTitle1'>
@@ -135,23 +162,14 @@ RSpec.describe IsoDoc::BSI do
135
162
  <span class='note_label'>COMMENTARY ON ???</span>
136
163
  </p>
137
164
  <p id='p2'>This is a commentary on the reagents</p>
138
- <div id='A1' class='Admonition'>
139
- <p>This is a commentary on the reagents</p>
140
- </div>
141
165
  <p>
142
166
  <span class='note_label'>COMMENTARY 1 ON CLAUSE 1</span>
143
167
  </p>
144
168
  <p id='p2'>This is a commentary on the reagents</p>
145
- <div id='A2' class='Admonition'>
146
- <p>This is a commentary on the reagents</p>
147
- </div>
148
169
  <p>
149
170
  <span class='note_label'>COMMENTARY 2 ON CLAUSE 1</span>
150
171
  </p>
151
172
  <p id='p2'>This is a commentary on the reagents</p>
152
- <div id='A3' class='Admonition'>
153
- <p>This is a commentary on the reagents</p>
154
- </div>
155
173
  <p class='TableTitle' style='text-align:center;'>Table 1&#160;&#8212; Reagents in use</p>
156
174
  <table id='table2' class='MsoISOTable' style='border-width:1px;border-spacing:0;'>
157
175
  <tbody>
@@ -168,9 +186,6 @@ RSpec.describe IsoDoc::BSI do
168
186
  <span class='note_label'>COMMENTARY ON TABLE 2</span>
169
187
  </p>
170
188
  <p id='p3'>This is a commentary on the reagents</p>
171
- <div id='A4' class='Admonition'>
172
- <p>This is a commentary on the reagents</p>
173
- </div>
174
189
  <p class='TableTitle' style='text-align:center;'>Table 2&#160;&#8212; Reagents in use</p>
175
190
  <table id='table3' class='MsoISOTable' style='border-width:1px;border-spacing:0;'>
176
191
  <tbody>
@@ -181,6 +196,26 @@ RSpec.describe IsoDoc::BSI do
181
196
  </tbody>
182
197
  </table>
183
198
  </div>
199
+ <br/>
200
+ <div id='sec_C' class='Section3'>
201
+ <h1 class='Annex'>
202
+ <b>Annex A</b>
203
+ &#8195;
204
+ (informative)
205
+ <br/>
206
+ <b>Recognized levels of competence in SM</b>
207
+ </h1>
208
+ <p>
209
+ <span class='note_label'>COMMENTARY ON ANNEX A</span>
210
+ </p>
211
+ <p id='_70c1c77a-dba1-4239-a76f-5610db24835d'>
212
+ This annex provides examples of the levels of competence in SM
213
+ expected from individuals working in various roles throughout an
214
+ organization. The level of competence required for an individual is
215
+ determined by the organization.
216
+ </p>
217
+ <p id='_c873a8f4-a2ea-4509-b28c-b85212cca301'>Hello</p>
218
+ </div>
184
219
  </div>
185
220
  </body>
186
221
  </html>
@@ -207,7 +242,7 @@ RSpec.describe IsoDoc::BSI do
207
242
  INPUT
208
243
  #{HTML_HDR}
209
244
  <div>
210
- <h1 class='ForewordTitle'>FOREWORD</h1>
245
+ <h1 class='ForewordTitle'>Foreword</h1>
211
246
  <div class='boilerplate_legal'/>
212
247
  <div id='_70234f78-64e5-4dfc-8b6f-f3f037348b6a' class='Admonition'>
213
248
  <p>
@@ -240,7 +275,7 @@ RSpec.describe IsoDoc::BSI do
240
275
  INPUT
241
276
  #{HTML_HDR}
242
277
  <div>
243
- <h1 class='ForewordTitle'>FOREWORD</h1>
278
+ <h1 class='ForewordTitle'>Foreword</h1>
244
279
  <div class='boilerplate_legal'/>
245
280
  <div id='_70234f78-64e5-4dfc-8b6f-f3f037348b6a' class='Admonition'>
246
281
  <p><b>Title</b>.</p>