metanorma-iso 1.0.14 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5efdc0c9ed17cc6a3b766e5433dc07abdab2be70d0fc71c709f986c0b0522336
4
- data.tar.gz: 1296f88d1c8eec6f0cf06932c76002b906b8f8c6565240691b2d801549a90a0b
3
+ metadata.gz: '0119bb23502ecd1f0ebef275a09c518506ec0389533594bbf07f32dc3e42e981'
4
+ data.tar.gz: 26f9dab92a77065322ede51ec72f51f3d672096b8e63741d470433dcde508823
5
5
  SHA512:
6
- metadata.gz: 4f9a57a4f90b606dc404cee7e171e66fdae4ba4a6ad7f81f2dd7b4acc4f3ba093cb1bf05fc8a8b6c1a9d378fdb6aaa08b94ed6e86c6a046412a03d8a3d6176e2
7
- data.tar.gz: 1e8ee8642f4c732940b076238636ab53f1fe58122420b43caca9a52496226df37d6047575832a8d59181769042c3690b0d1b863b4cfb272af7970319f8337a2a
6
+ metadata.gz: da7a1fb42d0b409d6d4781fd1ee5adff54df4cd6f5d5b649261153dd3195599d85d0dba40870b57dffa1c412278c8ca8520428a09a4b5277c5757b144464a684
7
+ data.tar.gz: 153c46baa2c2bac4b216be5bb4000224195fed472fdc39ea6830ee6dbef2ce9567861db8ee30e0088496a1e86557ab15a5615a658bd9b82dc9ea9c4898075dff
data/README.adoc CHANGED
@@ -1,7 +1,7 @@
1
1
  = Metanorma-ISO: Metanorma processor for ISO standards
2
2
 
3
3
  image:https://img.shields.io/gem/v/metanorma-iso.svg["Gem Version", link="https://rubygems.org/gems/metanorma-iso"]
4
- image:https://img.shields.io/travis/riboseinc/metanorma-iso/master.svg["Build Status", link="https://travis-ci.com/riboseinc/metanorma-iso"]
4
+ image:https://img.shields.io/travis/riboseinc/metanorma-iso/master.svg["Build Status", link="https://travis-ci.org/riboseinc/metanorma-iso"]
5
5
  image:https://codeclimate.com/github/riboseinc/metanorma-iso/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/riboseinc/metanorma-iso"]
6
6
 
7
7
  WARNING: This gem is still under development.
@@ -911,6 +911,9 @@
911
911
  </choice>
912
912
  </attribute>
913
913
  </optional>
914
+ <optional>
915
+ <attribute name="alt"/>
916
+ </optional>
914
917
  </element>
915
918
  </define>
916
919
  <define name="stem">
@@ -673,6 +673,7 @@ text-align: center;
673
673
  padding: 0.5em;
674
674
  margin: 2em 0 1em 0;
675
675
  text-align: left;
676
+ padding-left: 2em;
676
677
  }
677
678
 
