metanorma-iso 1.3.25 → 1.4.2
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 -1
- data/.github/workflows/ubuntu.yml +6 -3
- data/.github/workflows/windows.yml +0 -1
- data/Gemfile +1 -0
- data/Rakefile +2 -0
- data/lib/asciidoctor/iso/base.rb +16 -13
- data/lib/asciidoctor/iso/biblio.rng +14 -4
- data/lib/asciidoctor/iso/cleanup.rb +1 -1
- data/lib/asciidoctor/iso/front.rb +3 -155
- data/lib/asciidoctor/iso/front_id.rb +196 -0
- data/lib/asciidoctor/iso/isodoc.rng +444 -1
- data/lib/asciidoctor/iso/isostandard.rng +10 -1
- data/lib/asciidoctor/iso/reqt.rng +23 -0
- data/lib/asciidoctor/iso/term_lookup_cleanup.rb +7 -10
- data/lib/asciidoctor/iso/validate.rb +1 -5
- data/lib/asciidoctor/iso/validate_requirements.rb +1 -1
- data/lib/asciidoctor/iso/validate_style.rb +6 -5
- data/lib/asciidoctor/iso/validate_title.rb +1 -1
- data/lib/isodoc/iso/base_convert.rb +67 -112
- data/lib/isodoc/iso/html/header.html +5 -1
- data/lib/isodoc/iso/html/html_iso_titlepage.html +9 -0
- data/lib/isodoc/iso/html/htmlstyle.scss +0 -1
- data/lib/isodoc/iso/html/isodoc.scss +25 -1
- data/lib/isodoc/iso/html/style-human.scss +8 -1
- data/lib/isodoc/iso/html/style-iso.scss +8 -1
- data/lib/isodoc/iso/html/word_iso_intro.html +4 -0
- data/lib/isodoc/iso/html/word_iso_titlepage.html +4 -4
- data/lib/isodoc/iso/html/wordstyle.scss +20 -7
- data/lib/isodoc/iso/iso.amendment.xsl +5114 -0
- data/lib/isodoc/iso/iso.international-standard.xsl +1258 -530
- data/lib/isodoc/iso/metadata.rb +31 -27
- data/lib/isodoc/iso/pdf_convert.rb +5 -11
- data/lib/isodoc/iso/presentation_xml_convert.rb +13 -0
- data/lib/isodoc/iso/sections.rb +66 -0
- data/lib/isodoc/iso/sts_convert.rb +31 -0
- data/lib/isodoc/iso/xref.rb +111 -0
- data/lib/metanorma-iso.rb +2 -0
- data/lib/metanorma/iso/processor.rb +14 -8
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +6 -2
- data/spec/asciidoctor-iso/amd_spec.rb +412 -4
- data/spec/asciidoctor-iso/base_spec.rb +18 -16
- data/spec/asciidoctor-iso/cleanup_spec.rb +2 -2
- data/spec/asciidoctor-iso/macros_spec.rb +33 -17
- data/spec/asciidoctor-iso/refs_spec.rb +1 -1
- data/spec/asciidoctor-iso/table_spec.rb +1 -1
- data/spec/isodoc/amd_spec.rb +652 -0
- data/spec/isodoc/blocks_spec.rb +112 -27
- data/spec/isodoc/inline_spec.rb +2 -2
- data/spec/isodoc/metadata_spec.rb +88 -4
- data/spec/isodoc/postproc_spec.rb +9 -9
- data/spec/isodoc/ref_spec.rb +6 -6
- data/spec/isodoc/section_spec.rb +28 -1
- data/spec/isodoc/table_spec.rb +8 -8
- data/spec/isodoc/terms_spec.rb +4 -4
- data/spec/isodoc/xref_spec.rb +24 -18
- data/spec/metanorma/processor_spec.rb +2 -2
- metadata +73 -11
data/spec/isodoc/blocks_spec.rb
CHANGED
@@ -8,12 +8,10 @@ RSpec.describe IsoDoc do
|
|
8
8
|
<formula id="_be9158af-7e93-4ee2-90c5-26d31c181934" unnumbered="true">
|
9
9
|
<stem type="AsciiMath">r = 1 %</stem>
|
10
10
|
<dl id="_e4fe94fe-1cde-49d9-b1ad-743293b7e21d">
|
11
|
-
<dt>
|
12
|
-
|
13
|
-
</dt>
|
14
|
-
<dd>
|
15
|
-
<p id="_1b99995d-ff03-40f5-8f2e-ab9665a69b77">is the repeatability limit.</p>
|
16
|
-
</dd>
|
11
|
+
<dt> <stem type="AsciiMath">r</stem> </dt>
|
12
|
+
<dd> <p id="_1b99995d-ff03-40f5-8f2e-ab9665a69b77">is the repeatability limit.</p> </dd>
|
13
|
+
<dt> <stem type="AsciiMath">s_1</stem> </dt>
|
14
|
+
<dd> <p id="_1b99995d-ff03-40f5-8f2e-ab9665a69b77">is the other repeatability limit.</p> </dd>
|
17
15
|
</dl>
|
18
16
|
<note id="_83083c7a-6c85-43db-a9fa-4d8edd0c9fc0">
|
19
17
|
<p id="_511aaa98-4116-42af-8e5b-c87cdf5bfdc8">[durationUnits] is essentially a duration statement without the "P" prefix. "P" is unnecessary because between "G" and "U" duration is always expressed.</p>
|
@@ -26,29 +24,55 @@ RSpec.describe IsoDoc do
|
|
26
24
|
</iso-standard>
|
27
25
|
INPUT
|
28
26
|
#{HTML_HDR}
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
27
|
+
<br/>
|
28
|
+
<div>
|
29
|
+
<h1 class='ForewordTitle'>Foreword</h1>
|
30
|
+
<div id='_be9158af-7e93-4ee2-90c5-26d31c181934'><div class='formula'>
|
31
|
+
<p>
|
32
|
+
<span class='stem'>(#(r = 1 %)#)</span>
|
33
|
+
</p>
|
34
|
+
</div>
|
35
|
+
<p style='page-break-after:avoid;'>where</p>
|
36
|
+
<dl id='_e4fe94fe-1cde-49d9-b1ad-743293b7e21d' class='formula_dl'>
|
37
|
+
<dt>
|
38
|
+
<span class='stem'>(#(r)#)</span>
|
39
|
+
</dt>
|
40
|
+
<dd>
|
41
|
+
<p id='_1b99995d-ff03-40f5-8f2e-ab9665a69b77'>is the repeatability limit.</p>
|
42
|
+
</dd>
|
43
|
+
<dt>
|
44
|
+
<span class='stem'>(#(s_1)#)</span>
|
45
|
+
</dt>
|
46
|
+
<dd>
|
47
|
+
<p id='_1b99995d-ff03-40f5-8f2e-ab9665a69b77'>is the other repeatability limit.</p>
|
48
|
+
</dd>
|
49
|
+
</dl>
|
50
|
+
<div id='_83083c7a-6c85-43db-a9fa-4d8edd0c9fc0' class='Note'>
|
51
|
+
<p>
|
52
|
+
<span class='note_label'>NOTE</span>
|
53
|
+
  [durationUnits] is essentially a duration statement without
|
54
|
+
the "P" prefix. "P" is unnecessary because between "G" and "U"
|
55
|
+
duration is always expressed.
|
56
|
+
</p>
|
57
|
+
</div>
|
58
|
+
</div>
|
59
|
+
<div id='_be9158af-7e93-4ee2-90c5-26d31c181935'><div class='formula'>
|
60
|
+
<p>
|
61
|
+
<span class='stem'>(#(r = 1 %)#)</span>
|
62
|
+
  (1)
|
63
|
+
</p>
|
64
|
+
</div>
|
65
|
+
</div>
|
66
|
+
</div>
|
67
|
+
<p class='zzSTDTitle1'/>
|
68
|
+
</div>
|
69
|
+
</body>
|
70
|
+
</html>
|
47
71
|
OUTPUT
|
48
72
|
end
|
49
73
|
|
50
74
|
it "processes formulae (Word)" do
|
51
|
-
expect((IsoDoc::Iso::WordConvert.new({}).convert("test", <<~"INPUT", true).sub(%r{^.*<div>\s*<h1 class="ForewordTitle">}m, '<div><h1 class="ForewordTitle">').sub(%r{<p>\ </p>\s*</div>.*$}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
75
|
+
expect(xmlpp(IsoDoc::Iso::WordConvert.new({}).convert("test", <<~"INPUT", true).sub(%r{^.*<div>\s*<h1 class="ForewordTitle">}m, '<div><h1 class="ForewordTitle">').sub(%r{<p>\ </p>\s*</div>.*$}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
52
76
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
53
77
|
<preface><foreword>
|
54
78
|
<formula id="_be9158af-7e93-4ee2-90c5-26d31c181934" unnumbered="true">
|
@@ -60,6 +84,8 @@ RSpec.describe IsoDoc do
|
|
60
84
|
<dd>
|
61
85
|
<p id="_1b99995d-ff03-40f5-8f2e-ab9665a69b77">is the repeatability limit.</p>
|
62
86
|
</dd>
|
87
|
+
<dt> <stem type="AsciiMath">s_1</stem> </dt>
|
88
|
+
<dd> <p id="_1b99995d-ff03-40f5-8f2e-ab9665a69b77">is the other repeatability limit.</p> </dd>
|
63
89
|
</dl>
|
64
90
|
<note id="_83083c7a-6c85-43db-a9fa-4d8edd0c9fc0">
|
65
91
|
<p id="_511aaa98-4116-42af-8e5b-c87cdf5bfdc8">[durationUnits] is essentially a duration statement without the "P" prefix. "P" is unnecessary because between "G" and "U" duration is always expressed.</p>
|
@@ -73,7 +99,7 @@ RSpec.describe IsoDoc do
|
|
73
99
|
INPUT
|
74
100
|
<div>
|
75
101
|
<h1 class='ForewordTitle'>Foreword</h1>
|
76
|
-
<div id='_be9158af-7e93-4ee2-90c5-26d31c181934' class='formula'>
|
102
|
+
<div id='_be9158af-7e93-4ee2-90c5-26d31c181934'><div class='formula'>
|
77
103
|
<p>
|
78
104
|
<span class='stem'>(#(r = 1 %)#)</span>
|
79
105
|
</p>
|
@@ -90,6 +116,16 @@ RSpec.describe IsoDoc do
|
|
90
116
|
<p id='_1b99995d-ff03-40f5-8f2e-ab9665a69b77'>is the repeatability limit.</p>
|
91
117
|
</td>
|
92
118
|
</tr>
|
119
|
+
<tr>
|
120
|
+
<td valign='top' align='left'>
|
121
|
+
<p align='left' style='margin-left:0pt;text-align:left;'>
|
122
|
+
<span class='stem'>(#(s_1)#)</span>
|
123
|
+
</p>
|
124
|
+
</td>
|
125
|
+
<td valign='top'>
|
126
|
+
<p id='_1b99995d-ff03-40f5-8f2e-ab9665a69b77'>is the other repeatability limit.</p>
|
127
|
+
</td>
|
128
|
+
</tr>
|
93
129
|
</table>
|
94
130
|
<div id='_83083c7a-6c85-43db-a9fa-4d8edd0c9fc0' class='Note'>
|
95
131
|
<p class='Note'>
|
@@ -100,16 +136,65 @@ RSpec.describe IsoDoc do
|
|
100
136
|
always expressed.
|
101
137
|
</p>
|
102
138
|
</div>
|
103
|
-
|
139
|
+
</div>
|
140
|
+
<div id='_be9158af-7e93-4ee2-90c5-26d31c181935'><div class='formula'>
|
104
141
|
<p>
|
105
142
|
<span class='stem'>(#(r = 1 %)#)</span>
|
106
143
|
<span style='mso-tab-count:1'>  </span>
|
107
144
|
(1)
|
108
145
|
</p>
|
109
146
|
</div>
|
147
|
+
</div>
|
110
148
|
</div>
|
111
149
|
OUTPUT
|
112
150
|
end
|
113
151
|
|
152
|
+
it "processes formulae with single definition list entry" do
|
153
|
+
expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
154
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
155
|
+
<preface><foreword>
|
156
|
+
<formula id="_be9158af-7e93-4ee2-90c5-26d31c181934" unnumbered="true">
|
157
|
+
<stem type="AsciiMath">r = 1 %</stem>
|
158
|
+
<dl id="_e4fe94fe-1cde-49d9-b1ad-743293b7e21d">
|
159
|
+
<dt>
|
160
|
+
<stem type="AsciiMath">r</stem>
|
161
|
+
</dt>
|
162
|
+
<dd>
|
163
|
+
<p id="_1b99995d-ff03-40f5-8f2e-ab9665a69b77">is the repeatability limit.</p>
|
164
|
+
</dd>
|
165
|
+
</dl>
|
166
|
+
<note id="_83083c7a-6c85-43db-a9fa-4d8edd0c9fc0">
|
167
|
+
<p id="_511aaa98-4116-42af-8e5b-c87cdf5bfdc8">[durationUnits] is essentially a duration statement without the "P" prefix. "P" is unnecessary because between "G" and "U" duration is always expressed.</p>
|
168
|
+
</note>
|
169
|
+
</formula>
|
170
|
+
<formula id="_be9158af-7e93-4ee2-90c5-26d31c181935">
|
171
|
+
<stem type="AsciiMath">r = 1 %</stem>
|
172
|
+
</formula>
|
173
|
+
</foreword></preface>
|
174
|
+
</iso-standard>
|
175
|
+
INPUT
|
176
|
+
#{HTML_HDR}
|
177
|
+
<br/>
|
178
|
+
<div>
|
179
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
180
|
+
<div id="_be9158af-7e93-4ee2-90c5-26d31c181934"><div class="formula"><p><span class="stem">(#(r = 1 %)#)</span></p></div>
|
181
|
+
<span class='zzMoveToFollowing'>
|
182
|
+
where
|
183
|
+
<span class='stem'>(#(r)#)</span>
|
184
|
+
</span>
|
185
|
+
<p id='_1b99995d-ff03-40f5-8f2e-ab9665a69b77'>is the repeatability limit.</p>
|
186
|
+
|
187
|
+
<div id="_83083c7a-6c85-43db-a9fa-4d8edd0c9fc0" class="Note"><p><span class="note_label">NOTE</span>  [durationUnits] is essentially a duration statement without the "P" prefix. "P" is unnecessary because between "G" and "U" duration is always expressed.</p></div>
|
188
|
+
</div>
|
189
|
+
|
190
|
+
<div id="_be9158af-7e93-4ee2-90c5-26d31c181935"><div class="formula"><p><span class="stem">(#(r = 1 %)#)</span>  (1)</p></div></div>
|
191
|
+
</div>
|
192
|
+
<p class="zzSTDTitle1"/>
|
193
|
+
</div>
|
194
|
+
</body>
|
195
|
+
</html>
|
196
|
+
OUTPUT
|
197
|
+
end
|
198
|
+
|
114
199
|
|
115
200
|
end
|
data/spec/isodoc/inline_spec.rb
CHANGED
@@ -243,7 +243,7 @@ RSpec.describe IsoDoc do
|
|
243
243
|
<a href="#ISO712">ISO 712, Clause 1</a>
|
244
244
|
<a href="#ISO712">ISO 712, 1.5</a>
|
245
245
|
<a href="#ISO712">A</a>
|
246
|
-
<a href="#ISO712">ISO 712, </a>
|
246
|
+
<a href="#ISO712">ISO 712, Whole of text</a>
|
247
247
|
<a href="#ISO712">ISO 712, Prelude 7</a>
|
248
248
|
<a href="#ISO712">A</a>
|
249
249
|
</p>
|
@@ -251,7 +251,7 @@ RSpec.describe IsoDoc do
|
|
251
251
|
<p class="zzSTDTitle1"/>
|
252
252
|
<div>
|
253
253
|
<h1>1  Normative references</h1>
|
254
|
-
<p id="ISO712" class="NormRef">ISO 712, <i>
|
254
|
+
<p id="ISO712" class="NormRef">ISO 712, <i>Cereals and cereal products</i></p>
|
255
255
|
</div>
|
256
256
|
</div>
|
257
257
|
</body>
|
@@ -16,7 +16,7 @@ RSpec.describe IsoDoc::Iso::Metadata do
|
|
16
16
|
<title type="title-intro" language="fr" format="text/plain">Céréales et légumineuses</title>
|
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
|
-
<docidentifier type="
|
19
|
+
<docidentifier type="ISO">ISO/PreCD3 17301-1</docidentifier>
|
20
20
|
<docidentifier type="iso-with-lang">ISO/PreCD3 17301-1 (E)</docidentifier>
|
21
21
|
<docidentifier type="iso-reference">ISO/PreCD3 17301-1:2000 (E)</docidentifier>
|
22
22
|
<docidentifier type="iso-tc">17301</docidentifier>
|
@@ -60,6 +60,8 @@ RSpec.describe IsoDoc::Iso::Metadata do
|
|
60
60
|
</organization>
|
61
61
|
</owner>
|
62
62
|
</copyright>
|
63
|
+
<keyword>kw2</keyword>
|
64
|
+
<keyword>kw1</keyword>
|
63
65
|
<ext>
|
64
66
|
<doctype>international-standard</doctype>
|
65
67
|
<editorialgroup>
|
@@ -76,7 +78,51 @@ RSpec.describe IsoDoc::Iso::Metadata do
|
|
76
78
|
</bibdata>
|
77
79
|
</iso-standard>
|
78
80
|
INPUT
|
79
|
-
{:accesseddate=>"2012",
|
81
|
+
{:accesseddate=>"2012",
|
82
|
+
:activateddate=>"2013",
|
83
|
+
:agency=>"ISO",
|
84
|
+
:authors=>[],
|
85
|
+
:authors_affiliations=>{},
|
86
|
+
:createddate=>"2010–2011",
|
87
|
+
:docnumber=>"ISO/PreCD3 17301-1",
|
88
|
+
:docnumber_lang=>"ISO/PreCD3 17301-1 (E)",
|
89
|
+
:docnumber_reference=>"ISO/PreCD3 17301-1:2000 (E)",
|
90
|
+
:docnumeric=>"1730",
|
91
|
+
:docsubtitle=>"Céréales et légumineuses — Spécification et méthodes d'essai — Partie 1: Riz",
|
92
|
+
:docsubtitleintro=>"Céréales et légumineuses",
|
93
|
+
:docsubtitlemain=>"Spécification et méthodes d'essai",
|
94
|
+
:docsubtitlepart=>"Riz",
|
95
|
+
:docsubtitlepartlabel=>"Partie 1",
|
96
|
+
:doctitle=>"Cereals and pulses — Specifications and test methods — Part 1: Rice",
|
97
|
+
:doctitleintro=>"Cereals and pulses",
|
98
|
+
:doctitlemain=>"Specifications and test methods",
|
99
|
+
:doctitlepart=>"Rice",
|
100
|
+
:doctitlepartlabel=>"Part 1",
|
101
|
+
:doctype=>"International Standard",
|
102
|
+
:docyear=>"2016",
|
103
|
+
:draft=>"0.4",
|
104
|
+
:draftinfo=>" (draft 0.4, 2016-05-01)",
|
105
|
+
:edition=>"2",
|
106
|
+
:editorialgroup=>["TC 34", "SC 4", "WG 3"],
|
107
|
+
:ics=>nil,
|
108
|
+
:keywords=>["kw2", "kw1"],
|
109
|
+
:obsoleteddate=>"2014",
|
110
|
+
:obsoletes=>nil,
|
111
|
+
:obsoletes_part=>nil,
|
112
|
+
:publisheddate=>"2011",
|
113
|
+
:publisher=>"International Organization for Standardization",
|
114
|
+
:revdate=>"2016-05-01",
|
115
|
+
:revdate_monthyear=>"May 2016",
|
116
|
+
:sc=>"SC 4",
|
117
|
+
:secretariat=>"GB",
|
118
|
+
:stage=>"30",
|
119
|
+
:stage_int=>30,
|
120
|
+
:stageabbr=>"CD",
|
121
|
+
:statusabbr=>"PreCD3",
|
122
|
+
:tc=>"TC 34",
|
123
|
+
:tc_docnumber=>["17301", "17302"],
|
124
|
+
:unpublished=>true,
|
125
|
+
:wg=>"WG 3"}
|
80
126
|
OUTPUT
|
81
127
|
end
|
82
128
|
|
@@ -98,7 +144,7 @@ OUTPUT
|
|
98
144
|
<title type="title-main" language="fr" format="text/plain">Spécification et méthodes d'essai</title>
|
99
145
|
<title type="title-part" language="fr" format="text/plain">Riz</title>
|
100
146
|
</title>
|
101
|
-
<docidentifier type="
|
147
|
+
<docidentifier type="ISO">ISO/IEC/CD 17301-1-3</docidentifier>
|
102
148
|
<docidentifier type="iso-with-lang">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
|
103
149
|
<docidentifier type="iso-reference">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
|
104
150
|
<docidentifier type="iso-tc">17301</docidentifier>
|
@@ -157,7 +203,45 @@ OUTPUT
|
|
157
203
|
</bibdata>
|
158
204
|
</iso-standard>
|
159
205
|
INPUT
|
160
|
-
{:agency=>"ISO/IEC",
|
206
|
+
{:agency=>"ISO/IEC",
|
207
|
+
:authors=>[],
|
208
|
+
:authors_affiliations=>{},
|
209
|
+
:docnumber=>"ISO/IEC/CD 17301-1-3",
|
210
|
+
:docnumber_lang=>"ISO/IEC/CD 17301-1-3 (E)",
|
211
|
+
:docnumber_reference=>"ISO/IEC/CD 17301-1-3 (E)",
|
212
|
+
:docnumeric=>nil,
|
213
|
+
:docsubtitle=>"Céréales et légumineuses — Spécification et méthodes d'essai — Partie 1–3: Riz",
|
214
|
+
:docsubtitleintro=>"Céréales et légumineuses",
|
215
|
+
:docsubtitlemain=>"Spécification et méthodes d'essai",
|
216
|
+
:docsubtitlepart=>"Riz",
|
217
|
+
:docsubtitlepartlabel=>"Partie 1–3",
|
218
|
+
:doctitle=>"Cereals and pulses — Specifications and test methods — Part 1–3: Rice",
|
219
|
+
:doctitleintro=>"Cereals and pulses",
|
220
|
+
:doctitlemain=>"Specifications and test methods",
|
221
|
+
:doctitlepart=>"Rice",
|
222
|
+
:doctitlepartlabel=>"Part 1–3",
|
223
|
+
:doctype=>"International Standard",
|
224
|
+
:docyear=>"2016",
|
225
|
+
:draft=>nil,
|
226
|
+
:draftinfo=>"",
|
227
|
+
:edition=>nil,
|
228
|
+
:editorialgroup=>["ABC 34", "DEF 4", "GHI 3"],
|
229
|
+
:ics=>"1.2.3, 1.2.3",
|
230
|
+
:keywords=>[],
|
231
|
+
:obsoletes=>"IEC 8121",
|
232
|
+
:obsoletes_part=>"3.1",
|
233
|
+
:publisher=>"International Organization for Standardization and International Electrotechnical Commission",
|
234
|
+
:revdate=>nil,
|
235
|
+
:revdate_monthyear=>nil,
|
236
|
+
:sc=>"DEF 4",
|
237
|
+
:secretariat=>"XXXX",
|
238
|
+
:stage=>"60",
|
239
|
+
:stage_int=>60,
|
240
|
+
:statusabbr=>"IS",
|
241
|
+
:tc=>"ABC 34",
|
242
|
+
:tc_docnumber=>["17301"],
|
243
|
+
:unpublished=>false,
|
244
|
+
:wg=>"GHI 3"}
|
161
245
|
OUTPUT
|
162
246
|
end
|
163
247
|
|
@@ -292,25 +292,25 @@ RSpec.describe IsoDoc do
|
|
292
292
|
<p class="zzSTDTitle1"></p>
|
293
293
|
<div id="A">
|
294
294
|
<h1 id="toc0">1  Clause 4</h1>
|
295
|
-
<a
|
295
|
+
<a href="#fn:3" class="FootnoteRef" id="fnref:1">
|
296
296
|
<sup>1)</sup>
|
297
297
|
</a>
|
298
298
|
<div id="N">
|
299
299
|
|
300
|
-
<h2 id="toc1">1.1  Introduction to this<a
|
300
|
+
<h2 id="toc1">1.1  Introduction to this<a href="#fn:2" class="FootnoteRef" id="fnref:2"><sup>2)</sup></a></h2>
|
301
301
|
</div>
|
302
302
|
<div id="O">
|
303
303
|
<h2 id="toc2">1.2  Clause 4.2</h2>
|
304
|
-
<p>A<a
|
304
|
+
<p>A<a class="FootnoteRef" href="#fn:2"><sup>2)</sup></a></p>
|
305
305
|
</div>
|
306
306
|
</div>
|
307
307
|
<aside id="fn:3" class="footnote">
|
308
|
-
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a
|
308
|
+
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a class="FootnoteRef" href="#fn:3">
|
309
309
|
<sup>1)</sup>
|
310
310
|
</a>This is a footnote.</p>
|
311
311
|
<a href="#fnref:1">↩</a></aside>
|
312
312
|
<aside id="fn:2" class="footnote">
|
313
|
-
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a
|
313
|
+
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a href="#fn:2" class="FootnoteRef"><sup>2)</sup></a>Formerly denoted as 15 % (m/m).</p>
|
314
314
|
<a href="#fnref:2">↩</a></aside>
|
315
315
|
|
316
316
|
</main>
|
@@ -353,7 +353,7 @@ RSpec.describe IsoDoc do
|
|
353
353
|
Clause 4
|
354
354
|
</h1>
|
355
355
|
<span style='mso-bookmark:_Ref'>
|
356
|
-
<a href='#_ftn1' epub:type='footnote' style='mso-footnote-id:ftn1' name='_ftnref1' title='' id='_ftnref1'>
|
356
|
+
<a href='#_ftn1' class='FootnoteRef' epub:type='footnote' style='mso-footnote-id:ftn1' name='_ftnref1' title='' id='_ftnref1'>
|
357
357
|
<span class='MsoFootnoteReference'>
|
358
358
|
<span style='mso-special-character:footnote'/>
|
359
359
|
</span>
|
@@ -367,7 +367,7 @@ RSpec.describe IsoDoc do
|
|
367
367
|
<span style='mso-tab-count:1'>  </span>
|
368
368
|
Introduction to this
|
369
369
|
<span style='mso-bookmark:_Ref'>
|
370
|
-
<a href='#_ftn2' epub:type='footnote' style='mso-footnote-id:ftn2' name='_ftnref2' title='' id='_ftnref2'>
|
370
|
+
<a href='#_ftn2' epub:type='footnote' class='FootnoteRef' style='mso-footnote-id:ftn2' name='_ftnref2' title='' id='_ftnref2'>
|
371
371
|
<span class='MsoFootnoteReference'>
|
372
372
|
<span style='mso-special-character:footnote'/>
|
373
373
|
</span>
|
@@ -386,7 +386,7 @@ RSpec.describe IsoDoc do
|
|
386
386
|
<p class='MsoNormal'>
|
387
387
|
A
|
388
388
|
<span style='mso-bookmark:_Ref'>
|
389
|
-
<a href='#_ftn3' epub:type='footnote' style='mso-footnote-id:ftn3' name='_ftnref3' title='' id='_ftnref3'>
|
389
|
+
<a href='#_ftn3' class='FootnoteRef' epub:type='footnote' style='mso-footnote-id:ftn3' name='_ftnref3' title='' id='_ftnref3'>
|
390
390
|
<span class='MsoFootnoteReference'>
|
391
391
|
<span style='mso-special-character:footnote'/>
|
392
392
|
</span>
|
@@ -730,7 +730,7 @@ end
|
|
730
730
|
<a name='boilerplate-place' id='boilerplate-place'/>
|
731
731
|
Dilbert Associates
|
732
732
|
</p>
|
733
|
-
<p align='left' style='text-align:left' class='zzAddress'>
|
733
|
+
<p align='left' style='text-align:left;' class='zzAddress'>
|
734
734
|
<a name='boilerplate-address' id='boilerplate-address'/>
|
735
735
|
Elbonia 5000
|
736
736
|
</p>
|
data/spec/isodoc/ref_spec.rb
CHANGED
@@ -42,7 +42,7 @@ RSpec.describe IsoDoc do
|
|
42
42
|
<abbreviation>ISO</abbreviation>
|
43
43
|
</organization>
|
44
44
|
</contributor>
|
45
|
-
<note format="text/plain" reference="1"
|
45
|
+
<note format="text/plain" reference="1" type="ISO DATE">Under preparation. (Stage at the time of publication ISO/DIS 16634)</note>
|
46
46
|
<extent type="part">
|
47
47
|
<referenceFrom>all</referenceFrom>
|
48
48
|
</extent>
|
@@ -139,10 +139,10 @@ RSpec.describe IsoDoc do
|
|
139
139
|
<h1>1  Normative references</h1>
|
140
140
|
<p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
141
141
|
<p id="ISO712" class="NormRef">ISO 712, <i>Cereals and cereal products</i></p>
|
142
|
-
<p id="ISO16634" class="NormRef">ISO 16634:-- (all parts)<a
|
142
|
+
<p id="ISO16634" class="NormRef">ISO 16634:-- (all parts)<a class="FootnoteRef" href="#fn:1"><sup>1</sup></a>, <i>Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</i></p>
|
143
143
|
<p id="ISO20483" class="NormRef">ISO 20483:2013-2014, <i>Cereals and pulses</i></p>
|
144
144
|
<p id="ref1" class="NormRef">ICC 167, <span style="font-variant:small-caps;">Standard No I.C.C 167</span>. <i>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</i> (see <a href="http://www.icc.or.at">http://www.icc.or.at</a>)</p>
|
145
|
-
<div
|
145
|
+
<div class="Note">
|
146
146
|
<p><span class="note_label">NOTE</span>  This is an annotation of ISO 20483:2013-2014</p>
|
147
147
|
</div>
|
148
148
|
</div>
|
@@ -151,16 +151,16 @@ RSpec.describe IsoDoc do
|
|
151
151
|
<h1 class="Section3">Bibliography</h1>
|
152
152
|
<p id="ISBN" class="Biblio">[1]  <i>Chemicals for analytical laboratory use</i></p>
|
153
153
|
<p id="ISSN" class="Biblio">[2]  <i>Instruments for analytical laboratory use</i></p>
|
154
|
-
<div
|
154
|
+
<div class="Note">
|
155
155
|
<p><span class="note_label">NOTE</span>  This is an annotation of document ISSN.</p>
|
156
156
|
</div>
|
157
|
-
<div
|
157
|
+
<div class="Note">
|
158
158
|
<p><span class="note_label">NOTE</span>  This is another annotation of document ISSN.</p>
|
159
159
|
</div>
|
160
160
|
<p id="ISO3696" class="Biblio">[3]  ISO 3696, <i>Water for analytical laboratory use</i></p>
|
161
161
|
<p id="ref10" class="Biblio">[10]  <span style="font-variant:small-caps;">Standard No I.C.C 167</span>. <i>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</i> (see <a href="http://www.icc.or.at">http://www.icc.or.at</a>)</p>
|
162
162
|
<p id="ref11" class="Biblio">[5]  IETF RFC 10, <i>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</i></p>
|
163
|
-
<p id="ref12" class="Biblio">
|
163
|
+
<p id="ref12" class="Biblio">Citn  IETF RFC 20, CitationWorks. 2019. <i>How to cite a reference</i>.</p>
|
164
164
|
</div>
|
165
165
|
<aside id="fn:1" class="footnote">
|
166
166
|
<p>Under preparation. (Stage at the time of publication ISO/DIS 16634)</p>
|
data/spec/isodoc/section_spec.rb
CHANGED
@@ -391,7 +391,7 @@ OUTPUT
|
|
391
391
|
<h2>1.1  Introduction</h2>
|
392
392
|
</div>
|
393
393
|
<div id="O">
|
394
|
-
<span class="zzMoveToFollowing"><b>1.2  Clause 4.2 </b></span>
|
394
|
+
<span class="zzMoveToFollowing"><b>1.2  Clause 4.2  </b></span>
|
395
395
|
</div>
|
396
396
|
</div>
|
397
397
|
</div>
|
@@ -458,5 +458,32 @@ OUTPUT
|
|
458
458
|
OUTPUT
|
459
459
|
end
|
460
460
|
|
461
|
+
it "processes middle title" do
|
462
|
+
expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
463
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
464
|
+
<bibdata>
|
465
|
+
<title language='en' format='text/plain' type='title-intro'>Introduction</title>
|
466
|
+
<title language='en' format='text/plain' type='title-main'>Main Title — Title</title>
|
467
|
+
<title language='en' format='text/plain' type='title-part'>Title Part</title>
|
468
|
+
<ext>
|
469
|
+
<structuredidentifier>
|
470
|
+
<project-number part='1' origyr='2016-05-01'>17301</project-number>
|
471
|
+
</structuredidentifier>
|
472
|
+
</ext>
|
473
|
+
</bibdata>
|
474
|
+
<sections/>
|
475
|
+
</iso-standard>
|
476
|
+
INPUT
|
477
|
+
#{HTML_HDR}
|
478
|
+
<p class='zzSTDTitle1'>Introduction — Main Title — Title — </p>
|
479
|
+
<p class='zzSTDTitle2'>
|
480
|
+
Part 1:
|
481
|
+
<br/><b>Title Part</b>
|
482
|
+
</p>
|
483
|
+
</div>
|
484
|
+
</body>
|
485
|
+
</html>
|
486
|
+
OUTPUT
|
487
|
+
end
|
461
488
|
|
462
489
|
end
|