metanorma-iec 1.0.2 → 1.0.7

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.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/macos.yml +10 -10
  3. data/.github/workflows/ubuntu.yml +25 -11
  4. data/.github/workflows/windows.yml +11 -12
  5. data/README.adoc +3 -2
  6. data/lib/asciidoctor/iec/biblio.rng +131 -46
  7. data/lib/asciidoctor/iec/converter.rb +19 -130
  8. data/lib/asciidoctor/iec/front.rb +220 -0
  9. data/lib/asciidoctor/iec/isodoc.rng +32 -4
  10. data/lib/asciidoctor/iec/isostandard.rng +10 -0
  11. data/lib/isodoc/iec/base_convert.rb +118 -0
  12. data/lib/isodoc/iec/html/htmlstyle.scss +11 -8
  13. data/lib/isodoc/iec/html/scripts.html +23 -21
  14. data/lib/isodoc/iec/html_convert.rb +8 -0
  15. data/lib/isodoc/iec/i18n-en.yaml +2 -0
  16. data/lib/isodoc/iec/i18n-fr.yaml +2 -0
  17. data/lib/isodoc/iec/iec.international-standard.xsl +3969 -0
  18. data/lib/isodoc/iec/metadata.rb +3 -52
  19. data/lib/isodoc/iec/pdf_convert.rb +31 -0
  20. data/lib/metanorma-iec.rb +1 -0
  21. data/lib/metanorma/iec/processor.rb +12 -1
  22. data/lib/metanorma/iec/version.rb +1 -1
  23. data/spec/asciidoctor-iec/base_spec.rb +17 -27
  24. data/spec/asciidoctor-iec/blocks_spec.rb +15 -7
  25. data/spec/asciidoctor-iec/cleanup_spec.rb +13 -7
  26. data/spec/asciidoctor-iec/iev_spec.rb +161 -0
  27. data/spec/asciidoctor-iec/inline_spec.rb +2 -1
  28. data/spec/asciidoctor-iec/section_spec.rb +8 -8
  29. data/spec/assets/iso.xml +65 -2
  30. data/spec/examples/rice.html +5 -5
  31. data/spec/examples/rice_img/rice_image1.png +0 -0
  32. data/spec/examples/rice_img/rice_image2.png +0 -0
  33. data/spec/examples/rice_img/rice_image3_1.png +0 -0
  34. data/spec/examples/rice_img/rice_image3_2.png +0 -0
  35. data/spec/examples/rice_img/rice_image3_3.png +0 -0
  36. data/spec/isodoc/i18n_spec.rb +15 -22
  37. data/spec/isodoc/iev_spec.rb +356 -0
  38. data/spec/isodoc/inline_spec.rb +2 -2
  39. data/spec/isodoc/iso_spec.rb +2 -19
  40. data/spec/isodoc/metadata_spec.rb +12 -7
  41. data/spec/isodoc/postproc_spec.rb +9 -3
  42. data/spec/isodoc/section_spec.rb +11 -13
  43. data/spec/isodoc/terms_spec.rb +2 -2
  44. data/spec/metanorma/processor_spec.rb +3 -3
  45. data/spec/spec_helper.rb +3 -2
  46. metadata +12 -2
@@ -158,7 +158,7 @@ RSpec.describe IsoDoc do
158
158
  <eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</stem>
159
159
  </p>
160
160
  </foreword></preface>
161
- <bibliography><references id="_normative_references" obligation="informative"><title>Normative References</title>
161
+ <bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
162
162
  <bibitem id="ISO712" type="standard">
163
163
  <title format="text/plain">Cereals and cereal products</title>
164
164
  <docidentifier>ISO 712</docidentifier>
@@ -213,7 +213,7 @@ RSpec.describe IsoDoc do
213
213
  <eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</eref>
214
214
  </p>
215
215
  </foreword></preface>
216
- <bibliography><references id="_normative_references" obligation="informative"><title>Normative References</title>
216
+ <bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
217
217
  <bibitem id="ISO712" type="standard">
218
218
  <title format="text/plain">Cereals and cereal products</title>
219
219
  <docidentifier>ISO 712</docidentifier>
@@ -15,25 +15,8 @@ RSpec.describe IsoDoc::Iec do
15
15
  INPUT