678
679
  .example p {
@@ -682,8 +683,8 @@ text-align: center;
682
683
  .example .example-title {
683
684
  font-weight: 700;
684
685
  text-transform: uppercase;
685
- text-align: center;
686
686
  margin-top:0;
687
+ margin-left:-1.5em;
687
688
  }
688
689
 
689
690
  /*
@@ -667,7 +667,6 @@ text-align: left;
667
667
  .example .example-title {
668
668
  font-weight: 700;
669
669
  text-transform: uppercase;
670
- text-align: center;
671
670
  margin-top:0;
672
671
  }
673
672
 
@@ -167,6 +167,10 @@ module IsoDoc
167
167
  delim = get_anchors[target][:type] == "listitem" ? " " : ", "
168
168
  l10n(get_anchors[container][:xref] + delim + linkend)
169
169
  end
170
+
171
+ def example_parse(node, out)
172
+ example_table_parse(node, out)
173
+ end
170
174
  end
171
175
  end
172
176
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ISO
3
- VERSION = "1.0.14".freeze
3
+ VERSION = "1.1.0".freeze
4
4
  end
5
5
  end
data/spec/assets/iso.doc CHANGED
@@ -1,7 +1,7 @@
1
1
  MIME-Version: 1.0
2
- Content-Type: multipart/related; boundary="----=_NextPart_46e31af2.9c48.4ec0"
2
+ Content-Type: multipart/related; boundary="----=_NextPart_ed032ac9.5869.4ef8"
3
3
 
4
- ------=_NextPart_46e31af2.9c48.4ec0
4
+ ------=_NextPart_ed032ac9.5869.4ef8
5
5
  Content-Location: file:///C:/Doc/iso.htm
6
6
  Content-Type: text/html; charset="utf-8"
7
7
 
@@ -829,11 +829,11 @@ Switzerland<p class="MsoNormal"></p></span></p>
829
829
  <p class="MsoToc1"><span lang="EN-GB" xml:lang="EN-GB"><span style="mso-element:field-begin"></span><span style="mso-spacerun:yes">&#xA0;</span>TOC
830
830
  \o "1-2" \h \z \u <span style="mso-element:field-separator"></span></span>
831
831
  <span class="MsoHyperlink"><span lang="EN-GB" style="mso-no-proof:yes" xml:lang="EN-GB">
832
- <a href="#_Toc221259265">Foreword<span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB">
832
+ <a href="#_Toc932671010">Foreword<span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB">
833
833
  <span style="mso-tab-count:1 dotted">. </span>
834
834
  </span><span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB">
835
835
  <span style="mso-element:field-begin"></span></span>
836
- <span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB"> PAGEREF _Toc221259265 \h </span>
836
+ <span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB"> PAGEREF _Toc932671010 \h </span>
837
837
  <span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB"><span style="mso-element:field-separator"></span></span><span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB">1</span>
838
838
  <span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB"></span><span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB"><span style="mso-element:field-end"></span></span></a></span></span></p>
839
839
 
@@ -870,7 +870,7 @@ Switzerland<p class="MsoNormal"></p></span></p>
870
870
  </html>
871
871
 
872
872
 
873
- ------=_NextPart_46e31af2.9c48.4ec0
873
+ ------=_NextPart_ed032ac9.5869.4ef8
874
874
  Content-Location: file:///C:/Doc/iso_files/filelist.xml
875
875
  Content-Transfer-Encoding: base64
876
876
  Content-Type: application/xml
@@ -880,7 +880,7 @@ ICAgICAgIDxvOk1haW5GaWxlIEhSZWY9Ii4uL3NwZWMvYXNzZXRzL2lzby5odG0iLz4gIDxvOkZp
880
880
  bGUgSFJlZj0iZmlsZWxpc3QueG1sIi8+CiAgPG86RmlsZSBIUmVmPSJoZWFkZXIuaHRtbCIvPgo8
881
881
  L3htbD4K
882
882
 
883
- ------=_NextPart_46e31af2.9c48.4ec0
883
+ ------=_NextPart_ed032ac9.5869.4ef8
884
884
  Content-Location: file:///C:/Doc/iso_files/header.html
885
885
  Content-Transfer-Encoding: base64
886
886
  Content-Type: text/html charset="utf-8"
@@ -1073,4 +1073,4 @@ cD4NCg0KPHAgY2xhc3M9TXNvRm9vdGVyPjxzcGFuIGxhbmc9RU4tQVUgc3R5bGU9J2ZvbnQtc2l6
1073
1073
  ZToxMC4wcHQ7Jz7CqQ0KJm5ic3A7Jm5ic3A74oCTIEFsbCByaWdodHMgcmVzZXJ2ZWQ8bzpwPjwv
1074
1074
  bzpwPjwvc3Bhbj48L3A+DQoNCjwvZGl2Pg0KDQoNCg0KPC9ib2R5Pg0KDQo8L2h0bWw+DQo=
1075
1075
 
1076
- ------=_NextPart_46e31af2.9c48.4ec0--
1076
+ ------=_NextPart_ed032ac9.5869.4ef8--
@@ -678,7 +678,7 @@ end
678
678
  [bibliography]
679
679
  == Bibliography
680
680
 
681
- * [[[ISO3696,ISO 3696]]], _Water for analytical laboratory use -- Specification and test methods_
681
+ * [[[ISO3696,ISO 3696]]] _Water for analytical laboratory use -- Specification and test methods_
682
682
 
683
683
  * [[[ISO5725-1,ISO 5725-1]]], _Accuracy (trueness and precision) of measurement methods and results -- Part 1: General principles and definitions_
684
684
 
@@ -100,7 +100,7 @@ RSpec.describe IsoDoc::Iso do
100
100
  <bibitem type="international-standard" id="IEV">
101
101
  <title format="text/plain" language="en" script="Latn">Electropedia:
102
102
  The World's Online Electrotechnical Vocabulary</title>
103
- <source type="src">http://www.electropedia.org</source>
103
+ <uri type="src">http://www.electropedia.org</uri>
104
104
  <docidentifier>IEV</docidentifier>
105
105
  <contributor>
106
106
  <role type="publisher"/>
@@ -164,4 +164,171 @@ RSpec.describe IsoDoc::Iso do
164
164
  OUTPUT
165
165
  end
166
166
 
167
+ it "processes examples" do
168
+ expect(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
169
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
170
+ <preface><foreword>
171
+ <example id="samplecode">
172
+ <p>Hello</p>
173
+ </example>
174
+ </foreword></preface>
175
+ </iso-standard>
176
+ INPUT
177
+ #{HTML_HDR}
178
+ <br/>
179
+ <div>
180
+ <h1 class="ForewordTitle">Foreword</h1>
181
+ <div id="samplecode" class="example">
182
+ <p class="example-title">EXAMPLE</p>
183
+ <p>Hello</p>
184
+ </div>
185
+ </div>
186
+ <p class="zzSTDTitle1"/>
187
+ </div>
188
+ </body>
189
+ </html>
190
+ OUTPUT
191
+ end
192
+
193
+
194
+ it "processes sequences of examples" do
195
+ expect(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
196
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
197
+ <preface><foreword>
198
+ <example id="samplecode">
199
+ <p>Hello</p>
200
+ </example>
201
+ <example id="samplecode2">
202
+ <p>Hello</p>
203
+ </example>
204
+ </foreword></preface>
205
+ </iso-standard>
206
+ INPUT
207
+ #{HTML_HDR}
208
+ <br/>
209
+ <div>
210
+ <h1 class="ForewordTitle">Foreword</h1>
211
+ <div id="samplecode" class="example">
212
+ <p class="example-title">EXAMPLE 1</p>
213
+ <p>Hello</p>
214
+ </div>
215
+ <div id="samplecode2" class="example">
216
+ <p class="example-title">EXAMPLE 2</p>
217
+ <p>Hello</p>
218
+ </div>
219
+ </div>
220
+ <p class="zzSTDTitle1"/>
221
+ </div>
222
+ </body>
223
+ </html>
224
+ OUTPUT
225
+ end
226
+
227
+ it "processes examples (Word)" do
228
+ expect(IsoDoc::Iso::WordConvert.new({}).convert("test", <<~"INPUT", true).sub(/^.*<body/m, "<body")).to be_equivalent_to <<~"OUTPUT"
229
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
230
+ <preface><foreword>
231
+ <example id="samplecode">
232
+ <p>Hello</p>
233
+ </example>
234
+ </foreword></preface>
235
+ </iso-standard>
236
+ INPUT
237
+ <body lang="EN-US" link="blue" vlink="#954F72">
238
+ <div class="WordSection1">
239
+ <p>&#160;</p>
240
+ </div>
241
+ <p>
242
+ <br clear="all" class="section"/>
243
+ </p>
244
+ <div class="WordSection2">
245
+ <p>
246
+ <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
247
+ </p>
248
+ <div>
249
+ <h1 class="ForewordTitle">Foreword</h1>
250
+ <table id="samplecode" class="example" cellspacing="0" cellpadding="0" style="mso-table-lspace:15.0cm;margin-left:423.0pt;mso-table-rspace:15.0cm;margin-right:423.0pt;mso-table-bspace:14.2pt;mso-table-anchor-vertical:paragraph;mso-table-anchor-horizontal:column;mso-table-overlap:never;border-collapse:collapse;">
251
+ <tr>
252
+ <td valign="top" class="example_label" style="width:82.8pt;padding:0 0 0 1em;margin-left:0pt">EXAMPLE</td>
253
+ <td valign="top" class="example">
254
+ <p>Hello</p>
255
+ </td>
256
+ </tr>
257
+ </table>
258
+ </div>
259
+ <p>&#160;</p>
260
+ </div>
261
+ <p>
262
+ <br clear="all" class="section"/>
263
+ </p>
264
+ <div class="WordSection3">
265
+ <p class="zzSTDTitle1"/>
266
+ </div>
267
+ <br clear="all" style="page-break-before:left;mso-break-type:section-break"/>
268
+ <div class="colophon"/>
269
+ </body>
270
+ </html>
271
+ OUTPUT
272
+ end
273
+
274
+
275
+ it "processes sequences of examples (Word)" do
276
+ expect(IsoDoc::Iso::WordConvert.new({}).convert("test", <<~"INPUT", true).sub(/^.*<body/m, "<body")).to be_equivalent_to <<~"OUTPUT"
277
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
278
+ <preface><foreword>
279
+ <example id="samplecode">
280
+ <p>Hello</p>
281
+ </example>
282
+ <example id="samplecode2">
283
+ <p>Hello</p>
284
+ </example>
285
+ </foreword></preface>
286
+ </iso-standard>
287
+ INPUT
288
+ <body lang="EN-US" link="blue" vlink="#954F72">
289
+ <div class="WordSection1">
290
+ <p>&#160;</p>
291
+ </div>
292
+ <p>
293
+ <br clear="all" class="section"/>
294
+ </p>
295
+ <div class="WordSection2">
296
+ <p>
297
+ <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
298
+ </p>
299
+ <div>
300
+ <h1 class="ForewordTitle">Foreword</h1>
301
+ <table id="samplecode" class="example" cellspacing="0" cellpadding="0" style="mso-table-lspace:15.0cm;margin-left:423.0pt;mso-table-rspace:15.0cm;margin-right:423.0pt;mso-table-bspace:14.2pt;mso-table-anchor-vertical:paragraph;mso-table-anchor-horizontal:column;mso-table-overlap:never;border-collapse:collapse;">
302
+ <tr>
303
+ <td valign="top" class="example_label" style="width:82.8pt;padding:0 0 0 1em;margin-left:0pt">EXAMPLE 1</td>
304
+ <td valign="top" class="example">
305
+ <p>Hello</p>
306
+ </td>
307
+ </tr>
308
+ </table>
309
+ <table id="samplecode2" class="example" cellspacing="0" cellpadding="0" style="mso-table-lspace:15.0cm;margin-left:423.0pt;mso-table-rspace:15.0cm;margin-right:423.0pt;mso-table-bspace:14.2pt;mso-table-anchor-vertical:paragraph;mso-table-anchor-horizontal:column;mso-table-overlap:never;border-collapse:collapse;">
310
+ <tr>
311
+ <td valign="top" class="example_label" style="width:82.8pt;padding:0 0 0 1em;margin-left:0pt">EXAMPLE 2</td>
312
+ <td valign="top" class="example">
313
+ <p>Hello</p>
314
+ </td>
315
+ </tr>
316
+ </table>
317
+ </div>
318
+ <p>&#160;</p>
319
+ </div>
320
+ <p>
321
+ <br clear="all" class="section"/>
322
+ </p>
323
+ <div class="WordSection3">
324
+ <p class="zzSTDTitle1"/>
325
+ </div>
326
+ <br clear="all" style="page-break-before:left;mso-break-type:section-break"/>
327
+ <div class="colophon"/>
328
+ </body>
329
+ </html>
330
+ OUTPUT
331
+ end
332
+
333
+
167
334
  end
@@ -70,7 +70,7 @@ RSpec.describe IsoDoc::Iso::Metadata do
70
70
  </version>
71
71
  </iso-standard>
72
72
  INPUT
73
- {:accesseddate=>"2012", :activateddate=>"2013", :agency=>"ISO", :confirmeddate=>"XXX", :createddate=>"2010&ndash;2011", :docnumber=>"ISO/PreCD3 17301-1", :docsubtitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&nbsp;&mdash; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&nbsp;&mdash; Partie&nbsp;1: Riz", :docsubtitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses", :docsubtitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai", :docsubtitlepart=>"Partie&nbsp;1: Riz", :doctitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1: Rice", :doctitleintro=>"Cereals and pulses", :doctitlemain=>"Specifications and test methods", :doctitlepart=>"Part&nbsp;1: Rice", :doctype=>"International Standard", :docyear=>"2016", :draft=>"0.4", :draftinfo=>" (draft 0.4, 2016-05-01)", :editorialgroup=>["TC 34", "SC 4", "WG 3"], :ics=>"XXX", :implementeddate=>"XXX", :issueddate=>"XXX", :obsoleteddate=>"2014", :obsoletes=>nil, :obsoletes_part=>nil, :publisheddate=>"2011", :receiveddate=>"XXX", :revdate=>"2016-05-01", :sc=>"SC 4", :secretariat=>"GB", :stage=>"30", :stage_int=>30, :stageabbr=>"PreCD3", :tc=>"TC 34", :tc_docnumber=>"17301", :unpublished=>true, :updateddate=>"XXX", :wg=>"WG 3"}
73
+ {:accesseddate=>"2012", :activateddate=>"2013", :agency=>"ISO", :authors=>[], :authors_affiliations=>{}, :confirmeddate=>"XXX", :createddate=>"2010&ndash;2011", :docnumber=>"ISO/PreCD3 17301-1", :docsubtitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&nbsp;&mdash; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&nbsp;&mdash; Partie&nbsp;1: Riz", :docsubtitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses", :docsubtitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai", :docsubtitlepart=>"Partie&nbsp;1: Riz", :doctitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1: Rice", :doctitleintro=>"Cereals and pulses", :doctitlemain=>"Specifications and test methods", :doctitlepart=>"Part&nbsp;1: Rice", :doctype=>"International Standard", :docyear=>"2016", :draft=>"0.4", :draftinfo=>" (draft 0.4, 2016-05-01)", :editorialgroup=>["TC 34", "SC 4", "WG 3"], :ics=>"XXX", :implementeddate=>"XXX", :issueddate=>"XXX", :obsoleteddate=>"2014", :obsoletes=>nil, :obsoletes_part=>nil, :publisheddate=>"2011", :receiveddate=>"XXX", :revdate=>"2016-05-01", :sc=>"SC 4", :secretariat=>"GB", :stage=>"30", :stage_int=>30, :stageabbr=>"PreCD3", :tc=>"TC 34", :tc_docnumber=>"17301", :unpublished=>true, :updateddate=>"XXX", :wg=>"WG 3"}
74
74
  OUTPUT
75
75
  end
76
76
 
@@ -147,7 +147,7 @@ OUTPUT
147
147
  </version>
148
148
  </iso-standard>
149
149
  INPUT
150
- {:accesseddate=>"XXX", :agency=>"ISO/IEC", :confirmeddate=>"XXX", :createddate=>"XXX", :docnumber=>"ISO/IEC/CD 17301-1-3", :docsubtitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&nbsp;&mdash; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&nbsp;&mdash; Partie&nbsp;1&ndash;3: Riz", :docsubtitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses", :docsubtitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai", :docsubtitlepart=>"Partie&nbsp;1&ndash;3: Riz", :doctitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1&ndash;3: Rice", :doctitleintro=>"Cereals and pulses", :doctitlemain=>"Specifications and test methods", :doctitlepart=>"Part&nbsp;1&ndash;3: Rice", :doctype=>"International Standard", :docyear=>"2016", :draft=>"12", :draftinfo=>" (draft 12, 2016-05-01)", :editorialgroup=>["ABC 34", "DEF 4", "GHI 3"], :ics=>"1.2.3, 1.2.3", :implementeddate=>"XXX", :issueddate=>"XXX", :obsoleteddate=>"XXX", :obsoletes=>"IEC 8121", :obsoletes_part=>"3.1", :publisheddate=>"XXX", :receiveddate=>"XXX", :revdate=>"2016-05-01", :sc=>"DEF 4", :secretariat=>"XXXX", :stage=>"60", :stage_int=>60, :stageabbr=>"IS", :tc=>"ABC 34", :tc_docnumber=>"17301", :unpublished=>false, :updateddate=>"XXX", :wg=>"GHI 3"}
150
+ {:accesseddate=>"XXX", :agency=>"ISO/IEC", :authors=>[], :authors_affiliations=>{}, :confirmeddate=>"XXX", :createddate=>"XXX", :docnumber=>"ISO/IEC/CD 17301-1-3", :docsubtitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&nbsp;&mdash; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&nbsp;&mdash; Partie&nbsp;1&ndash;3: Riz", :docsubtitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses", :docsubtitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai", :docsubtitlepart=>"Partie&nbsp;1&ndash;3: Riz", :doctitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1&ndash;3: Rice", :doctitleintro=>"Cereals and pulses", :doctitlemain=>"Specifications and test methods", :doctitlepart=>"Part&nbsp;1&ndash;3: Rice", :doctype=>"International Standard", :docyear=>"2016", :draft=>"12", :draftinfo=>" (draft 12, 2016-05-01)", :editorialgroup=>["ABC 34", "DEF 4", "GHI 3"], :ics=>"1.2.3, 1.2.3", :implementeddate=>"XXX", :issueddate=>"XXX", :obsoleteddate=>"XXX", :obsoletes=>"IEC 8121", :obsoletes_part=>"3.1", :publisheddate=>"XXX", :receiveddate=>"XXX", :revdate=>"2016-05-01", :sc=>"DEF 4", :secretariat=>"XXXX", :stage=>"60", :stage_int=>60, :stageabbr=>"IS", :tc=>"ABC 34", :tc_docnumber=>"17301", :unpublished=>false, :updateddate=>"XXX", :wg=>"GHI 3"}
151
151
  OUTPUT
152
152
  end
153
153
 
@@ -416,4 +416,51 @@ RSpec.describe IsoDoc do
416
416
  expect(html).to match(%r{<h2 class="TermNum" id="paddy">1\.2</h2>})
417
417
  end
418
418
 
419
+ it "inserts default paragraph between two tables for Word" do
420
+ FileUtils.rm_f "test.doc"
421
+ FileUtils.rm_f "test.html"
422
+ IsoDoc::Iso::WordConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("test", <<~"INPUT", false)
423
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
424
+ <annex id="P" inline-header="false" obligation="normative">
425
+ <example id="_63112cbc-cde0-435f-9553-e0b8c4f5851c">
426
+ <p id="_158d4efa-b1c9-4aec-b325-756de8e4c968">'1M', '01M', and '0001M' all describe the calendar month January.</p>
427
+ </example>
428
+ <example id="_63112cbc-cde0-435f-9553-e0b8c4f5851d">
429
+ <p id="_158d4efa-b1c9-4aec-b325-756de8e4c969">'2M', '02M', and '0002M' all describe the calendar month February.</p>
430
+ </example>
431
+ </annex>
432
+ </iso-standard>
433
+ INPUT
434
+ word = File.read("test.doc").sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">').
435
+ sub(%r{<div style="mso-element:footnote-list"/>.*$}m, "")
436
+ expect(word).to be_equivalent_to <<~"OUTPUT"
437
+ <div class="WordSection3">
438
+ <p class="zzSTDTitle1"></p>
439
+ <p class="MsoNormal"><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
440
+ <div class="Section3"><a name="P" id="P"></a>
441
+ <table class="example" cellspacing="0" cellpadding="0" style="mso-table-lspace:15.0cm;margin-left:423.0pt;mso-table-rspace:15.0cm;margin-right:423.0pt;mso-table-bspace:14.2pt;mso-table-anchor-vertical:paragraph;mso-table-anchor-horizontal:column;mso-table-overlap:never;border-collapse:collapse;"><a name="_63112cbc-cde0-435f-9553-e0b8c4f5851c" id="_63112cbc-cde0-435f-9553-e0b8c4f5851c"></a>
442
+ <tr>
443
+ <td valign="top" class="example_label" style="width:82.8pt;padding:0 0 0 1em;margin-left:0pt">EXAMPLE 1</td>
444
+ <td valign="top" class="example">
445
+ <p class="example"><a name="_158d4efa-b1c9-4aec-b325-756de8e4c968" id="_158d4efa-b1c9-4aec-b325-756de8e4c968"></a>'1M', '01M', and '0001M' all describe the calendar month January.</p>
446
+ </td>
447
+ </tr>
448
+ </table><p style="margin-top:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:0.0pt;margin-bottom:.0001pt;line-height:1.0pt;mso-line-height-rule:exactly" class="MsoNormal"><span lang="EN-GB" style="display:none;mso-hide:all" xml:lang="EN-GB">&#xA0;</span></p>
449
+ <table class="example" cellspacing="0" cellpadding="0" style="mso-table-lspace:15.0cm;margin-left:423.0pt;mso-table-rspace:15.0cm;margin-right:423.0pt;mso-table-bspace:14.2pt;mso-table-anchor-vertical:paragraph;mso-table-anchor-horizontal:column;mso-table-overlap:never;border-collapse:collapse;"><a name="_63112cbc-cde0-435f-9553-e0b8c4f5851d" id="_63112cbc-cde0-435f-9553-e0b8c4f5851d"></a>
450
+ <tr>
451
+ <td valign="top" class="example_label" style="width:82.8pt;padding:0 0 0 1em;margin-left:0pt">EXAMPLE 2</td>
452
+ <td valign="top" class="example">
453
+ <p class="example"><a name="_158d4efa-b1c9-4aec-b325-756de8e4c969" id="_158d4efa-b1c9-4aec-b325-756de8e4c969"></a>'2M', '02M', and '0002M' all describe the calendar month February.</p>
454
+ </td>
455
+ </tr>
456
+ </table>
457
+ </div>
458
+ </div>
459
+ <br clear="all" style="page-break-before:left;mso-break-type:section-break"/>
460
+ <div class="colophon"></div>
461
+ OUTPUT
462
+ end
463
+
464
+
465
+
419
466
  end
@@ -68,17 +68,17 @@ RSpec.describe IsoDoc do
68
68
  <p class="TermNum" id="paddy1">1.1</p><p class="Terms" style="text-align:left;">paddy</p>
69
69
 
70
70
  <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">&lt;rice&gt; rice retaining its husk after threshing</p>
71
- <table id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tr><td valign="top" class="example_label" style="width:82.8pt;padding:0 0 0 1em;margin-left:0pt">EXAMPLE 1</td><td valign="top" class="example">
71
+ <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example"><p class="example-title">EXAMPLE 1</p>
72
72
  <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
73
73
  <ul>
74
74
  <li>A</li>
75
75
  </ul>
76
- </td></tr></table>
77
- <table id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tr><td valign="top" class="example_label" style="width:82.8pt;padding:0 0 0 1em;margin-left:0pt">EXAMPLE 2</td><td valign="top" class="example">
76
+ </div>
77
+ <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p class="example-title">EXAMPLE 2</p>
78
78
  <ul>
79
79
  <li>A</li>
80
80
  </ul>
81
- </td></tr></table>
81
+ </div>
82
82
 
83
83
  <p>[TERMREF]
84
84
  <a href="#ISO7301">ISO 7301:2011, 3.1</a>
@@ -87,11 +87,11 @@ RSpec.describe IsoDoc do
87
87
  <p class="AltTerms" style="text-align:left;">rough rice</p>
88
88
  <p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
89
89
  <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
90
- <table id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tr><td valign="top" class="example_label" style="width:82.8pt;padding:0 0 0 1em;margin-left:0pt">EXAMPLE</td><td valign="top" class="example">
90
+ <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
91
91
  <ul>
92
92
  <li>A</li>
93
93
  </ul>
94
- </td></tr></table>
94
+ </div>
95
95
  <div class="Note"><p>Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
96
96
  <div class="Note"><p>Note 2 to entry: <ul><li>A</li></ul><p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></p></div>
97
97
  <p>[TERMREF]
@@ -434,14 +434,9 @@ RSpec.describe IsoDoc do
434
434
  <p class="zzSTDTitle1"/>
435
435
  <div id="scope">
436
436
  <h1>1.&#160; Scope</h1>
437
- <table id="N" class="example" cellspacing="0" cellpadding="0" style="border-collapse:collapse">
438
- <tr>
439
- <td valign="top" class="example_label" style="width:82.8pt;padding:0 0 0 1em;margin-left:0pt">EXAMPLE</td>
440
- <td valign="top" class="example">
437
+ <div id="N" class="example"><p class="example-title">EXAMPLE</p>
441
438
  <p>Hello</p>
442
- </td>
443
- </tr>
444
- </table>
439
+ </div>
445
440
  <p>
446
441
  <a href="#N">Example</a>
447
442
  </p>
@@ -460,29 +455,29 @@ RSpec.describe IsoDoc do
460
455
  <div id="widgets">
461
456
  <h1>3.&#160; Widgets</h1>
462
457
  <div id="widgets1"><h2>3.1. </h2>
463
- <table id="note1" class="example" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tr><td valign="top" class="example_label" style="width:82.8pt;padding:0 0 0 1em;margin-left:0pt">EXAMPLE 1</td><td valign="top" class="example">
458
+ <div id="note1" class="example"><p class="example-title">EXAMPLE 1</p>
464
459
  <p>Hello</p>
465
- </td></tr></table>
466
- <table id="note2" class="example" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tr><td valign="top" class="example_label" style="width:82.8pt;padding:0 0 0 1em;margin-left:0pt">EXAMPLE 2</td><td valign="top" class="example">
460
+ </div>
461
+ <div id="note2" class="example"><p class="example-title">EXAMPLE 2</p>
467
462
  <p>Hello</p>
468
- </td></tr></table>
463
+ </div>
469
464
  <p> <a href="#note1">Example 1</a> <a href="#note2">Example 2</a> </p>
470
465
  </div>
471
466
  </div>
472
467
  <br/>
473
468
  <div id="annex1" class="Section3">
474
469
  <div id="annex1a"><h2>A.1. </h2>
475
- <table id="AN" class="example" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tr><td valign="top" class="example_label" style="width:82.8pt;padding:0 0 0 1em;margin-left:0pt">EXAMPLE</td><td valign="top" class="example">
470
+ <div id="AN" class="example"><p class="example-title">EXAMPLE</p>
476
471
  <p>Hello</p>
477
- </td></tr></table>
472
+ </div>
478
473
  </div>
479
474
  <div id="annex1b"><h2>A.2. </h2>
480
- <table id="Anote1" class="example" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tr><td valign="top" class="example_label" style="width:82.8pt;padding:0 0 0 1em;margin-left:0pt">EXAMPLE 1</td><td valign="top" class="example">
475
+ <div id="Anote1" class="example"><p class="example-title">EXAMPLE 1</p>
481
476
  <p>Hello</p>
482
- </td></tr></table>
483
- <table id="Anote2" class="example" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tr><td valign="top" class="example_label" style="width:82.8pt;padding:0 0 0 1em;margin-left:0pt">EXAMPLE 2</td><td valign="top" class="example">
477
+ </div>
478
+ <div id="Anote2" class="example"><p class="example-title">EXAMPLE 2</p>
484
479
  <p>Hello</p>
485
- </td></tr></table>
480
+ </div>
486
481
  </div>
487
482
  </div>
488
483
  </div>
@@ -15,7 +15,7 @@ RSpec.describe Metanorma::Iso::Processor do
15
15
 
16
16
  it "registers output formats against metanorma" do
17
17
  expect(processor.output_formats.sort.to_s).to be_equivalent_to <<~"OUTPUT"
18
- [[:doc, "doc"], [:html, "html"], [:html_alt, "alt.html"], [:xml, "xml"]]
18
+ [[:doc, "doc"], [:html, "html"], [:html_alt, "alt.html"], [:rxl, "rxl"], [:xml, "xml"]]
19
19
  OUTPUT
20
20
  end
21
21
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iso
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.14
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-15 00:00:00.000000000 Z
11
+ date: 2019-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor