metanorma-iec 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,31 @@
1
+ require_relative "base_convert"
2
+ require "isodoc"
3
+
4
+ module IsoDoc
5
+ module Iec
6
+
7
+ # A {Converter} implementation that generates HTML output, and a document
8
+ # schema encapsulation of the document for validation
9
+ #
10
+ class PdfConvert < IsoDoc::XslfoPdfConvert
11
+ def initialize(options)
12
+ @libdir = File.dirname(__FILE__)
13
+ super
14
+ end
15
+
16
+ def convert(filename, file = nil, debug = false)
17
+ file = File.read(filename, encoding: "utf-8") if file.nil?
18
+ docxml, outname_html, dir = convert_init(file, filename, debug)
19
+ /\.xml$/.match(filename) or
20
+ filename = Tempfile.open([outname_html, ".xml"], encoding: "utf-8") do |f|
21
+ f.write file
22
+ f.path
23
+ end
24
+ FileUtils.rm_rf dir
25
+ ::Metanorma::Output::XslfoPdf.new.convert(
26
+ filename, outname_html + ".pdf",
27
+ File.join(@libdir, "iec.international-standard.xsl"))
28
+ end
29
+ end
30
+ end
31
+ end
data/lib/metanorma-iec.rb CHANGED
@@ -3,6 +3,7 @@ require_relative "asciidoctor/iec/converter"
3
3
  require_relative "metanorma/iec/version"
4
4
  require "isodoc/iec/html_convert"
5
5
  require "isodoc/iec/word_convert"
6
+ require "isodoc/iec/pdf_convert"
6
7
  require "isodoc/iec/metadata"
7
8
 
8
9
  if defined? Metanorma
@@ -2,6 +2,10 @@ require "metanorma/processor"
2
2
 
3
3
  module Metanorma
4
4
  module Iec
5
+ def self.pdf_fonts
6
+ ["Arial", "Times New Roman", "HanSans", "Courier"]
7
+ end
8
+
5
9
  class Processor < Metanorma::Processor
6
10
 
7
11
  def initialize
@@ -13,7 +17,8 @@ module Metanorma
13
17
  def output_formats
14
18
  super.merge(
15
19
  html: "html",
16
- doc: "doc"
20
+ doc: "doc",
21
+ pdf: "pdf"
17
22
  )
18
23
  end
19
24
 
@@ -31,6 +36,8 @@ module Metanorma
31
36
  IsoDoc::Iec::HtmlConvert.new(options).convert(outname, isodoc_node)
32
37
  when :doc
33
38
  IsoDoc::Iec::WordConvert.new(options).convert(outname, isodoc_node)
39
+ when :pdf
40
+ IsoDoc::Iec::PdfConvert.new(options).convert(outname, isodoc_node)
34
41
  else
35
42
  super
36
43
  end
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "1.0.4"
3
+ VERSION = "1.0.5"
4
4
  end
5
5
  end
6
6
 
@@ -131,6 +131,7 @@ RSpec.describe Asciidoctor::Iec do
131
131
  <bibitem id="iso216" type="standard">
132
132
  <title format="text/plain">Reference</title>
133
133
  <docidentifier>ISO 216</docidentifier>
134
+ <docnumber>216</docnumber>
134
135
  <contributor>
135
136
  <role type="publisher"/>
136
137
  <organization>
@@ -193,6 +194,7 @@ RSpec.describe Asciidoctor::Iec do
193
194
  <bibitem id="iso216" type="standard">
194
195
  <title format="text/plain">Reference</title>
195
196
  <docidentifier>ISO 216</docidentifier>
197
+ <docnumber>216</docnumber>
196
198
  <contributor>
197
199
  <role type="publisher"/>
198
200
  <organization>
@@ -137,6 +137,7 @@ RSpec.describe Asciidoctor::Iec do
137
137
  <bibitem id="ISO713">
138
138
  <formattedref format="application/x-isodoc+xml">Reference</formattedref>
139
139
  <docidentifier>ISO713</docidentifier>
140
+ <docnumber>713</docnumber>
140
141
  </bibitem>
141
142
  </references>
142
143
  </bibliography>
