isodoc 1.6.3 → 1.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +2 -12
- data/.hound.yml +3 -1
- data/.rubocop.yml +3 -5
- data/isodoc.gemspec +1 -1
- data/lib/isodoc.rb +0 -2
- data/lib/isodoc/convert.rb +4 -0
- data/lib/isodoc/function/cleanup.rb +52 -43
- data/lib/isodoc/function/inline.rb +7 -7
- data/lib/isodoc/function/section.rb +29 -16
- data/lib/isodoc/function/to_word_html.rb +6 -3
- data/lib/isodoc/function/utils.rb +181 -163
- data/lib/isodoc/headlesshtml_convert.rb +8 -7
- data/lib/isodoc/html_function/comments.rb +2 -0
- data/lib/isodoc/html_function/footnotes.rb +14 -7
- data/lib/isodoc/html_function/html.rb +30 -26
- data/lib/isodoc/html_function/postprocess.rb +16 -13
- data/lib/isodoc/pdf_convert.rb +11 -13
- data/lib/isodoc/presentation_function/bibdata.rb +43 -22
- data/lib/isodoc/presentation_function/inline.rb +20 -15
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/postprocess.rb +50 -36
- data/lib/isodoc/xref/xref_gen_seq.rb +60 -35
- data/lib/isodoc/xref/xref_sect_gen.rb +4 -4
- data/spec/assets/scripts_override.html +3 -0
- data/spec/isodoc/blocks_spec.rb +196 -245
- data/spec/isodoc/inline_spec.rb +442 -289
- data/spec/isodoc/postproc_spec.rb +111 -50
- data/spec/isodoc/presentation_xml_spec.rb +354 -277
- data/spec/isodoc/terms_spec.rb +83 -83
- metadata +5 -4
data/spec/isodoc/terms_spec.rb
CHANGED
@@ -166,93 +166,93 @@ RSpec.describe IsoDoc do
|
|
166
166
|
PRESXML
|
167
167
|
|
168
168
|
html = <<~"OUTPUT"
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
169
|
+
#{HTML_HDR}
|
170
|
+
<p class="zzSTDTitle1"/>
|
171
|
+
<div id="_terms_and_definitions">
|
172
|
+
<h1> 1.   Terms and Definitions </h1>
|
173
|
+
<p>For the purposes of this document,
|
174
|
+
the following terms and definitions apply.</p>
|
175
|
+
<p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
|
176
|
+
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p>
|
177
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example" style='page-break-after: avoid;page-break-inside: avoid;'><p class="example-title">EXAMPLE 1</p>
|
178
|
+
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
179
|
+
<ul>
|
180
|
+
<li>A</li>
|
181
|
+
</ul>
|
182
|
+
</div>
|
183
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p class="example-title">EXAMPLE 2</p>
|
184
|
+
<ul>
|
185
|
+
<li>A</li>
|
186
|
+
</ul>
|
187
|
+
</div>
|
188
|
+
<p>[TERMREF]
|
189
|
+
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
190
|
+
[MODIFICATION] The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
191
|
+
[/TERMREF]</p>
|
192
|
+
<p>[TERMREF] Termbase IEV, term ID xyz [/TERMREF]</p>
|
193
|
+
<p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
|
194
|
+
<p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
|
195
|
+
<p class="AltTerms" style="text-align:left;">rough rice</p>
|
196
|
+
<p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
|
197
|
+
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
|
198
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
|
199
|
+
<ul>
|
200
|
+
<li>A</li>
|
201
|
+
</ul>
|
202
|
+
</div>
|
203
|
+
<div class="Note" id='_671a1994-4783-40d0-bc81-987d06ffb74e' style='page-break-after: avoid;page-break-inside: avoid;'><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>
|
204
|
+
<div class="Note" id='_671a1994-4783-40d0-bc81-987d06ffb74f'><p>Note 2 to entry: <ul><li>A</li></ul><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></p></div>
|
205
|
+
<p>[TERMREF]
|
206
|
+
<a href='#ISO7301'>ISO 7301:2011, 3.1</a>
|
207
|
+
<a href='#ISO7301'>ISO 7301:2011, clause 3.1</a>
|
208
|
+
[/TERMREF]</p></div>
|
182
209
|
</div>
|
183
|
-
|
184
|
-
|
185
|
-
<li>A</li>
|
186
|
-
</ul>
|
187
|
-
</div>
|
188
|
-
<p>[TERMREF]
|
189
|
-
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
190
|
-
[MODIFICATION] The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
191
|
-
[/TERMREF]</p>
|
192
|
-
<p>[TERMREF] Termbase IEV, term ID xyz [/TERMREF]</p>
|
193
|
-
<p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
|
194
|
-
<p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
|
195
|
-
<p class="AltTerms" style="text-align:left;">rough rice</p>
|
196
|
-
<p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
|
197
|
-
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
|
198
|
-
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
|
199
|
-
<ul>
|
200
|
-
<li>A</li>
|
201
|
-
</ul>
|
202
|
-
</div>
|
203
|
-
<div class="Note" id='_671a1994-4783-40d0-bc81-987d06ffb74e' style='page-break-after: avoid;page-break-inside: avoid;'><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>
|
204
|
-
<div class="Note" id='_671a1994-4783-40d0-bc81-987d06ffb74f'><p>Note 2 to entry: <ul><li>A</li></ul><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></p></div>
|
205
|
-
<p>[TERMREF]
|
206
|
-
<a href='#ISO7301'>ISO 7301:2011, 3.1</a>
|
207
|
-
<a href='#ISO7301'>ISO 7301:2011, clause 3.1</a>
|
208
|
-
[/TERMREF]</p></div>
|
209
|
-
</div>
|
210
|
-
</body>
|
211
|
-
</html>
|
210
|
+
</body>
|
211
|
+
</html>
|
212
212
|
OUTPUT
|
213
213
|
|
214
214
|
word = <<~"WORD"
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
215
|
+
#{WORD_HDR}
|
216
|
+
<p class="zzSTDTitle1"/>
|
217
|
+
<div id="_terms_and_definitions"><h1>1.<span style="mso-tab-count:1">  </span>Terms and Definitions</h1><p>For the purposes of this document,
|
218
|
+
the following terms and definitions apply.</p>
|
219
|
+
<p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
|
220
|
+
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p>
|
221
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example" style='page-break-after: avoid;page-break-inside: avoid;'><p class="example-title">EXAMPLE 1</p>
|
222
|
+
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
223
|
+
<ul>
|
224
|
+
<li>A</li>
|
225
|
+
</ul>
|
226
|
+
</div>
|
227
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p class="example-title">EXAMPLE 2</p>
|
228
|
+
<ul>
|
229
|
+
<li>A</li>
|
230
|
+
</ul>
|
231
|
+
</div>
|
232
|
+
<p>[TERMREF]
|
233
|
+
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
234
|
+
[MODIFICATION] The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
235
|
+
[/TERMREF]</p>
|
236
|
+
<p>[TERMREF] Termbase IEV, term ID xyz [/TERMREF]</p>
|
237
|
+
<p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
|
238
|
+
<p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
|
239
|
+
<p class="AltTerms" style="text-align:left;">rough rice</p>
|
240
|
+
<p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
|
241
|
+
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
|
242
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
|
243
|
+
<ul>
|
244
|
+
<li>A</li>
|
245
|
+
</ul>
|
246
|
+
</div>
|
247
|
+
<div id='_671a1994-4783-40d0-bc81-987d06ffb74e' class="Note" style='page-break-after: avoid;page-break-inside: avoid;'><p class="Note">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>
|
248
|
+
<div id='_671a1994-4783-40d0-bc81-987d06ffb74f' class="Note"><p class="Note">Note 2 to entry: <ul><li>A</li></ul><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></p></div>
|
249
|
+
<p>[TERMREF]
|
250
|
+
<a href='#ISO7301'>ISO 7301:2011, 3.1</a>
|
251
|
+
<a href='#ISO7301'>ISO 7301:2011, clause 3.1</a>
|
252
|
+
[/TERMREF]</p></div>
|
253
|
+
</div>
|
254
|
+
</body>
|
255
|
+
</html>
|
256
256
|
WORD
|
257
257
|
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
258
258
|
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isodoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciimath
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 1.
|
89
|
+
version: 1.11.0
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 1.
|
96
|
+
version: 1.11.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: relaton-cli
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -438,6 +438,7 @@ files:
|
|
438
438
|
- spec/assets/rice_image1
|
439
439
|
- spec/assets/rice_image1.png
|
440
440
|
- spec/assets/scripts.html
|
441
|
+
- spec/assets/scripts_override.html
|
441
442
|
- spec/assets/std.css
|
442
443
|
- spec/assets/word.css
|
443
444
|
- spec/assets/word_override.css
|