isodoc 0.8.4 → 0.8.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +4 -1
  3. data/Gemfile.lock +5 -3
  4. data/isodoc.gemspec +1 -0
  5. data/lib/isodoc.rb +1 -2
  6. data/lib/isodoc/convert.rb +3 -3
  7. data/lib/isodoc/function/i18n.rb +6 -3
  8. data/lib/isodoc/function/inline.rb +3 -4
  9. data/lib/isodoc/function/references.rb +2 -0
  10. data/lib/isodoc/function/section.rb +9 -11
  11. data/lib/isodoc/function/to_word_html.rb +1 -1
  12. data/lib/isodoc/function/xref_sect_gen.rb +22 -18
  13. data/lib/isodoc/headlesshtml_convert.rb +39 -0
  14. data/lib/isodoc/html_function/html.rb +1 -1
  15. data/lib/isodoc/metadata.rb +11 -78
  16. data/lib/isodoc/pdf_convert.rb +3 -2
  17. data/lib/isodoc/version.rb +1 -1
  18. data/lib/isodoc/word_function/postprocess.rb +1 -1
  19. data/spec/isodoc/blocks_spec.rb +2 -2
  20. data/spec/isodoc/i18n_spec.rb +8 -48
  21. data/spec/isodoc/inline_spec.rb +4 -0
  22. data/spec/isodoc/metadata_spec.rb +8 -31
  23. data/spec/isodoc/postproc_spec.rb +27 -13
  24. data/spec/isodoc/section_spec.rb +4 -24
  25. data/spec/isodoc/terms_spec.rb +8 -8
  26. data/spec/isodoc/xref_spec.rb +11 -19
  27. metadata +17 -16
  28. data/lib/isodoc/iso/html/header.html +0 -206
  29. data/lib/isodoc/iso/html/html_iso_intro.html +0 -34
  30. data/lib/isodoc/iso/html/html_iso_titlepage.html +0 -34
  31. data/lib/isodoc/iso/html/htmlstyle.scss +0 -46
  32. data/lib/isodoc/iso/html/isodoc.scss +0 -696
  33. data/lib/isodoc/iso/html/scripts.html +0 -174
  34. data/lib/isodoc/iso/html/style-human.scss +0 -1277
  35. data/lib/isodoc/iso/html/style-iso.scss +0 -1257
  36. data/lib/isodoc/iso/html/word_iso_intro.html +0 -72
  37. data/lib/isodoc/iso/html/word_iso_titlepage.html +0 -62
  38. data/lib/isodoc/iso/html/wordstyle.scss +0 -1175
  39. data/lib/isodoc/iso/html_convert.rb +0 -50
  40. data/lib/isodoc/iso/word_convert.rb +0 -53
  41. data/spec/isodoc/iso_spec.rb +0 -168
@@ -1,6 +1,7 @@
1
1
  require_relative "html_function/comments.rb"
2
2
  require_relative "html_function/footnotes.rb"
3
3
  require_relative "html_function/html.rb"
4
+ require "metanorma"
4
5
 
5
6
  module IsoDoc
6
7
  class PdfConvert < ::IsoDoc::Convert
@@ -12,7 +13,7 @@ module IsoDoc
12
13
  def initialize(options)
13
14
  super
14
15
  @tmpimagedir = "_pdfimages"
15
- @maxwidth = 500
16
+ @maxwidth = 500
16
17
  @maxheight = 800
17
18
  end
18
19
 
@@ -24,7 +25,7 @@ module IsoDoc
24
25
  return result if debug
25
26
  postprocess(result, filename, dir)
26
27
  system "rm -fr #{dir}"
27
- Metanorma::Output::Pdf.new.convert(filename + ".html", filename)
28
+ ::Metanorma::Output::Pdf.new.convert(filename + ".html", outname_html + ".pdf")
28
29
  system "rm -r #{filename + '.html'} #{@tmpimagedir}"
29
30
  end
30
31
  end
@@ -1,3 +1,3 @@
1
1
  module IsoDoc
2
- VERSION = "0.8.4".freeze
2
+ VERSION = "0.8.5".freeze
3
3
  end
@@ -68,7 +68,7 @@ module IsoDoc::WordFunction
68
68
  meta = @meta.get