16
16
  html = File.read("test.html", encoding: "utf-8")
17
17
  expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
18
- expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "Cambria", serif;]m)
19
- expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Cambria", serif;]m)
20
- end
21
-
22
- it "processes isodoc as ISO: alt HTML output" do
23
- FileUtils.rm_f "test.html"
24
- IsoDoc::Iec::HtmlConvert.new({alt: true}).convert("test", <<~"INPUT", false)
25
- <iso-standard xmlns="http://riboseinc.com/isoxml">
26
- <preface><foreword>
27
- <note>
28
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
29
- </note>
30
- </foreword></preface>
31
- </iso-standard>
32
- INPUT
33
- html = File.read("test.html", encoding: "utf-8")
34
- expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Space Mono", monospace;]m)
35
- expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "Lato", sans-serif;]m)
36
- expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Lato", sans-serif;]m)
18
+ expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "Arial", sans-serif;]m)
19
+ expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Arial", sans-serif;]m)
37
20
  end
38
21
 
39
22
  it "processes isodoc as ISO: Chinese HTML output" do
@@ -32,20 +32,22 @@ RSpec.describe IsoDoc::Iec::Metadata do
32
32
  <contributor>
33
33
  <role type="author"/>
34
34
  <organization>
35
+ <name>International Organization for Standardization</name>
35
36
  <abbreviation>ISO</abbreviation>
36
37
  </organization>
37
38
  </contributor>
38
39
  <contributor>
39
40
  <role type="publisher"/>
40
41
  <organization>
42
+ <name>International Organization for Standardization</name>
41
43
  <abbreviation>ISO</abbreviation>
42
44
  </organization>
43
45
  </contributor>
44
46
  <language>en</language>
45
47
  <script>Latn</script>
46
48
  <status>
47
- <stage>35</stage>
48
- <substage>20</substage>
49
+ <stage abbreviation="CD">35</stage>
50
+ <substage abbreviation="3CD">20</substage>
49
51
  <iteration>3</iteration>
50
52
  </status>
51
53
  <copyright>
@@ -71,7 +73,7 @@ RSpec.describe IsoDoc::Iec::Metadata do
71
73
  </bibdata>
72
74
  </iso-standard>
73
75
  INPUT
74
- {:accesseddate=>"2012", :activateddate=>"2013", :agency=>"ISO", :authors=>[], :authors_affiliations=>{}, :createddate=>"2010&ndash;2011", :docnumber=>"ISO/PreCD3 17301-1", :docnumeric=>"1730", :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=>"Riz", :docsubtitlepartlabel=>"Partie&nbsp;1", :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=>"Rice", :doctitlepartlabel=>"Part&nbsp;1", :doctype=>"International Standard", :docyear=>"2016", :draft=>"0.4", :draftinfo=>" (draft 0.4, 2016-05-01)", :edition=>"2", :editorialgroup=>["TC 34", "SC 4", "WG 3"], :ics=>"XXX", :obsoleteddate=>"2014", :obsoletes=>nil, :obsoletes_part=>nil, :publisheddate=>"2011", :revdate=>"2016-05-01", :sc=>"SC 4", :secretariat=>"GB", :stage=>"35", :stage_int=>35, :stageabbr=>"CD", :statusabbr=>"3CD", :tc=>"TC 34", :tc_docnumber=>["17301"], :unpublished=>true, :wg=>"WG 3"}
76
+ {:accesseddate=>"2012", :activateddate=>"2013", :agency=>"ISO", :authors=>[], :authors_affiliations=>{}, :createddate=>"2010&ndash;2011", :docnumber=>"ISO/PreCD3 17301-1", :docnumber_lang=>nil, :docnumber_reference=>nil, :docnumeric=>"1730", :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=>"Riz", :docsubtitlepartlabel=>"Partie&nbsp;1", :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=>"Rice", :doctitlepartlabel=>"Part&nbsp;1", :doctype=>"International Standard", :docyear=>"2016", :draft=>"0.4", :draftinfo=>" (draft 0.4, 2016-05-01)", :edition=>"2", :editorialgroup=>["TC 34", "SC 4", "WG 3"], :ics=>"XXX", :obsoleteddate=>"2014", :obsoletes=>nil, :obsoletes_part=>nil, :publisheddate=>"2011", :publisher=>"International Organization for Standardization", :revdate=>"2016-05-01", :revdate_monthyear=>"May 2016", :sc=>"SC 4", :secretariat=>"GB", :stage=>"35", :stage_int=>35, :stageabbr=>"CD", :statusabbr=>"3CD", :tc=>"TC 34", :tc_docnumber=>["17301"], :unpublished=>true, :wg=>"WG 3"}
75
77
  OUTPUT