data/spec/assets/iso.xml CHANGED
@@ -1,8 +1,71 @@
1
- <iso-standard xmlns="http://riboseinc.com/isoxml">
1
+ <iec-standard xmlns="https://www.metanorma.org/ns/iec">
2
+ <bibdata type="standard">
3
+ <title type="title-intro" language="en" format="text/plain">Cereals and pulses</title>
4
+ <title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
5
+ <title type="main" language="en" format="text/plain">Specifications and test methods</title>
6
+ <title type="title-part" language="en" format="text/plain">Rice</title>
7
+ <title type="title-intro" language="fr" format="text/plain">Céréales et légumineuses</title>
8
+ <title type="title-main" language="fr" format="text/plain">Spécification et méthodes d'essai</title>
9
+ <title type="title-part" language="fr" format="text/plain">Riz</title>
10
+ <docidentifier type="iso">ISO/PreCD3 17301-1</docidentifier>
11
+ <docidentifier type="iso-tc">17301</docidentifier>
12
+ <docnumber>1730</docnumber>
13
+ <date type="published"><on>2011</on></date>
14
+ <date type="accessed"><on>2012</on></date>
15
+ <date type="created"><from>2010</from><to>2011</to></date>
16
+ <date type="activated"><on>2013</on></date>
17
+ <date type="obsoleted"><on>2014</on></date>
18
+ <edition>2</edition>
19
+ <version>
20
+ <revision-date>2016-05-01</revision-date>
21
+ <draft>0.4</draft>
22
+ </version>
23
+ <contributor>
24
+ <role type="author"/>
25
+ <organization>
26
+ <name>International Organization for Standardization</name>
27
+ <abbreviation>ISO</abbreviation>
28
+ </organization>
29
+ </contributor>
30
+ <contributor>
31
+ <role type="publisher"/>
32
+ <organization>
33
+ <name>International Organization for Standardization</name>
34
+ <abbreviation>ISO</abbreviation>
35
+ </organization>
36
+ </contributor>
37
+ <language>en</language>
38
+ <script>Latn</script>
39
+ <status>
40
+ <stage abbreviation="CD">35</stage>
41
+ <substage abbreviation="3CD">20</substage>
42
+ <iteration>3</iteration>
43
+ </status>
44
+ <copyright>
45
+ <from>2016</from>
46
+ <owner>
47
+ <organization>
48
+ <abbreviation>ISO</abbreviation>
49
+ </organization>
50
+ </owner>
51
+ </copyright>
52
+ <ext>
53
+ <doctype>international-standard</doctype>
54
+ <editorialgroup>
55
+ <technical-committee number="34">Food products</technical-committee>
56
+ <subcommittee number="4">Cereals and pulses</subcommittee>
57
+ <workgroup number="3">Rice Group</workgroup>
58
+ <secretariat>GB</secretariat>
59
+ </editorialgroup>
60
+ <structuredidentifier>
61
+ <project-number part="1">ISO/PreCD3 17301</project-number>
62
+ </structuredidentifier>
63
+ </ext>
64
+ </bibdata>
2
65
  <foreword>
3
66
  <note>
4
67
  <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
5
68
  </note>
6
69
  </foreword>
7
- </iso-standard>
70
+ </iec-standard>
8
71
 
@@ -16,16 +16,14 @@ RSpec.describe IsoDoc do
16
16
  <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
17
17
  <title>Introduction Subsection</title>
18
18
  </clause>
19
- <patent-notice>
20
19
  <p>This is patent boilerplate</p>
21
- </patent-notice>
22
20
  </introduction></preface><sections>
23
21
  <clause id="D" obligation="normative">
24
22
  <title>Scope</title>
25
23
  <p id="E">Text</p>
26
24
  </clause>
27
25
 
28
- <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
26
+ <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
29
27
  <title>Normal Terms</title>
30
28
  <term id="J">
31
29
  <preferred>Term2</preferred>
@@ -162,16 +160,14 @@ RSpec.describe IsoDoc do
162
160
  <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
163
161
  <title>Introduction Subsection</title>
164
162
  </clause>
165
- <patent-notice>
166
163
  <p>This is patent boilerplate</p>
167
- </patent-notice>
168
164
  </introduction></preface><sections>
169
165
  <clause id="D" obligation="normative">
170
166
  <title>Scope</title>
171
167
  <p id="E">Text</p>
172
168
  </clause>
173
169
 
174
- <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
170
+ <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
175
171
  <title>Normal Terms</title>
176
172
  <term id="J">
177
173
  <preferred>Term2</preferred>
@@ -308,16 +304,14 @@ RSpec.describe IsoDoc do
308
304
  <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
309
305
  <title>Introduction Subsection</title>
310
306
  </clause>
311
- <patent-notice>
312
307
  <p>This is patent boilerplate</p>
313
- </patent-notice>
314
308
  </introduction></preface><sections>
315
309
  <clause id="D" obligation="normative">
316
310
  <title>Scope</title>
317
311
  <p id="E">Text</p>
318
312
  </clause>
319
313
 
320
- <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
314
+ <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
321
315
  <title>Normal Terms</title>
322
316
  <term id="J">
323
317
  <preferred>Term2</preferred>