69
69
  meta[:filename] = filename
70
70
  params = meta.map { |k, v| [k.to_s, v] }.to_h
71
- File.open("header.html", "w") do |f|
71
+ File.open("header.html", "w:UTF-8") do |f|
72
72
  f.write(template.render(params))
73
73
  end
74
74
  @files_to_delete << "header.html"
@@ -611,7 +611,7 @@ World</p>
611
611
  <iso-standard xmlns="http://riboseinc.com/isoxml">
612
612
  <preface><foreword>
613
613
  <quote id="_044bd364-c832-4b78-8fea-92242402a1d1">
614
- <source type="inline" bibitemid="ISO7301" citeas="ISO 7301: 2011"><locality type="clause"><referenceFrom>1</referenceFrom></locality></source>
614
+ <source type="inline" bibitemid="ISO7301" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>1</referenceFrom></locality></source>
615
615
  <author>ISO</author>
616
616
  <p id="_d4fd0a61-f300-4285-abe6-602707590e53">This International Standard gives the minimum specifications for rice (<em>Oryza sativa</em> L.) which is subject to international trade. It is applicable to the following types: husked rice and milled rice, parboiled or not, intended for direct human consumption. It is neither applicable to other products derived from rice, nor to waxy rice (glutinous rice).</p>
617
617
  </quote>
@@ -627,7 +627,7 @@ World</p>
627
627
 
628
628
 
629
629
  <p id="_d4fd0a61-f300-4285-abe6-602707590e53">This International Standard gives the minimum specifications for rice (<i>Oryza sativa</i> L.) which is subject to international trade. It is applicable to the following types: husked rice and milled rice, parboiled or not, intended for direct human consumption. It is neither applicable to other products derived from rice, nor to waxy rice (glutinous rice).</p>
630
- <p class="QuoteAttribution">&#8212; ISO, <a href="#ISO7301">ISO 7301: 2011, Clause 1</a></p></div>
630
+ <p class="QuoteAttribution">&#8212; ISO, <a href="#ISO7301">ISO 7301:2011, Clause 1</a></p></div>
631
631
  </div>
632
632
  <p class="zzSTDTitle1"/>
633
633
  </div>
@@ -15,9 +15,6 @@ RSpec.describe IsoDoc do
15
15
  <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
16
16
  <title>Introduction Subsection</title>
17
17
  </clause>
18
- <patent-notice>
19
- <p>This is patent boilerplate</p>
20
- </patent-notice>
21
18
  </introduction></preface><sections>
22
19
  <clause id="D" obligation="normative">
23
20
  <title>Scope</title>
@@ -58,9 +55,6 @@ RSpec.describe IsoDoc do
58
55
  <title>Annex A.1a</title>
59
56
  </clause>
60
57
  </clause>
61
- <appendix id="Q2" inline-header="false" obligation="normative">
62
- <title>An Appendix</title>
63
- </appendix>
64
58
  </annex><bibliography><references id="R" obligation="informative">
65
59
  <title>Normative References</title>
66
60
  </references><clause id="S" obligation="informative">
@@ -80,11 +74,10 @@ RSpec.describe IsoDoc do
80
74
  </div>
81
75
  <br/>
82
76
  <div class="Section3" id="B">
83
- <h1 class="IntroTitle">0.&#160; Introduction</h1>
77
+ <h1 class="IntroTitle">Introduction</h1>
84
78
  <div id="C">
85
- <h2>0.1. Introduction Subsection</h2>
79
+ <h2>Introduction Subsection</h2>
86
80
  </div>
87
- <p>This is patent boilerplate</p>
88
81
  </div>
89
82
  <p class="zzSTDTitle1"/>
90
83
  <div id="D">
@@ -141,9 +134,6 @@ RSpec.describe IsoDoc do
141
134
  <h3>A.1.1. Annex A.1a</h3>
142
135
  </div>
143
136
  </div>
144
- <div id="Q2">
145
- <h2>Appendix 1. An Appendix</h2>
146
- </div>
147
137
  </div>
148
138
  <br/>
149
139
  <div>
@@ -172,9 +162,6 @@ RSpec.describe IsoDoc do
172
162
  <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