76
78
  end
77
79
 
@@ -98,26 +100,29 @@ OUTPUT
98
100
  <contributor>
99
101
  <role type="author"/>
100
102
  <organization>
101
- <name>ISO</name>
103
+ <name>International Organization for Standardization</name>
104
+ <abbreviation>ISO</abbreviation>
102
105
  </organization>
103
106
  </contributor>
104
107
  <contributor>
105
108
  <role type="publisher"/>
106
109
  <organization>
110
+ <name>International Organization for Standardization</name>
107
111
  <abbreviation>ISO</abbreviation>
108
112
  </organization>
109
113
  </contributor>
110
114
  <contributor>
111
115
  <role type="publisher"/>
112
116
  <organization>
117
+ <name>International Electrotechnical Commission</name>
113
118
  <abbreviation>IEC</abbreviation>
114
119
  </organization>
115
120
  </contributor>
116
121
  <language>en</language>
117
122
  <script>Latn</script>
118
123
  <status>
119
- <stage>50</stage>
120
- <substage>20</substage>
124
+ <stage abbreviation="FDIS">50</stage>
125
+ <substage abbreviation="CFDIS">20</substage>
121
126
  </status>
122
127
  <copyright>
123
128
  <from>2016</from>
@@ -147,7 +152,7 @@ OUTPUT
147
152
  </bibdata>
148
153
  </iso-standard>
149
154
  INPUT
150
- {:agency=>"ISO/IEC", :authors=>[], :authors_affiliations=>{}, :docnumber=>"ISO/IEC/CD 17301-1-3", :docnumeric=>nil, :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=>"Riz", :docsubtitlepartlabel=>"Partie&nbsp;1&ndash;3", :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=>"Rice", :doctitlepartlabel=>"Part&nbsp;1&ndash;3", :doctype=>"Technical Report", :docyear=>"2016", :draft=>nil, :draftinfo=>"", :edition=>nil, :editorialgroup=>["ABC 34", "DEF 4", "GHI 3"], :ics=>"1.2.3, 1.2.3", :obsoletes=>"IEC 8121", :obsoletes_part=>"3.1", :revdate=>nil, :sc=>"DEF 4", :secretariat=>"XXXX", :stage=>"50", :stage_int=>50, :stageabbr=>"RFDIS", :statusabbr=>"CFDIS", :tc=>"ABC 34", :tc_docnumber=>["17301"], :unpublished=>true, :wg=>"GHI 3"}
155
+ {:agency=>"ISO/IEC", :authors=>[], :authors_affiliations=>{}, :docnumber=>"ISO/IEC/CD 17301-1-3", :docnumber_lang=>nil, :docnumber_reference=>nil, :docnumeric=>nil, :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=>"Riz", :docsubtitlepartlabel=>"Partie&nbsp;1&ndash;3", :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=>"Rice", :doctitlepartlabel=>"Part&nbsp;1&ndash;3", :doctype=>"Technical Report", :docyear=>"2016", :draft=>nil, :draftinfo=>"", :edition=>nil, :editorialgroup=>["ABC 34", "DEF 4", "GHI 3"], :ics=>"1.2.3, 1.2.3", :obsoletes=>"IEC 8121", :obsoletes_part=>"3.1", :publisher=>"International Organization for Standardization and International Electrotechnical Commission", :revdate=>nil, :revdate_monthyear=>nil, :sc=>"DEF 4", :secretariat=>"XXXX", :stage=>"50", :stage_int=>50, :stageabbr=>"FDIS", :statusabbr=>"CFDIS", :tc=>"ABC 34", :tc_docnumber=>["17301"], :unpublished=>true, :wg=>"GHI 3"}
151
156
  OUTPUT
152
157
  end
153
158
 
@@ -91,6 +91,12 @@ RSpec.describe IsoDoc do
91
91
  expect(word).to match(/<style>/)