@@ -456,16 +450,14 @@ RSpec.describe IsoDoc do
456
450
  <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
457
451
  <title>Introduction Subsection</title>
458
452
  </clause>
459
- <patent-notice>
460
453
  <p>This is patent boilerplate</p>
461
- </patent-notice>
462
454
  </introduction></preface><sections>
463
455
  <clause id="D" obligation="normative">
464
456
  <title>Scope</title>
465
457
  <p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref></p>
466
458
  </clause>
467
459
 
468
- <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
460
+ <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
469
461
  <title>Normal Terms</title>
470
462
  <term id="J">
471
463
  <preferred>Term2</preferred>
@@ -523,7 +515,7 @@ RSpec.describe IsoDoc do
523
515
  </bibliography>
524
516
  </iso-standard>
525
517
  INPUT
526
- #{HTML_HDR.gsub(/"en"/, '"zh"').sub(/INTERNATIONAL ELECTROTECHNICAL COMMISSION/, "国际电工委员会")}
518
+ #{HTML_HDR.gsub(/"en"/, '"zh"').sub(/INTERNATIONAL ELECTROTECHNICAL COMMISSION/, "&#22269;&#38469;&#30005;&#24037;&#22996;&#21592;&#20250;")}
527
519
  <div>
528
520
  <h1 class="ForewordTitle">&#21069;&#35328;</h1>
529
521
  <div class="boilerplate_legal"/>
@@ -537,7 +529,7 @@ RSpec.describe IsoDoc do
537
529
  </div>
538
530
  <p>This is patent boilerplate</p>
539
531
  </div>
540
- #{IEC_TITLE.sub(/INTERNATIONAL ELECTROTECHNICAL COMMISSION/, "国际电工委员会")}
532
+ #{IEC_TITLE.sub(/INTERNATIONAL ELECTROTECHNICAL COMMISSION/, "&#22269;&#38469;&#30005;&#24037;&#22996;&#21592;&#20250;")}
541
533
  <div id="D">
542
534
  <h1>1&#160; &#33539;&#22260;</h1>
543
535
  <p id="E">
@@ -141,7 +141,7 @@ OUTPUT
141
141
  <docnumber>60050</docnumber>
142
142
  </bibdata>
143
143
  <sections>
144
- <clause id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
144
+ <clause id="_terms_and_definitions" obligation="normative"><title>Terms and definitions</title>
145
145
  <terms id="_general" obligation="normative"><title>General</title>
146
146
 
147
147
  <term id="paddy1"><preferred>paddy</preferred>
@@ -286,7 +286,7 @@ end
286
286
  <docnumber>60050</docnumber>
287
287
  </bibdata>
288
288
  <sections>
289
- <clause id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
289
+ <clause id="_terms_and_definitions" obligation="normative"><title>Terms and definitions</title>
290
290
  <terms id="_general" obligation="normative"><title>General</title>
291
291
 
292
292
  <term id="paddy1"><preferred>paddy</preferred>
@@ -73,7 +73,7 @@ RSpec.describe IsoDoc::Iec::Metadata do
73
73
  </bibdata>
74
74
  </iso-standard>
75
75
  INPUT
76
- {: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", :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"}
76
+ {:accesseddate=>"2012", :activateddate=>"2013", :agency=>"ISO", :authors=>[], :authors_affiliations=>{}, :createddate=>"2010&ndash;2011", :docnumber=>"ISO/PreCD3 17301-1", :docnumber_lang=>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"}
77
77
  OUTPUT
78
78
  end
79
79
 
@@ -152,7 +152,7 @@ OUTPUT
152
152
  </bibdata>
153
153
  </iso-standard>
154
154
  INPUT
155
- {: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", :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"}
155
+ {:agency=>"ISO/IEC", :authors=>[], :authors_affiliations=>{}, :docnumber=>"ISO/IEC/CD 17301-1-3", :docnumber_lang=>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"}
156
156
  OUTPUT
157
157
  end
158
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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
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.4
4
+ version: 1.0.5
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-04-17 00:00:00.000000000 Z
11
+ date: 2020-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-jing
@@ -241,7 +241,9 @@ files:
241
241
  - lib/isodoc/iec/i18n-en.yaml
242
242
  - lib/isodoc/iec/i18n-fr.yaml
243
243
  - lib/isodoc/iec/i18n-zh-Hans.yaml
244
+ - lib/isodoc/iec/iec.international-standard.xsl
244
245
  - lib/isodoc/iec/metadata.rb
246
+ - lib/isodoc/iec/pdf_convert.rb
245
247
  - lib/isodoc/iec/word_convert.rb
246
248
  - lib/metanorma-iec.rb
247
249
  - lib/metanorma/iec.rb