173
163
  <title>Introduction Subsection</title>
174
164
  </clause>
175
- <patent-notice>
176
- <p>This is patent boilerplate</p>
177
- </patent-notice>
178
165
  </introduction></preface><sections>
179
166
  <clause id="D" obligation="normative">
180
167
  <title>Scope</title>
@@ -215,9 +202,6 @@ RSpec.describe IsoDoc do
215
202
  <title>Annex A.1a</title>
216
203
  </clause>
217
204
  </clause>
218
- <appendix id="Q2" inline-header="false" obligation="normative">
219
- <title>An Appendix</title>
220
- </appendix>
221
205
  </annex><bibliography><references id="R" obligation="informative">
222
206
  <title>Normative References</title>
223
207
  </references><clause id="S" obligation="informative">
@@ -237,11 +221,10 @@ RSpec.describe IsoDoc do
237
221
  </div>
238
222
  <br/>
239
223
  <div class="Section3" id="B">
240
- <h1 class="IntroTitle">0.&#160; Introduction</h1>
224
+ <h1 class="IntroTitle">Introduction</h1>
241
225
  <div id="C">
242
- <h2>0.1. Introduction Subsection</h2>
226
+ <h2>Introduction Subsection</h2>
243
227
  </div>
244
- <p>This is patent boilerplate</p>
245
228
  </div>
246
229
  <p class="zzSTDTitle1"/>
247
230
  <div id="D">
@@ -298,9 +281,6 @@ RSpec.describe IsoDoc do
298
281
  <h3>A.1.1. Annex A.1a</h3>
299
282
  </div>
300
283
  </div>
301
- <div id="Q2">
302
- <h2>Appendix 1. An Appendix</h2>
303
- </div>
304
284
  </div>
305
285
  <br/>
306
286
  <div>
@@ -329,9 +309,6 @@ RSpec.describe IsoDoc do
329
309
  <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
330
310
  <title>Introduction Subsection</title>
331
311
  </clause>
332
- <patent-notice>
333
- <p>This is patent boilerplate</p>
334
- </patent-notice>
335
312
  </introduction></preface><sections>
336
313
  <clause id="D" obligation="normative">
337
314
  <title>Scope</title>
@@ -372,9 +349,6 @@ RSpec.describe IsoDoc do
372
349
  <title>Annex A.1a</title>
373
350
  </clause>
374
351
  </clause>
375
- <appendix id="Q2" inline-header="false" obligation="normative">
376
- <title>An Appendix</title>
377
- </appendix>
378
352
  </annex><bibliography><references id="R" obligation="informative">
379
353
  <title>Normative References</title>
380
354
  </references><clause id="S" obligation="informative">
@@ -394,11 +368,10 @@ RSpec.describe IsoDoc do
394
368
  </div>
395
369
  <br/>
396
370
  <div class="Section3" id="B">
397
- <h1 class="IntroTitle">0.&#160; Introduction</h1>
371
+ <h1 class="IntroTitle">Introduction</h1>
398
372
  <div id="C">
399
- <h2>0.1. Introduction Subsection</h2>
373
+ <h2>Introduction Subsection</h2>
400
374
  </div>
401
- <p>This is patent boilerplate</p>
402
375
  </div>
403
376
  <p class="zzSTDTitle1"/>
404
377
  <div id="D">
@@ -454,9 +427,6 @@ RSpec.describe IsoDoc do
454
427
  <h3>A.1.1. Annex A.1a</h3>
455
428
  </div>
456
429
  </div>
457
- <div id="Q2">
458
- <h2>Appendice 1. An Appendix</h2>
459
- </div>
460
430
  </div>
461
431
  <br/>
462
432
  <div>
@@ -486,9 +456,6 @@ RSpec.describe IsoDoc do
486
456
  <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
487
457
  <title>Introduction Subsection</title>
488
458
  </clause>
489
- <patent-notice>
490
- <p>This is patent boilerplate</p>
491
- </patent-notice>
492
459
  </introduction></preface><sections>
493
460
  <clause id="D" obligation="normative">
494
461
  <title>Scope</title>
@@ -529,9 +496,6 @@ RSpec.describe IsoDoc do
529
496
  <title>Annex A.1a</title>