92
92
  end
93
93
 
94
+ it "generates Pdf output docs with null configuration from file" do
95
+ FileUtils.rm_f "spec/assets/iso.pdf"
96
+ IsoDoc::Iec::PdfConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("spec/assets/iso.xml", nil, false)
97
+ expect(File.exist?("spec/assets/iso.pdf")).to be true
98
+ end
99
+
94
100
  it "populates Word template with terms reference labels" do
95
101
  FileUtils.rm_f "test.doc"
96
102
  FileUtils.rm_f "test.html"
@@ -117,8 +123,8 @@ RSpec.describe IsoDoc do
117
123
  sub(%r{<br.*$}m, "")
118
124
  expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
119
125
  <div class="WordSection3">
120
- #{IEC_TITLE}
121
- <div><a name="_terms_and_definitions" id="_terms_and_definitions"></a><h1 class="main">1<span style="mso-tab-count:1">&#xA0; </span>Terms and definitions</h1>
126
+ #{IEC_TITLE.gsub(/\&#160;/, "&#xA0;")}
127
+ <div><a name="_terms_and_definitions" id="_terms_and_definitions"></a><h1 class="main">1<span style="mso-tab-count:1">&#xA0; </span>Terms and Definitions</h1>
122
128
  <p class="TermNum"><a name="paddy1" id="paddy1"></a>1.1</p><p class="Terms" style="text-align:left;">paddy</p>
123
129
  <p class="MsoNormal"><a name="_eb29b35e-123e-4d1c-b50b-2714d41e747f" id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"></a>rice retaining its husk after threshing</p>
