metanorma-iso 1.3.22 → 1.3.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/macos.yml +0 -7
- data/.github/workflows/ubuntu.yml +0 -7
- data/.github/workflows/windows.yml +0 -8
- data/Gemfile +2 -0
- data/lib/asciidoctor/iso/base.rb +6 -0
- data/lib/asciidoctor/iso/biblio.rng +53 -26
- data/lib/asciidoctor/iso/isodoc.rng +28 -1
- data/lib/isodoc/iso/base_convert.rb +20 -17
- data/lib/isodoc/iso/html/header.html +5 -5
- data/lib/isodoc/iso/html/html_iso_titlepage.html +2 -2
- data/lib/isodoc/iso/html/isodoc.scss +28 -28
- data/lib/isodoc/iso/html/scripts.html +5 -21
- data/lib/isodoc/iso/html/word_iso_titlepage.html +2 -2
- data/lib/isodoc/iso/html/wordstyle.scss +35 -35
- data/lib/isodoc/iso/html_convert.rb +0 -9
- data/lib/isodoc/iso/iso.international-standard.xsl +3979 -0
- data/lib/isodoc/iso/metadata.rb +2 -0
- data/lib/isodoc/iso/pdf_convert.rb +32 -0
- data/lib/metanorma-iso.rb +1 -0
- data/lib/metanorma/iso/processor.rb +8 -1
- data/lib/metanorma/iso/version.rb +1 -1
- data/spec/asciidoctor-iso/base_spec.rb +7 -0
- data/spec/asciidoctor-iso/cleanup_spec.rb +183 -162
- data/spec/asciidoctor-iso/inline_spec.rb +1 -0
- data/spec/asciidoctor-iso/refs_spec.rb +3 -0
- data/spec/assets/iso.xml +64 -1
- data/spec/isodoc/i18n_spec.rb +4 -12
- data/spec/isodoc/metadata_spec.rb +4 -2
- data/spec/isodoc/postproc_spec.rb +12 -6
- data/spec/isodoc/section_spec.rb +3 -7
- data/spec/isodoc/table_spec.rb +1 -1
- data/spec/isodoc/terms_spec.rb +2 -2
- data/spec/isodoc/xref_spec.rb +9 -9
- data/spec/metanorma/processor_spec.rb +2 -2
- metadata +4 -2
@@ -137,6 +137,7 @@ RSpec.describe Asciidoctor::ISO 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>
|
@@ -21,6 +21,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
21
21
|
<bibitem id="iso123" type="standard">
|
22
22
|
<title format="text/plain">Standard</title>
|
23
23
|
<docidentifier>ISO 123:—</docidentifier>
|
24
|
+
<docnumber>123</docnumber>
|
24
25
|
<date type="published">
|
25
26
|
<on>–</on>
|
26
27
|
</date>
|
@@ -69,6 +70,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
69
70
|
<bibitem id="iso123" type="standard">
|
70
71
|
<title format="text/plain">Standard</title>
|
71
72
|
<docidentifier>ISO 123:1066 (all parts)</docidentifier>
|
73
|
+
<docnumber>123</docnumber>
|
72
74
|
<date type="published">
|
73
75
|
<on>1066</on>
|
74
76
|
</date>
|
@@ -106,6 +108,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
106
108
|
<em>Standard</em>
|
107
109
|
</formattedref>
|
108
110
|
<docidentifier>XYZ 123:1066 (all parts)</docidentifier>
|
111
|
+
<docnumber>123:1066 (all parts)</docnumber>
|
109
112
|
</bibitem>
|
110
113
|
</references>
|
111
114
|
</bibliography>
|
data/spec/assets/iso.xml
CHANGED
@@ -1,4 +1,67 @@
|
|
1
|
-
|
1
|
+
<iso-standard xmlns="https://www.metanorma.org/ns/iso">
|
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>
|
data/spec/isodoc/i18n_spec.rb
CHANGED
@@ -15,16 +15,14 @@ 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
18
|
<p>This is patent boilerplate</p>
|
20
|
-
</patent-notice>
|
21
19
|
</introduction></preface><sections>
|
22
20
|
<clause id="D" obligation="normative">
|
23
21
|
<title>Scope</title>
|
24
22
|
<p id="E">Text</p>
|
25
23
|
</clause>
|
26
24
|
|
27
|
-
<clause id="H" obligation="normative"><title>Terms,
|
25
|
+
<clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
28
26
|
<title>Normal Terms</title>
|
29
27
|
<term id="J">
|
30
28
|
<preferred>Term2</preferred>
|
@@ -161,16 +159,14 @@ RSpec.describe IsoDoc do
|
|
161
159
|
<introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
|
162
160
|
<title>Introduction Subsection</title>
|
163
161
|
</clause>
|
164
|
-
<patent-notice>
|
165
162
|
<p>This is patent boilerplate</p>
|
166
|
-
</patent-notice>
|
167
163
|
</introduction></preface><sections>
|
168
164
|
<clause id="D" obligation="normative">
|
169
165
|
<title>Scope</title>
|
170
166
|
<p id="E">Text</p>
|
171
167
|
</clause>
|
172
168
|
|
173
|
-
<clause id="H" obligation="normative"><title>Terms,
|
169
|
+
<clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
174
170
|
<title>Normal Terms</title>
|
175
171
|
<term id="J">
|
176
172
|
<preferred>Term2</preferred>
|
@@ -307,16 +303,14 @@ RSpec.describe IsoDoc do
|
|
307
303
|
<introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
|
308
304
|
<title>Introduction Subsection</title>
|
309
305
|
</clause>
|
310
|
-
<patent-notice>
|
311
306
|
<p>This is patent boilerplate</p>
|
312
|
-
</patent-notice>
|
313
307
|
</introduction></preface><sections>
|
314
308
|
<clause id="D" obligation="normative">
|
315
309
|
<title>Scope</title>
|
316
310
|
<p id="E">Text</p>
|
317
311
|
</clause>
|
318
312
|
|
319
|
-
<clause id="H" obligation="normative"><title>Terms,
|
313
|
+
<clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
320
314
|
<title>Normal Terms</title>
|
321
315
|
<term id="J">
|
322
316
|
<preferred>Term2</preferred>
|
@@ -454,16 +448,14 @@ RSpec.describe IsoDoc do
|
|
454
448
|
<introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
|
455
449
|
<title>Introduction Subsection</title>
|
456
450
|
</clause>
|
457
|
-
<patent-notice>
|
458
451
|
<p>This is patent boilerplate</p>
|
459
|
-
</patent-notice>
|
460
452
|
</introduction></preface><sections>
|
461
453
|
<clause id="D" obligation="normative">
|
462
454
|
<title>Scope</title>
|
463
455
|
<p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref></p>
|
464
456
|
</clause>
|
465
457
|
|
466
|
-
<clause id="H" obligation="normative"><title>Terms,
|
458
|
+
<clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
467
459
|
<title>Normal Terms</title>
|
468
460
|
<term id="J">
|
469
461
|
<preferred>Term2</preferred>
|
@@ -17,6 +17,7 @@ RSpec.describe IsoDoc::Iso::Metadata do
|
|
17
17
|
<title type="title-main" language="fr" format="text/plain">Spécification et méthodes d'essai</title>
|
18
18
|
<title type="title-part" language="fr" format="text/plain">Riz</title>
|
19
19
|
<docidentifier type="iso">ISO/PreCD3 17301-1</docidentifier>
|
20
|
+
<docidentifier type="iso-with-lang">ISO/PreCD3 17301-1 (E)</docidentifier>
|
20
21
|
<docidentifier type="iso-tc">17301</docidentifier>
|
21
22
|
<docidentifier type="iso-tc">17302</docidentifier>
|
22
23
|
<docnumber>1730</docnumber>
|
@@ -74,7 +75,7 @@ RSpec.describe IsoDoc::Iso::Metadata do
|
|
74
75
|
</bibdata>
|
75
76
|
</iso-standard>
|
76
77
|
INPUT
|
77
|
-
{:accesseddate=>"2012", :activateddate=>"2013", :agency=>"ISO", :authors=>[], :authors_affiliations=>{}, :createddate=>"2010–2011", :docnumber=>"ISO/PreCD3 17301-1", :docnumeric=>"1730", :docsubtitle=>"Céréales et légumineuses — Spécification et méthodes d'essai — Partie 1: Riz", :docsubtitleintro=>"Céréales et légumineuses", :docsubtitlemain=>"Spécification et méthodes d'essai", :docsubtitlepart=>"Riz", :docsubtitlepartlabel=>"Partie 1", :doctitle=>"Cereals and pulses — Specifications and test methods — Part 1: Rice", :doctitleintro=>"Cereals and pulses", :doctitlemain=>"Specifications and test methods", :doctitlepart=>"Rice", :doctitlepartlabel=>"Part 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=>"30", :stage_int=>30, :stageabbr=>"CD", :statusabbr=>"PreCD3", :tc=>"TC 34", :tc_docnumber=>["17301", "17302"], :unpublished=>true, :wg=>"WG 3"}
|
78
|
+
{:accesseddate=>"2012", :activateddate=>"2013", :agency=>"ISO", :authors=>[], :authors_affiliations=>{}, :createddate=>"2010–2011", :docnumber=>"ISO/PreCD3 17301-1", :docnumber_lang=>"ISO/PreCD3 17301-1 (E)", :docnumeric=>"1730", :docsubtitle=>"Céréales et légumineuses — Spécification et méthodes d'essai — Partie 1: Riz", :docsubtitleintro=>"Céréales et légumineuses", :docsubtitlemain=>"Spécification et méthodes d'essai", :docsubtitlepart=>"Riz", :docsubtitlepartlabel=>"Partie 1", :doctitle=>"Cereals and pulses — Specifications and test methods — Part 1: Rice", :doctitleintro=>"Cereals and pulses", :doctitlemain=>"Specifications and test methods", :doctitlepart=>"Rice", :doctitlepartlabel=>"Part 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=>"30", :stage_int=>30, :stageabbr=>"CD", :statusabbr=>"PreCD3", :tc=>"TC 34", :tc_docnumber=>["17301", "17302"], :unpublished=>true, :wg=>"WG 3"}
|
78
79
|
OUTPUT
|
79
80
|
end
|
80
81
|
|
@@ -97,6 +98,7 @@ OUTPUT
|
|
97
98
|
<title type="title-part" language="fr" format="text/plain">Riz</title>
|
98
99
|
</title>
|
99
100
|
<docidentifier type="iso">ISO/IEC/CD 17301-1-3</docidentifier>
|
101
|
+
<docidentifier type="iso-with-lang">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
|
100
102
|
<docidentifier type="iso-tc">17301</docidentifier>
|
101
103
|
<contributor>
|
102
104
|
<role type="author"/>
|
@@ -153,7 +155,7 @@ OUTPUT
|
|
153
155
|
</bibdata>
|
154
156
|
</iso-standard>
|
155
157
|
INPUT
|
156
|
-
{:agency=>"ISO/IEC", :authors=>[], :authors_affiliations=>{}, :docnumber=>"ISO/IEC/CD 17301-1-3", :docnumeric=>nil, :docsubtitle=>"Céréales et légumineuses — Spécification et méthodes d'essai — Partie 1–3: Riz", :docsubtitleintro=>"Céréales et légumineuses", :docsubtitlemain=>"Spécification et méthodes d'essai", :docsubtitlepart=>"Riz", :docsubtitlepartlabel=>"Partie 1–3", :doctitle=>"Cereals and pulses — Specifications and test methods — Part 1–3: Rice", :doctitleintro=>"Cereals and pulses", :doctitlemain=>"Specifications and test methods", :doctitlepart=>"Rice", :doctitlepartlabel=>"Part 1–3", :doctype=>"International Standard", :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=>"60", :stage_int=>60, :statusabbr=>"IS", :tc=>"ABC 34", :tc_docnumber=>["17301"], :unpublished=>false, :wg=>"GHI 3"}
|
158
|
+
{:agency=>"ISO/IEC", :authors=>[], :authors_affiliations=>{}, :docnumber=>"ISO/IEC/CD 17301-1-3", :docnumber_lang=>"ISO/IEC/CD 17301-1-3 (E)", :docnumeric=>nil, :docsubtitle=>"Céréales et légumineuses — Spécification et méthodes d'essai — Partie 1–3: Riz", :docsubtitleintro=>"Céréales et légumineuses", :docsubtitlemain=>"Spécification et méthodes d'essai", :docsubtitlepart=>"Riz", :docsubtitlepartlabel=>"Partie 1–3", :doctitle=>"Cereals and pulses — Specifications and test methods — Part 1–3: Rice", :doctitleintro=>"Cereals and pulses", :doctitlemain=>"Specifications and test methods", :doctitlepart=>"Rice", :doctitlepartlabel=>"Part 1–3", :doctype=>"International Standard", :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=>"60", :stage_int=>60, :statusabbr=>"IS", :tc=>"ABC 34", :tc_docnumber=>["17301"], :unpublished=>false, :wg=>"GHI 3"}
|
157
159
|
OUTPUT
|
158
160
|
end
|
159
161
|
|
@@ -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::Iso::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 "converts annex subheadings to h2Annex class for Word" do
|
95
101
|
FileUtils.rm_f "test.doc"
|
96
102
|
FileUtils.rm_f "test.html"
|
@@ -153,7 +159,7 @@ RSpec.describe IsoDoc do
|
|
153
159
|
expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
154
160
|
<div class="WordSection3">
|
155
161
|
<p class="zzSTDTitle1"></p>
|
156
|
-
<div><a name="_terms_and_definitions" id="_terms_and_definitions"></a><h1>1<span style="mso-tab-count:1">  </span>Terms and
|
162
|
+
<div><a name="_terms_and_definitions" id="_terms_and_definitions"></a><h1>1<span style="mso-tab-count:1">  </span>Terms and Definitions</h1>
|
157
163
|
<p class="TermNum"><a name="paddy1" id="paddy1"></a>1.1</p><p class="Terms" style="text-align:left;">paddy</p>
|
158
164
|
<p class="MsoNormal"><a name="_eb29b35e-123e-4d1c-b50b-2714d41e747f" id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"></a>rice retaining its husk after threshing</p>
|
159
165
|
<p class="MsoNormal">[SOURCE: <a href="#ISO7301">ISO 7301:2011, 3.1</a>, modified — The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p></div>
|
@@ -285,16 +291,16 @@ RSpec.describe IsoDoc do
|
|
285
291
|
<main xmlns:epub="epub" class="main-section"><button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
|
286
292
|
<p class="zzSTDTitle1"></p>
|
287
293
|
<div id="A">
|
288
|
-
<h1>1  Clause 4</h1>
|
294
|
+
<h1 id="toc0">1  Clause 4</h1>
|
289
295
|
<a rel="footnote" href="#fn:3" epub:type="footnote" id="fnref:1">
|
290
296
|
<sup>1)</sup>
|
291
297
|
</a>
|
292
298
|
<div id="N">
|
293
299
|
|
294
|
-
<h2>1.1  Introduction to this<a rel="footnote" href="#fn:2" epub:type="footnote" id="fnref:2"><sup>2)</sup></a></h2>
|
300
|
+
<h2 id="toc1">1.1  Introduction to this<a rel="footnote" href="#fn:2" epub:type="footnote" id="fnref:2"><sup>2)</sup></a></h2>
|
295
301
|
</div>
|
296
302
|
<div id="O">
|
297
|
-
<h2>1.2  Clause 4.2</h2>
|
303
|
+
<h2 id="toc2">1.2  Clause 4.2</h2>
|
298
304
|
<p>A<a rel="footnote" href="#fn:2" epub:type="footnote"><sup>2)</sup></a></p>
|
299
305
|
</div>
|
300
306
|
</div>
|
@@ -459,7 +465,7 @@ RSpec.describe IsoDoc do
|
|
459
465
|
<main class="main-section"><button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
|
460
466
|
<br />
|
461
467
|
<div>
|
462
|
-
<h1 class="ForewordTitle">Foreword</h1>
|
468
|
+
<h1 class="ForewordTitle" id="toc0">Foreword</h1>
|
463
469
|
<div id="_" class="figure">
|
464
470
|
<img src="test_htmlimages/_.png" height="776" width="922" />
|
465
471
|
<img src="test_htmlimages/_.png" height="800" width="53" />
|
@@ -826,7 +832,7 @@ expect(File.exist?("test.html")).to be true
|
|
826
832
|
sub(%r{</main>.*$}m, "</main>").sub(%r{^.*?<div>}m, "<div>").sub(%r{</div>.*$}m, "</div>")
|
827
833
|
expect(xmlpp(html)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
828
834
|
<div>
|
829
|
-
<h1 class='ForewordTitle'>Foreword</h1>
|
835
|
+
<h1 class='ForewordTitle' id="toc0">Foreword</h1>
|
830
836
|
<p>
|
831
837
|
<a href='#scope'>Clause 1</a>
|
832
838
|
<a href='#terms'>Clause 3</a>
|
data/spec/isodoc/section_spec.rb
CHANGED
@@ -12,9 +12,7 @@ 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>
|
@@ -92,7 +90,7 @@ RSpec.describe IsoDoc do
|
|
92
90
|
<div>
|
93
91
|
<h1>2  Normative references</h1>
|
94
92
|
</div>
|
95
|
-
<div id="H"><h1>3  Terms,
|
93
|
+
<div id="H"><h1>3  Terms, Definitions, Symbols and Abbreviated Terms</h1>
|
96
94
|
<div id="I">
|
97
95
|
<h2>3.1  Normal Terms</h2>
|
98
96
|
<p class="TermNum" id="J">3.1.1</p>
|
@@ -160,9 +158,7 @@ OUTPUT
|
|
160
158
|
<introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
|
161
159
|
<title>Introduction Subsection</title>
|
162
160
|
</clause>
|
163
|
-
<patent-notice>
|
164
161
|
<p>This is patent boilerplate</p>
|
165
|
-
</patent-notice>
|
166
162
|
</introduction></preface><sections>
|
167
163
|
<clause id="D" obligation="normative">
|
168
164
|
<title>Scope</title>
|
@@ -248,7 +244,7 @@ OUTPUT
|
|
248
244
|
<div>
|
249
245
|
<h1>2<span style="mso-tab-count:1">  </span>Normative references</h1>
|
250
246
|
</div>
|
251
|
-
<div id="H"><h1>3<span style="mso-tab-count:1">  </span>Terms,
|
247
|
+
<div id="H"><h1>3<span style="mso-tab-count:1">  </span>Terms, Definitions, Symbols and Abbreviated Terms</h1>
|
252
248
|
<div id="I">
|
253
249
|
<h2>3.1<span style="mso-tab-count:1">  </span>Normal Terms</h2>
|
254
250
|
<p class="TermNum" id="J">3.1.1</p>
|
@@ -363,7 +359,7 @@ OUTPUT
|
|
363
359
|
INPUT
|
364
360
|
#{HTML_HDR}
|
365
361
|
<p class="zzSTDTitle1"/>
|
366
|
-
<div id="H"><h1>1  Terms and
|
362
|
+
<div id="H"><h1>1  Terms, Definitions, Symbols and Abbreviated Terms</h1>
|
367
363
|
<p class="TermNum" id="J">1.1</p>
|
368
364
|
<p class="Terms" style="text-align:left;">Term2</p>
|
369
365
|
</div>
|
data/spec/isodoc/table_spec.rb
CHANGED
@@ -68,7 +68,7 @@ RSpec.describe IsoDoc do
|
|
68
68
|
<button onclick='topFunction()' id='myBtn' title='Go to top'>Top</button>
|
69
69
|
<br/>
|
70
70
|
<div>
|
71
|
-
<h1 class='ForewordTitle'>Foreword</h1>
|
71
|
+
<h1 class='ForewordTitle' id="toc0">Foreword</h1>
|
72
72
|
<p class='TableTitle' style='text-align:center;'>
|
73
73
|
Table 1 — Repeatability and reproducibility of
|
74
74
|
<i>husked</i>
|
data/spec/isodoc/terms_spec.rb
CHANGED
@@ -54,7 +54,7 @@ RSpec.describe IsoDoc do
|
|
54
54
|
INPUT
|
55
55
|
#{HTML_HDR}
|
56
56
|
<p class="zzSTDTitle1"/>
|
57
|
-
<div id="_terms_and_definitions"><h1>1  Terms and
|
57
|
+
<div id="_terms_and_definitions"><h1>1  Terms and Definitions</h1>
|
58
58
|
<p class="TermNum" id="paddy1">1.1</p><p class="Terms" style="text-align:left;">paddy</p>
|
59
59
|
|
60
60
|
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p>
|
@@ -141,7 +141,7 @@ OUTPUT
|
|
141
141
|
</sections>
|
142
142
|
</iso-standard>
|
143
143
|
INPUT
|
144
|
-
<div id="_terms_and_definitions"><h1>1<span style="mso-tab-count:1">  </span>Terms and
|
144
|
+
<div id="_terms_and_definitions"><h1>1<span style="mso-tab-count:1">  </span>Terms and Definitions</h1>
|
145
145
|
<p class="TermNum" id="paddy1">1.1</p><p class="Terms" style="text-align:left;">paddy</p>
|
146
146
|
|
147
147
|
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p>
|
data/spec/isodoc/xref_spec.rb
CHANGED
@@ -78,7 +78,7 @@ RSpec.describe IsoDoc do
|
|
78
78
|
<a href="#N">Note</a>
|
79
79
|
</p>
|
80
80
|
</div>
|
81
|
-
<div id="terms"><h1>2 
|
81
|
+
<div id="terms"><h1>2  </h1>
|
82
82
|
</div>
|
83
83
|
<div id="widgets">
|
84
84
|
<h1>3  Widgets</h1>
|
@@ -195,7 +195,7 @@ RSpec.describe IsoDoc do
|
|
195
195
|
<a href="#N">Figure 1</a>
|
196
196
|
</p>
|
197
197
|
</div>
|
198
|
-
<div id="terms"><h1>2 
|
198
|
+
<div id="terms"><h1>2  </h1>
|
199
199
|
</div>
|
200
200
|
<div id="widgets">
|
201
201
|
<h1>3  Widgets</h1>
|
@@ -314,7 +314,7 @@ RSpec.describe IsoDoc do
|
|
314
314
|
<div id="scope">
|
315
315
|
<h1>1  Scope</h1>
|
316
316
|
</div>
|
317
|
-
<div id="terms"><h1>2 
|
317
|
+
<div id="terms"><h1>2  </h1>
|
318
318
|
</div>
|
319
319
|
<div id="widgets">
|
320
320
|
<h1>3  Widgets</h1>
|
@@ -438,7 +438,7 @@ RSpec.describe IsoDoc do
|
|
438
438
|
<a href="#N">Example</a>
|
439
439
|
</p>
|
440
440
|
</div>
|
441
|
-
<div id="terms"><h1>2 
|
441
|
+
<div id="terms"><h1>2  </h1>
|
442
442
|
</div>
|
443
443
|
<div id="widgets">
|
444
444
|
<h1>3  Widgets</h1>
|
@@ -560,7 +560,7 @@ RSpec.describe IsoDoc do
|
|
560
560
|
<a href="#N">Formula (1)</a>
|
561
561
|
</p>
|
562
562
|
</div>
|
563
|
-
<div id="terms"><h1>2 
|
563
|
+
<div id="terms"><h1>2  </h1>
|
564
564
|
</div>
|
565
565
|
<div id="widgets">
|
566
566
|
<h1>3  Widgets</h1>
|
@@ -720,7 +720,7 @@ RSpec.describe IsoDoc do
|
|
720
720
|
<a href="#N">Table 1</a>
|
721
721
|
</p>
|
722
722
|
</div>
|
723
|
-
<div id="terms"><h1>2 
|
723
|
+
<div id="terms"><h1>2  </h1>
|
724
724
|
</div>
|
725
725
|
<div id="widgets">
|
726
726
|
<h1>3  Widgets</h1>
|
@@ -799,7 +799,7 @@ RSpec.describe IsoDoc do
|
|
799
799
|
<div id="scope">
|
800
800
|
<h1>1  Scope</h1>
|
801
801
|
</div>
|
802
|
-
<div id="terms"><h1>2 
|
802
|
+
<div id="terms"><h1>2  </h1>
|
803
803
|
<p class="TermNum" id="_waxy_rice">2.1</p><p class="Terms" style="text-align:left;">waxy rice</p>
|
804
804
|
<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><p class="TermNum" id="_nonwaxy_rice">2.2</p><p class="Terms" style="text-align:left;">nonwaxy rice</p>
|
805
805
|
<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>
|
@@ -1058,7 +1058,7 @@ Text</div>
|
|
1058
1058
|
<li><p>A</p></li>
|
1059
1059
|
</ol>
|
1060
1060
|
</div>
|
1061
|
-
<div id="terms"><h1>2 
|
1061
|
+
<div id="terms"><h1>2  </h1>
|
1062
1062
|
</div>
|
1063
1063
|
<div id="widgets">
|
1064
1064
|
<h1>3  Widgets</h1>
|
@@ -1172,7 +1172,7 @@ Text</div>
|
|
1172
1172
|
<li id="N"><p>A</p></li>
|
1173
1173
|
</ol>
|
1174
1174
|
</div>
|
1175
|
-
<div id="terms"><h1>2 
|
1175
|
+
<div id="terms"><h1>2  </h1>
|
1176
1176
|
</div>
|
1177
1177
|
<div id="widgets">
|
1178
1178
|
<h1>3  Widgets</h1>
|
@@ -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"], [:rxl, "rxl"], [:xml, "xml"]]
|
18
|
+
[[:doc, "doc"], [:html, "html"], [:html_alt, "alt.html"], [:pdf, "pdf"], [:rxl, "rxl"], [:xml, "xml"]]
|
19
19
|
OUTPUT
|
20
20
|
end
|
21
21
|
|
@@ -49,7 +49,7 @@ RSpec.describe Metanorma::Iso::Processor do
|
|
49
49
|
expect(xmlpp(File.read("test.html", encoding: "utf-8").gsub(%r{^.*<main}m, "<main").gsub(%r{</main>.*}m, "</main>"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
50
50
|
<main class="main-section"><button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
|
51
51
|
<p class="zzSTDTitle1"></p>
|
52
|
-
<div id="H"><h1>1  Terms and
|
52
|
+
<div id="H"><h1 id="toc0">1  Terms, Definitions, Symbols and Abbreviated Terms</h1>
|
53
53
|
<h2 class="TermNum" id="J">1.1</h2>
|
54
54
|
<p class="Terms" style="text-align:left;">Term2</p>
|
55
55
|
</div>
|
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.3.
|
4
|
+
version: 1.3.23
|
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-
|
11
|
+
date: 2020-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-jing
|
@@ -259,7 +259,9 @@ files:
|
|
259
259
|
- lib/isodoc/iso/html/word_iso_titlepage.html
|
260
260
|
- lib/isodoc/iso/html/wordstyle.scss
|
261
261
|
- lib/isodoc/iso/html_convert.rb
|
262
|
+
- lib/isodoc/iso/iso.international-standard.xsl
|
262
263
|
- lib/isodoc/iso/metadata.rb
|
264
|
+
- lib/isodoc/iso/pdf_convert.rb
|
263
265
|
- lib/isodoc/iso/word_convert.rb
|
264
266
|
- lib/metanorma-iso.rb
|
265
267
|
- lib/metanorma/iso.rb
|