530
497
  </clause>
531
498
  </clause>
532
- <appendix id="Q2" inline-header="false" obligation="normative">
533
- <title>An Appendix</title>
534
- </appendix>
535
499
  </annex><bibliography><references id="R" obligation="informative">
536
500
  <title>Normative References</title>
537
501
  <bibitem id="ISO712" type="standard">
@@ -561,11 +525,10 @@ RSpec.describe IsoDoc do
561
525
  </div>
562
526
  <br/>
563
527
  <div class="Section3" id="B">
564
- <h1 class="IntroTitle">0.&#160; &#24341;&#35328;</h1>
528
+ <h1 class="IntroTitle">&#24341;&#35328;</h1>
565
529
  <div id="C">
566
- <h2>0.1. Introduction Subsection</h2>
530
+ <h2>Introduction Subsection</h2>
567
531
  </div>
568
- <p>This is patent boilerplate</p>
569
532
  </div>
570
533
  <p class="zzSTDTitle1"/>
571
534
  <div id="D">
@@ -622,9 +585,6 @@ RSpec.describe IsoDoc do
622
585
  <h3>A.1.1. Annex A.1a</h3>
623
586
  </div>
624
587
  </div>
625
- <div id="Q2">
626
- <h2>&#38468;&#24405;1. An Appendix</h2>
627
- </div>
628
588
  </div>
629
589
  <br/>
630
590
  <div>
@@ -38,6 +38,8 @@ RSpec.describe IsoDoc do
38
38
  <p>
39
39
  <link target="http://example.com"/>
40
40
  <link target="http://example.com">example</link>
41
+ <link target="mailto:fred@example.com"/>
42
+ <link target="mailto:fred@example.com">mailto:fred@example.com</link>
41
43
  </p>
42
44
  </foreword></preface>
43
45
  <sections>
@@ -50,6 +52,8 @@ RSpec.describe IsoDoc do
50
52
  <p>
51
53
  <a href="http://example.com">http://example.com</a>
52
54
  <a href="http://example.com">example</a>
55
+ <a href="mailto:fred@example.com">fred@example.com</a>
56
+ <a href="mailto:fred@example.com">mailto:fred@example.com</a>
53
57
  </p>
54
58
  </div>
55
59
  <p class="zzSTDTitle1"/>
@@ -10,16 +10,8 @@ RSpec.describe IsoDoc do
10
10
  expect(Hash[c.info(Nokogiri::XML(<<~"INPUT"), nil).sort]).to be_equivalent_to <<~"OUTPUT"
11
11
  <iso-standard xmlns="http://riboseinc.com/isoxml">
12
12
  <bibdata type="international-standard">
13
- <title>
14
- <title-intro language="en" format="text/plain">Cereals and pulses</title-intro>
15
- <title-main language="en" format="text/plain">Specifications and test methods</title-main>
16
- <title-part language="en" format="text/plain">Rice</title-part>
17
- </title>
18
- <title>
19
- <title-intro language="fr" format="text/plain">Céréales et légumineuses</title-intro>
20
- <title-main language="fr" format="text/plain">Spécification et méthodes d'essai</title-main>
21
- <title-part language="fr" format="text/plain">Riz</title-part>
22
- </title>
13
+ <title>The Incredible Mr Ripley</title>
14
+ <title language="en">Cereals and pulses</title>
23
15
  <docidentifier>
24
16
  <project-number part="1">17301</project-number>
25
17
  <tc-document-number>17301</tc-document-number>
@@ -43,11 +35,7 @@ RSpec.describe IsoDoc do
43
35
  </contributor>
44
36
  <language>en</language>
45
37
  <script>Latn</script>
46
- <status>
47
- <stage>30</stage>
48
- <substage>92</substage>
49
- <iteration>3</iteration>
50
- </status>
38
+ <status>Committee Draft</status>
51
39
  <copyright>
52
40
  <from>2016</from>
53
41
  <owner>
@@ -69,7 +57,7 @@ RSpec.describe IsoDoc do
69
57
  </version>
70
58
  </iso-standard>
71
59
  INPUT