124
130
  <p class="MsoNormal">[SOURCE: <a href="#ISO7301">ISO 7301:2011, 3.1</a>, modified &#x2014; The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p></div>
@@ -286,7 +292,7 @@ RSpec.describe IsoDoc do
286
292
  <p class='SourceTitle' style='text-align:center;'>Figure A.1</p>
287
293
  <p class="TableTitle" style="text-align:center;">Table A.1</p>
288
294
  <div align='center' class='table_container'>
289
- <table class='MsoISOTable' style='mso-table-lspace:15.0cm;margin-left:423.0pt;mso-table-rspace:15.0cm;margin-right:423.0pt;mso-table-anchor-horizontal:column;mso-table-overlap:never;border-spacing:0;border-width:1px;'>
295
+ <table class='MsoISOTable' style='mso-table-anchor-horizontal:column;mso-table-overlap:never;border-spacing:0;border-width:1px;'>
290
296
  <a name='samplecode' id='samplecode'/>
291
297
  <tbody>
292
298
  <tr>
@@ -12,16 +12,14 @@ RSpec.describe IsoDoc do
12
12
  <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
13
13
  <title>Introduction Subsection</title>
14
14
  </clause>
15
- <patent-notice>
16
15
  <p>This is patent boilerplate</p>
17
- </patent-notice>
18
16
  </introduction></preface><sections>
19
17
  <clause id="D" obligation="normative">
20
18
  <title>Scope</title>
21
19
  <p id="E">Text</p>
22
20
  </clause>
23
21
 
24
- <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
22
+ <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
25
23
  <title>Normal Terms</title>
26
24
  <term id="J">
27
25
  <preferred>Term2</preferred>
@@ -58,11 +56,11 @@ RSpec.describe IsoDoc do
58
56
  <appendix id="Q2" inline-header="false" obligation="normative">
59
57
  <title>An Appendix</title>
60
58
  </appendix>
61
- </annex><bibliography><references id="R" obligation="informative">
59
+ </annex><bibliography><references id="R" obligation="informative" normative="true">
62
60
  <title>Normative References</title>
63
61
  </references><clause id="S" obligation="informative">
64
62
  <title>Bibliography</title>
65
- <references id="T" obligation="informative">
63
+ <references id="T" obligation="informative" normative="false">
66
64
  <title>Bibliography Subsection</title>
67
65
  </references>
68
66
  </clause>
@@ -169,16 +167,14 @@ OUTPUT
169
167
  <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
170
168
  <title>Introduction Subsection</title>
171
169
  </clause>
172
- <patent-notice>
173
170
  <p>This is patent boilerplate</p>
174
- </patent-notice>
175
171
  </introduction></preface><sections>
176
172
  <clause id="D" obligation="normative">
177
173
  <title>Scope</title>
178
174
  <p id="E">Text</p>
179
175
  </clause>
180
176
 
181
- <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
177
+ <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
182
178
  <title>Normal Terms</title>
183
179
  <term id="J">
184
180
  <preferred>Term2</preferred>
@@ -215,11 +211,11 @@ OUTPUT
215
211
  <appendix id="Q2" inline-header="false" obligation="normative">
216
212
  <title>An Appendix</title>
217
213
  </appendix>
218
- </annex><bibliography><references id="R" obligation="informative">
214
+ </annex><bibliography><references id="R" obligation="informative" normative="true">
219
215
  <title>Normative References</title>
220
216
  </references><clause id="S" obligation="informative">
221
217
  <title>Bibliography</title>
222
- <references id="T" obligation="informative">
218
+ <references id="T" obligation="informative" normative="false">
223
219
  <title>Bibliography Subsection</title>
224
220
  </references>
225
221
  </clause>
@@ -329,7 +325,7 @@ OUTPUT
329
325
  <div class="boilerplate_legal"/>
330
326
  </div>
331
327
  #{IEC_TITLE}
332
- <div id="H"><h1>1&#160; Terms and definitions</h1>
328
+ <div id="H"><h1>1&#160; Terms, Definitions, Symbols and Abbreviated Terms</h1>
333
329
  <p class="TermNum" id="J">1.1</p>
334
330
  <p class="Terms" style="text-align:left;">Term2</p>
335
331
  </div>
@@ -379,7 +375,8 @@ OUTPUT
379
375
  <iso-standard xmlns="http://riboseinc.com/isoxml">
380
376
  <bibdata>
381
377
  <status>
382
- <stage>60</stage>
378
+ <stage abbreviation="PPUB">60</stage>
379
+ <substage abbreviation="PPUB">60</substage>
383
380
  </status>
384
381
  </bibdata>
385
382
  <sections>
@@ -413,7 +410,8 @@ OUTPUT
413
410
  <iso-standard xmlns="http://riboseinc.com/isoxml">
414
411
  <bibdata>
415
412
  <status>
416
- <stage>30</stage>
413
+ <stage abbreviation="CD">30</stage>
414
+ <substage abbreviation="CD">00</substage>
417
415
  </status>
418
416
  </bibdata>
419
417
  <sections>
@@ -5,7 +5,7 @@ RSpec.describe IsoDoc do
5
5
  expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
6
  <iso-standard xmlns="http://riboseinc.com/isoxml">
7
7
  <sections>
8
- <terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
8
+ <terms id="_terms_and_definitions" obligation="normative"><title>Terms and definitions</title>
9
9
 
10
10
  <term id="paddy1"><preferred>paddy</preferred>
11
11
  <domain>rice</domain>
@@ -98,7 +98,7 @@ OUTPUT
98
98
  expect((IsoDoc::Iec::WordConvert.new({}).convert("test", <<~"INPUT", true).sub(%r{^.*<div id="_terms_and_definitions">}m, '<div id="_terms_and_definitions">').sub(%r{<br[^>]*>\s*<div class="colophon"/>.*$}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
99
99
  <iso-standard xmlns="http://riboseinc.com/isoxml">
100
100
  <sections>
101
- <terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
101
+ <terms id="_terms_and_definitions" obligation="normative"><title>Terms and definitions</title>
102
102
 
103
103
  <term id="paddy1"><preferred>paddy</preferred>
104
104
  <domain>rice</domain>
@@ -15,7 +15,7 @@ RSpec.describe Metanorma::Iec::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"], [:rxl, "rxl"], [:xml, "xml"]]
18
+ [[:doc, "doc"], [:html, "html"], [:pdf, "pdf"], [:rxl, "rxl"], [:xml, "xml"]]
19
19
  OUTPUT
20
20
  end
21
21
 
@@ -57,7 +57,7 @@ RSpec.describe Metanorma::Iec::Processor do
57
57
  </p>
58
58
  <p class="zzSTDTitle1">&#xA0;</p>
59
59
  <div id="">
60
- <h1 class="ForewordTitle">FOREWORD</h1>
60
+ <h1 class="ForewordTitle" id="toc0">FOREWORD</h1>
61
61
  <div class="boilerplate_legal"></div>
62
62
  </div>
63
63
  <p class="zzSTDTitle1">INTERNATIONAL ELECTROTECHNICAL COMMISSION</p>
@@ -67,7 +67,7 @@ RSpec.describe Metanorma::Iec::Processor do
67
67
  <b></b>
68
68
  </p>
69
69
  <p class="zzSTDTitle1">&#xA0;</p>
70
- <div id="H"><h1>1&#xA0; Terms and definitions</h1>
70
+ <div id="H"><h1 id="toc1">1&#xA0; Terms, Definitions, Symbols and Abbreviated Terms</h1>
71
71
  <h2 class="TermNum" id="J">1.1</h2>
72
72
  <p class="Terms" style="text-align:left;">Term2</p>
73
73
  </div>
@@ -160,8 +160,8 @@ BLANK_HDR = <<~"HDR"
160
160
  <language>en</language>
161
161
  <script>Latn</script>
162
162
  <status>
163
- <stage>60</stage>
164
- <substage>60</substage>
163
+ <stage abbreviation="PPUB">60</stage>
164
+ <substage abbreviation="PPUB">60</substage>
165
165
  </status>
166
166
  <copyright>
167
167
  <from>#{Time.new.year}</from>
@@ -179,6 +179,7 @@ BLANK_HDR = <<~"HDR"
179
179
  <subcommittee/>
180
180
  <workgroup/>
181
181
  </editorialgroup>
182
+ <stagename>International standard</stagename>
182
183
  </ext>
183
184
  </bibdata>
184
185
  #{BOILERPLATE}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-20 00:00:00.000000000 Z
11
+ date: 2020-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-jing
@@ -217,6 +217,7 @@ files:
217
217
  - lib/asciidoctor/iec/basicdoc.rng
218
218
  - lib/asciidoctor/iec/biblio.rng
219
219
  - lib/asciidoctor/iec/converter.rb
220
+ - lib/asciidoctor/iec/front.rb
220
221
  - lib/asciidoctor/iec/i18n-en.yaml
221
222
  - lib/asciidoctor/iec/i18n-fr.yaml
222
223
  - lib/asciidoctor/iec/i18n-zh-Hans.yaml
@@ -240,7 +241,9 @@ files:
240
241
  - lib/isodoc/iec/i18n-en.yaml
241
242
  - lib/isodoc/iec/i18n-fr.yaml
242
243
  - lib/isodoc/iec/i18n-zh-Hans.yaml
244
+ - lib/isodoc/iec/iec.international-standard.xsl
243
245
  - lib/isodoc/iec/metadata.rb
246
+ - lib/isodoc/iec/pdf_convert.rb
244
247
  - lib/isodoc/iec/word_convert.rb
245
248
  - lib/metanorma-iec.rb
246
249
  - lib/metanorma/iec.rb
@@ -250,6 +253,7 @@ files:
250
253
  - spec/asciidoctor-iec/base_spec.rb
251
254
  - spec/asciidoctor-iec/blocks_spec.rb
252
255
  - spec/asciidoctor-iec/cleanup_spec.rb
256
+ - spec/asciidoctor-iec/iev_spec.rb
253
257
  - spec/asciidoctor-iec/inline_spec.rb
254
258
  - spec/asciidoctor-iec/lists_spec.rb
255
259
  - spec/asciidoctor-iec/section_spec.rb
@@ -264,7 +268,13 @@ files:
264
268
  - spec/examples/rice.doc
265
269
  - spec/examples/rice.html
266
270
  - spec/examples/rice.xml
271
+ - spec/examples/rice_img/rice_image1.png
272
+ - spec/examples/rice_img/rice_image2.png
273
+ - spec/examples/rice_img/rice_image3_1.png
274
+ - spec/examples/rice_img/rice_image3_2.png
275
+ - spec/examples/rice_img/rice_image3_3.png
267
276
  - spec/isodoc/i18n_spec.rb
277
+ - spec/isodoc/iev_spec.rb
268
278
  - spec/isodoc/inline_spec.rb
269
279
  - spec/isodoc/iso_spec.rb
270
280
  - spec/isodoc/metadata_spec.rb