72
- {:accesseddate=>"2012", :activateddate=>"2013", :agency=>"ISO", :confirmeddate=>"XXX", :createddate=>"2010&ndash;2011", :docnumber=>"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", :revdate=>"2016-05-01", :sc=>"SC 4", :secretariat=>"GB", :stage=>"30", :stage_int=>30, :stageabbr=>"PreCD3", :tc=>"TC 34", :updateddate=>"XXX", :wg=>"WG 3"}
60
+ {:accesseddate=>"2012", :activateddate=>"2013", :agency=>"ISO", :confirmeddate=>"XXX", :createddate=>"2010&ndash;2011", :docnumber=>"17301-1 Committee draft", :doctitle=>"Cereals and pulses", :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", :revdate=>"2016-05-01", :sc=>"SC 4", :secretariat=>"GB", :status=>"Committee draft", :tc=>"TC 34", :updateddate=>"XXX", :wg=>"WG 3"}
73
61
  OUTPUT
74
62
  end
75
63
 
@@ -81,16 +69,8 @@ OUTPUT
81
69
  expect(Hash[c.info(Nokogiri::XML(<<~"INPUT"), nil).sort]).to be_equivalent_to <<~"OUTPUT"
82
70
  <iso-standard xmlns="http://riboseinc.com/isoxml">
83
71
  <bibdata type="international-standard">
84
- <title>
85
- <title-intro language="en" format="text/plain">Cereals and pulses</title-intro>
86
- <title-main language="en" format="text/plain">Specifications and test methods</title-main>
87
- <title-part language="en" format="text/plain">Rice</title-part>
88
- </title>
89
- <title>
90
- <title-intro language="fr" format="text/plain">Céréales et légumineuses</title-intro>
91
- <title-main language="fr" format="text/plain">Spécification et méthodes d'essai</title-main>
92
- <title-part language="fr" format="text/plain">Riz</title-part>
93
- </title>
72
+ <title language="fr" format="text/plain">Céréales et légumineuses</ti>
73
+ <title language="en" format="text/plain">Cereals and pulses</title>
94
74
  <docidentifier>
95
75
  <project-number part="1" subpart="3">17301</project-number>
96
76
  <tc-document-number>17301</tc-document-number>
@@ -115,10 +95,7 @@ OUTPUT
115
95
  </contributor>
116
96
  <language>en</language>
117
97
  <script>Latn</script>
118
- <status>
119
- <stage>30</stage>
120
- <substage>92</substage>
121
- </status>
98
+ <status>Published</status>
122
99
  <copyright>
123
100
  <from>2016</from>
124
101
  <owner>
@@ -145,7 +122,7 @@ OUTPUT
145
122
  </version>
146
123
  </iso-standard>
147
124
  INPUT
148
- {:accesseddate=>"XXX", :agency=>"ISO/IEC", :confirmeddate=>"XXX", :createddate=>"XXX", :docnumber=>"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", :revdate=>"2016-05-01", :sc=>"DEF 4", :secretariat=>"XXXX", :stage=>"30", :stage_int=>30, :stageabbr=>"CD", :tc=>"ABC 34", :updateddate=>"XXX", :wg=>"GHI 3"}
125
+ {:accesseddate=>"XXX", :agency=>"ISO/IEC", :confirmeddate=>"XXX", :createddate=>"XXX", :docnumber=>"17301-1-3", :doctitle=>"Cereals and pulses", :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", :revdate=>"2016-05-01", :sc=>"DEF 4", :secretariat=>"XXXX", :status=>"Published", :tc=>"ABC 34", :updateddate=>"XXX", :wg=>"GHI 3"}
149
126
  OUTPUT
150
127
  end
151
128
 
@@ -69,6 +69,20 @@ RSpec.describe IsoDoc do
69
69
  expect(html).to match(%r{libs/jquery})
70
70
  end
71
71
 
72
+ it "generates Headless HTML output docs with null configuration from file" do
73
+ system "rm -f spec/assets/iso.html"
74
+ IsoDoc::HeadlessHtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("spec/assets/iso.xml", nil, false)
75
+ expect(File.exist?("spec/assets/iso.headless.html")).to be true
76
+ html = File.read("spec/assets/iso.headless.html")
77
+ expect(html).not_to match(/another empty stylesheet/)
78
+ expect(html).not_to match(%r{https://use.fontawesome.com})
79
+ expect(html).not_to match(%r{libs/jquery})
80
+ expect(html).not_to match(%r{<html})
81
+ expect(html).not_to match(%r{<head})
82
+ expect(html).not_to match(%r{<body})
83
+ expect(html).to match(%r{<div})
84
+ end
85
+
72
86
  it "generates Word output docs with null configuration from file" do
73
87
  system "rm -f spec/assets/iso.doc"
74
88
  IsoDoc::WordConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("spec/assets/iso.xml", nil, false)
@@ -77,6 +91,13 @@ RSpec.describe IsoDoc do
77
91
  expect(word).to match(/one empty stylesheet/)
78
92
  end
79
93
 
94
+ it "generates PDF output docs with null configuration from file" do
95
+ system "rm -f spec/assets/iso.pdf"
96
+ #require "byebug"; byebug
97
+ IsoDoc::PdfConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("spec/assets/iso.xml", nil, false)
98
+ expect(File.exist?("spec/assets/iso.pdf")).to be true
99
+ end
100
+
80
101
  it "generates HTML output docs with complete configuration" do
81
102
  system "rm -f test.doc"
82
103
  system "rm -f test.html"
@@ -171,9 +192,6 @@ RSpec.describe IsoDoc do
171
192
  <clause id="Q" inline-header="false" obligation="normative">
172
193
  <title>Annex A.1</title>
173
194
  </clause>
174
- <appendix id="Q2" inline-header="false" obligation="normative">
175
- <title>An Appendix</title>
176
- </appendix>
177
195
  </annex>
178
196
  </iso-standard>
179
197
  INPUT
@@ -188,9 +206,6 @@ RSpec.describe IsoDoc do
188
206
  <div><a name="Q" id="Q"></a>
189
207
  <p class="h2Annex">A.1. Annex A.1</p>
190
208
  </div>
191
- <div><a name="Q2" id="Q2"></a>
192
- <p class="h2Annex">Appendix 1. An Appendix</p>
193
- </div>
194
209
  </div>
195
210
  </div>
196
211
  OUTPUT
@@ -207,7 +222,7 @@ RSpec.describe IsoDoc do
207
222
  <term id="paddy1"><preferred>paddy</preferred>
208
223
  <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
209
224
  <termsource status="modified">
210
- <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301: 2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
225
+ <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
211
226
  <modification>
212
227
  <p id="_e73a417d-ad39-417d-a4c8-20e4e2529489">The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</p>
213
228
  </modification>
@@ -236,7 +251,7 @@ RSpec.describe IsoDoc do
236
251
  </p> </li> </ul>
237
252
  <p class="TermNum"><a name="paddy1" id="paddy1"></a>1.1</p><p class="Terms" style="text-align:left;">paddy</p>
238
253
  <p class="MsoNormal"><a name="_eb29b35e-123e-4d1c-b50b-2714d41e747f" id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"></a>rice retaining its husk after threshing</p>
239
- <p class="MsoNormal">[SOURCE: <a href="#ISO7301">ISO 7301: 2011, 3.1</a>, modified &mdash; The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p></div>
254
+ <p class="MsoNormal">[SOURCE: <a href="#ISO7301">ISO 7301:2011, 3.1</a>, modified &mdash; The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p></div>
240
255
  </div>
241
256
  OUTPUT
242
257
  end
@@ -424,9 +439,8 @@ CkZJTEVOQU1FOiB0ZXN0Cgo=
424
439
  <div>
425
440
  <h1 class="ForewordTitle">Foreword</h1>
426
441
  <div id="_" class="figure">
427
-
428
- <img src="_images/_.png" height="673" width="800" />
429
- <img src="_images/_.png" height="1200" width="80" />
442
+ <img src="_images/_.png" height="776" width="922" />
443
+ <img src="_images/_.png" height="800" width="53" />
430
444
  <img src="_images/_.png" height="83" width="99" />
431
445
  <p class="FigureTitle" align="center">Figure 1&#xA0;&#x2014; Split-it-right sample divider</p></div>
432
446
  </div>
@@ -460,7 +474,7 @@ CkZJTEVOQU1FOiB0ZXN0Cgo=
460
474
  </termexample>
461
475
 
462
476
  <termsource status="modified">
463
- <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301: 2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
477
+ <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
464
478
  <modification>
465
479
  <p id="_e73a417d-ad39-417d-a4c8-20e4e2529489">The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</p>
466
480
  </modification>
@@ -483,7 +497,7 @@ CkZJTEVOQU1FOiB0ZXN0Cgo=
483
497
  <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>
484
498
  </termnote>
485
499
  <termsource status="identical">
486
- <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301: 2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
500
+ <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
487
501
  </termsource></term>
488
502
  </terms>
489
503
  </sections>
@@ -12,9 +12,6 @@ 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
- <p>This is patent boilerplate</p>
17
- </patent-notice>
18
15
  </introduction></preface><sections>
19
16
  <clause id="D" obligation="normative">
20
17
  <title>Scope</title>
@@ -55,9 +52,6 @@ RSpec.describe IsoDoc do
55
52
  <title>Annex A.1a</title>
56
53
  </clause>
57
54
  </clause>
58
- <appendix id="Q2" inline-header="false" obligation="normative">
59
- <title>An Appendix</title>
60
- </appendix>
61
55
  </annex><bibliography><references id="R" obligation="informative">
62
56
  <title>Normative References</title>
63
57
  </references><clause id="S" obligation="informative">
@@ -77,11 +71,10 @@ RSpec.describe IsoDoc do
77
71
  </div>
78
72
  <br/>
79
73
  <div class="Section3" id="B">
80
- <h1 class="IntroTitle">0.&#160; Introduction</h1>
74
+ <h1 class="IntroTitle">Introduction</h1>
81
75
  <div id="C">
82
- <h2>0.1. Introduction Subsection</h2>
76
+ <h2>Introduction Subsection</h2>
83
77
  </div>
84
- <p>This is patent boilerplate</p>
85
78
  </div>
86
79
  <p class="zzSTDTitle1"/>
87
80
  <div id="D">
@@ -138,9 +131,6 @@ RSpec.describe IsoDoc do
138
131
  <h3>A.1.1. Annex A.1a</h3>
139
132
  </div>
140
133
  </div>
141
- <div id="Q2">
142
- <h2>Appendix 1. An Appendix</h2>
143
- </div>
144
134
 
145
135
  </div>
146
136
  <br/>
@@ -167,9 +157,6 @@ OUTPUT
167
157
  <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
168
158
  <title>Introduction Subsection</title>
169
159
  </clause>
170
- <patent-notice>
171
- <p>This is patent boilerplate</p>
172
- </patent-notice>
173
160
  </introduction></preface><sections>
174
161
  <clause id="D" obligation="normative">
175
162
  <title>Scope</title>
@@ -210,9 +197,6 @@ OUTPUT
210
197
  <title>Annex A.1a</title>
211
198
  </clause>
212
199
  </clause>
213
- <appendix id="Q2" inline-header="false" obligation="normative">
214
- <title>An Appendix</title>
215
- </appendix>
216
200
  </annex><bibliography><references id="R" obligation="informative">
217
201
  <title>Normative References</title>
218
202
  </references><clause id="S" obligation="informative">
@@ -241,11 +225,10 @@ OUTPUT
241
225
  </div>
242
226
  <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
243
227
  <div class="Section3" id="B">
244
- <h1 class="IntroTitle">0.<span style="mso-tab-count:1">&#160; </span>Introduction</h1>
228
+ <h1 class="IntroTitle">Introduction</h1>
245
229
  <div id="C">
246
- <h2>0.1. Introduction Subsection</h2>
230
+ <h2>Introduction Subsection</h2>
247
231
  </div>
248
- <p>This is patent boilerplate</p>
249
232
  </div>
250
233
  <p>&#160;</p>
251
234
  </div>
@@ -307,9 +290,6 @@ OUTPUT
307
290
  <div id="Q1">
308
291
  <h3>A.1.1. Annex A.1a</h3>
309
292
  </div>
310
- </div>
311
- <div id="Q2">
312
- <h2>Appendix 1. An Appendix</h2>
313
293
  </div>
314
294
  </div>
315
295
  <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>