isodoc 1.8.2.2 → 1.8.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/lib/isodoc/function/cleanup.rb +1 -11
- data/lib/isodoc/function/inline.rb +2 -2
- data/lib/isodoc/function/terms.rb +0 -3
- data/lib/isodoc/function/utils.rb +10 -5
- data/lib/isodoc/i18n.rb +31 -10
- data/lib/isodoc/presentation_function/block.rb +2 -3
- data/lib/isodoc/presentation_function/image.rb +2 -2
- data/lib/isodoc/presentation_function/terms.rb +25 -1
- data/lib/isodoc/presentation_xml_convert.rb +1 -0
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/xref/xref_gen.rb +10 -7
- data/lib/isodoc/xref/xref_gen_seq.rb +159 -148
- data/lib/isodoc/xref/xref_sect_gen.rb +5 -10
- data/lib/isodoc/xref.rb +2 -0
- data/lib/isodoc/xslfo_convert.rb +22 -1
- data/spec/isodoc/cleanup_spec.rb +0 -129
- data/spec/isodoc/i18n_spec.rb +38 -0
- data/spec/isodoc/inline_spec.rb +1 -1
- data/spec/isodoc/postproc_spec.rb +0 -73
- data/spec/isodoc/terms_spec.rb +148 -190
- data/spec/isodoc/xref_spec.rb +71 -0
- data/spec/isodoc/xslfo_convert_spec.rb +35 -0
- metadata +6 -6
data/spec/isodoc/terms_spec.rb
CHANGED
@@ -34,6 +34,9 @@ RSpec.describe IsoDoc do
|
|
34
34
|
<origin citeas=''>
|
35
35
|
<termref base='IEV' target='xyz'>t1</termref>
|
36
36
|
</origin>
|
37
|
+
<modification>
|
38
|
+
<p id='_'/>
|
39
|
+
</modification>
|
37
40
|
</termsource>
|
38
41
|
<termsource status='modified'>
|
39
42
|
<origin citeas=''>
|
@@ -74,183 +77,147 @@ RSpec.describe IsoDoc do
|
|
74
77
|
|
75
78
|
presxml = <<~"PRESXML"
|
76
79
|
<?xml version='1.0'?>
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
<li>A</li>
|
135
|
-
</ul>
|
136
|
-
</termexample>
|
137
|
-
<termnote id='_671a1994-4783-40d0-bc81-987d06ffb74e' keep-with-next='true' keep-lines-together='true'>
|
138
|
-
<name>Note 1 to entry</name>
|
139
|
-
<p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>The starch of waxy rice consists almost entirely of amylopectin. The
|
140
|
-
kernels have a tendency to stick together after cooking.</p>
|
141
|
-
</termnote>
|
142
|
-
<termnote id='_671a1994-4783-40d0-bc81-987d06ffb74f'>
|
143
|
-
<name>Note 2 to entry</name>
|
144
|
-
<ul>
|
145
|
-
<li>A</li>
|
146
|
-
</ul>
|
147
|
-
<p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>The starch of waxy rice consists almost entirely of amylopectin. The
|
148
|
-
kernels have a tendency to stick together after cooking.</p>
|
149
|
-
</termnote>
|
150
|
-
<termsource status='identical'>
|
151
|
-
<origin bibitemid='ISO7301' type='inline' droploc='true' citeas='ISO 7301:2011'><locality type='clause'>
|
152
|
-
<referenceFrom>3.1</referenceFrom>
|
153
|
-
</locality>ISO 7301:2011, 3.1</origin>
|
154
|
-
<origin bibitemid='ISO7301' type='inline' case='lowercase' citeas='ISO 7301:2011'><locality type='clause'>
|
155
|
-
<referenceFrom>3.1</referenceFrom>
|
156
|
-
</locality>ISO 7301:2011, clause 3.1</origin>
|
157
|
-
</termsource>
|
158
|
-
</term>
|
159
|
-
</terms>
|
160
|
-
</sections>
|
161
|
-
</iso-standard>
|
80
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
81
|
+
<sections>
|
82
|
+
<terms id="_terms_and_definitions" obligation="normative" displayorder="1"><title depth="1">1.<tab/>Terms and Definitions</title>
|
83
|
+
<p>For the purposes of this document, the following terms and definitions apply.</p>
|
84
|
+
<term id="paddy1"><name>1.1.</name><preferred><strong>paddy</strong>, <in agriculture, dated></preferred><termsource status="modified">[SOURCE: <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause">
|
85
|
+
<referenceFrom>3.1</referenceFrom>
|
86
|
+
</locality>ISO 7301:2011, Clause 3.1</origin>, modified
|
87
|
+
–
|
88
|
+
The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</termsource>
|
89
|
+
<domain>rice</domain>
|
90
|
+
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
91
|
+
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" keep-with-next="true" keep-lines-together="true"><name>EXAMPLE 1</name>
|
92
|
+
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
93
|
+
<ul>
|
94
|
+
<li>A</li>
|
95
|
+
</ul>
|
96
|
+
</termexample>
|
97
|
+
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894"><name>EXAMPLE 2</name>
|
98
|
+
<ul>
|
99
|
+
<li>A</li>
|
100
|
+
</ul>
|
101
|
+
</termexample>
|
102
|
+
<termsource status="identical">[SOURCE: <origin citeas="">
|
103
|
+
<termref base="IEV" target="xyz">t1</termref>
|
104
|
+
</origin>, modified ;
|
105
|
+
<origin citeas="">
|
106
|
+
<termref base="IEV" target="xyz"/>
|
107
|
+
</origin>, modified
|
108
|
+
–
|
109
|
+
with adjustments]</termsource>
|
110
|
+
</term>
|
111
|
+
<term id="paddy"><name>1.2.</name><preferred><strong>paddy</strong></preferred>
|
112
|
+
<admitted>paddy rice, <in agriculture></admitted>
|
113
|
+
<admitted>rough rice</admitted>
|
114
|
+
<deprecates>cargo rice</deprecates>
|
115
|
+
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
116
|
+
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893"><name>EXAMPLE</name>
|
117
|
+
<ul>
|
118
|
+
<li>A</li>
|
119
|
+
</ul>
|
120
|
+
</termexample>
|
121
|
+
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e" keep-with-next="true" keep-lines-together="true"><name>Note 1 to entry</name>
|
122
|
+
<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>
|
123
|
+
</termnote>
|
124
|
+
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74f"><name>Note 2 to entry</name>
|
125
|
+
<ul><li>A</li></ul>
|
126
|
+
<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>
|
127
|
+
</termnote>
|
128
|
+
<termsource status="identical">[SOURCE: <origin bibitemid="ISO7301" type="inline" droploc="true" citeas="ISO 7301:2011"><locality type="clause">
|
129
|
+
<referenceFrom>3.1</referenceFrom>
|
130
|
+
</locality>ISO 7301:2011, 3.1</origin>
|
131
|
+
<origin bibitemid="ISO7301" type="inline" case="lowercase" citeas="ISO 7301:2011"><locality type="clause">
|
132
|
+
<referenceFrom>3.1</referenceFrom>
|
133
|
+
</locality>ISO 7301:2011, clause 3.1</origin>]</termsource></term>
|
134
|
+
</terms>
|
135
|
+
</sections>
|
136
|
+
</iso-standard>
|
162
137
|
PRESXML
|
163
138
|
|
164
139
|
html = <<~"OUTPUT"
|
165
140
|
#{HTML_HDR}
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
<a href='#ISO7301'>ISO 7301:2011, clause 3.1</a>
|
205
|
-
[/TERMREF]</p></div>
|
206
|
-
</div>
|
207
|
-
</body>
|
208
|
-
</html>
|
141
|
+
<p class="zzSTDTitle1"/>
|
142
|
+
<div id="_terms_and_definitions"><h1>1.  Terms and Definitions</h1><p>For the purposes of this document, the following terms and definitions apply.</p><p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;"><b>paddy</b>, <in agriculture, dated></p><p>[SOURCE: <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>, modified
|
143
|
+
–
|
144
|
+
The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p>
|
145
|
+
|
146
|
+
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p>
|
147
|
+
<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>
|
148
|
+
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
149
|
+
<ul>
|
150
|
+
<li>A</li>
|
151
|
+
</ul>
|
152
|
+
</div>
|
153
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p class="example-title">EXAMPLE 2</p>
|
154
|
+
<ul>
|
155
|
+
<li>A</li>
|
156
|
+
</ul>
|
157
|
+
</div>
|
158
|
+
<p>[SOURCE: t1, modified ;
|
159
|
+
Termbase IEV, term ID xyz, modified
|
160
|
+
–
|
161
|
+
with adjustments]</p>
|
162
|
+
<p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;"><b>paddy</b></p>
|
163
|
+
<p class="AltTerms" style="text-align:left;">paddy rice, <in agriculture></p>
|
164
|
+
<p class="AltTerms" style="text-align:left;">rough rice</p>
|
165
|
+
<p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
|
166
|
+
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
|
167
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
|
168
|
+
<ul>
|
169
|
+
<li>A</li>
|
170
|
+
</ul>
|
171
|
+
</div>
|
172
|
+
<div id="_671a1994-4783-40d0-bc81-987d06ffb74e" class="Note" 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>
|
173
|
+
<div id="_671a1994-4783-40d0-bc81-987d06ffb74f" class="Note"><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>
|
174
|
+
<p>[SOURCE: <a href="#ISO7301">ISO 7301:2011, 3.1</a>
|
175
|
+
<a href="#ISO7301">ISO 7301:2011, clause 3.1</a>]</p></div>
|
176
|
+
</div>
|
177
|
+
</body>
|
178
|
+
</html>
|
209
179
|
OUTPUT
|
210
180
|
|
211
181
|
word = <<~"WORD"
|
212
182
|
#{WORD_HDR}
|
213
|
-
|
214
|
-
|
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
|
-
</div>
|
252
|
-
</body>
|
253
|
-
</html>
|
183
|
+
<p class="zzSTDTitle1"/>
|
184
|
+
<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, the following terms and definitions apply.</p><p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;"><b>paddy</b>, <in agriculture, dated></p><p>[SOURCE: <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>, modified
|
185
|
+
–
|
186
|
+
The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p>
|
187
|
+
|
188
|
+
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p>
|
189
|
+
<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>
|
190
|
+
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
191
|
+
<ul>
|
192
|
+
<li>A</li>
|
193
|
+
</ul>
|
194
|
+
</div>
|
195
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p class="example-title">EXAMPLE 2</p>
|
196
|
+
<ul>
|
197
|
+
<li>A</li>
|
198
|
+
</ul>
|
199
|
+
</div>
|
200
|
+
<p>[SOURCE: t1, modified ;
|
201
|
+
Termbase IEV, term ID xyz, modified
|
202
|
+
–
|
203
|
+
with adjustments]</p>
|
204
|
+
<p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;"><b>paddy</b></p>
|
205
|
+
<p class="AltTerms" style="text-align:left;">paddy rice, <in agriculture></p>
|
206
|
+
<p class="AltTerms" style="text-align:left;">rough rice</p>
|
207
|
+
<p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
|
208
|
+
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
|
209
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
|
210
|
+
<ul>
|
211
|
+
<li>A</li>
|
212
|
+
</ul>
|
213
|
+
</div>
|
214
|
+
<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>
|
215
|
+
<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>
|
216
|
+
<p>[SOURCE: <a href="#ISO7301">ISO 7301:2011, 3.1</a>
|
217
|
+
<a href="#ISO7301">ISO 7301:2011, clause 3.1</a>]</p></div>
|
218
|
+
</div>
|
219
|
+
</body>
|
220
|
+
</html>
|
254
221
|
WORD
|
255
222
|
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
256
223
|
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
@@ -325,19 +292,15 @@ RSpec.describe IsoDoc do
|
|
325
292
|
</li>
|
326
293
|
<li>
|
327
294
|
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747e'>rice retaining its husk after threshing, mark 2</p>
|
328
|
-
<termsource status='modified'>
|
295
|
+
<termsource status='modified'>[SOURCE:
|
329
296
|
<origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'>
|
330
297
|
<locality type='clause'>
|
331
298
|
<referenceFrom>3.1</referenceFrom>
|
332
299
|
</locality>
|
333
300
|
ISO 7301:2011, Clause 3.1
|
334
|
-
</origin
|
335
|
-
<modification>
|
336
|
-
<p id='_e73a417d-ad39-417d-a4c8-20e4e2529489'>
|
301
|
+
</origin>, modified –
|
337
302
|
The term "cargo rice" is shown as deprecated, and Note 1 to
|
338
|
-
entry is not included here
|
339
|
-
</p>
|
340
|
-
</modification>
|
303
|
+
entry is not included here]
|
341
304
|
</termsource>
|
342
305
|
</li>
|
343
306
|
</ol>
|
@@ -355,18 +318,13 @@ RSpec.describe IsoDoc do
|
|
355
318
|
<li>A</li>
|
356
319
|
</ul>
|
357
320
|
</termexample>
|
358
|
-
<termsource status='identical'>
|
321
|
+
<termsource status='identical'>[SOURCE:
|
359
322
|
<origin citeas=''>
|
360
323
|
<termref base='IEV' target='xyz'>t1</termref>
|
361
|
-
</origin
|
362
|
-
</termsource>
|
363
|
-
<termsource status='modified'>
|
324
|
+
</origin>;
|
364
325
|
<origin citeas=''>
|
365
326
|
<termref base='IEV' target='xyz'/>
|
366
|
-
</origin
|
367
|
-
<modification>
|
368
|
-
<p id='_'>with adjustments</p>
|
369
|
-
</modification>
|
327
|
+
</origin>, modified – with adjustments]
|
370
328
|
</termsource>
|
371
329
|
</term>
|
372
330
|
</terms>
|
@@ -676,7 +634,7 @@ RSpec.describe IsoDoc do
|
|
676
634
|
<preferred><strong>Term</strong></preferred>
|
677
635
|
<definition>
|
678
636
|
<p id='C'>Definition</p>
|
679
|
-
<termsource status='identical' type='authoritative'>
|
637
|
+
<termsource status='identical' type='authoritative'>[SOURCE:
|
680
638
|
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
681
639
|
<localityStack>
|
682
640
|
<locality type='section'>
|
@@ -684,7 +642,7 @@ RSpec.describe IsoDoc do
|
|
684
642
|
</locality>
|
685
643
|
</localityStack>
|
686
644
|
, Section 1
|
687
|
-
</origin>
|
645
|
+
</origin>]
|
688
646
|
</termsource>
|
689
647
|
<table id='D'>
|
690
648
|
<name>Table 1</name>
|
@@ -702,7 +660,7 @@ RSpec.describe IsoDoc do
|
|
702
660
|
</tbody>
|
703
661
|
</table>
|
704
662
|
</definition>
|
705
|
-
<termsource status='identical' type='authoritative'>
|
663
|
+
<termsource status='identical' type='authoritative'>[SOURCE:
|
706
664
|
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
707
665
|
<localityStack>
|
708
666
|
<locality type='section'>
|
@@ -710,7 +668,7 @@ RSpec.describe IsoDoc do
|
|
710
668
|
</locality>
|
711
669
|
</localityStack>
|
712
670
|
, Section 2
|
713
|
-
</origin>
|
671
|
+
</origin>]
|
714
672
|
</termsource>
|
715
673
|
</term>
|
716
674
|
<term id='term-term-2'>
|
@@ -732,7 +690,7 @@ RSpec.describe IsoDoc do
|
|
732
690
|
<!-- x = y -->
|
733
691
|
</stem>
|
734
692
|
</formula>
|
735
|
-
<termsource status='identical' type='authoritative'>
|
693
|
+
<termsource status='identical' type='authoritative'>[SOURCE:
|
736
694
|
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
737
695
|
<localityStack>
|
738
696
|
<locality type='section'>
|
@@ -740,7 +698,7 @@ RSpec.describe IsoDoc do
|
|
740
698
|
</locality>
|
741
699
|
</localityStack>
|
742
700
|
, Section 3
|
743
|
-
</origin>
|
701
|
+
</origin>]
|
744
702
|
</termsource>
|
745
703
|
</definition>
|
746
704
|
</term>
|
data/spec/isodoc/xref_spec.rb
CHANGED
@@ -2800,6 +2800,77 @@ RSpec.describe IsoDoc do
|
|
2800
2800
|
.to be_equivalent_to xmlpp(output)
|
2801
2801
|
end
|
2802
2802
|
|
2803
|
+
it "cross-references definition list terms that are stem expressions" do
|
2804
|
+
input = <<~INPUT
|
2805
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
2806
|
+
<preface>
|
2807
|
+
<foreword>
|
2808
|
+
<p>
|
2809
|
+
<xref target="N1"/>
|
2810
|
+
</p>
|
2811
|
+
</foreword>
|
2812
|
+
<introduction id="intro">
|
2813
|
+
<dl id="N01">
|
2814
|
+
<dt id="N1"><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mrow><mover accent="true"><mrow><mi>e</mi></mrow><mo>^</mo></mover></mrow><mrow><mi>r</mi></mrow></msub></math></stem>
|
2815
|
+
<index><primary>
|
2816
|
+
<stem type="MathML">
|
2817
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
2818
|
+
<msub>
|
2819
|
+
<mrow>
|
2820
|
+
<mover accent="true">
|
2821
|
+
<mrow>
|
2822
|
+
<mi>e</mi>
|
2823
|
+
</mrow>
|
2824
|
+
<mo>^</mo>
|
2825
|
+
</mover>
|
2826
|
+
</mrow>
|
2827
|
+
<mrow>
|
2828
|
+
<mi>r</mi>
|
2829
|
+
</mrow>
|
2830
|
+
</msub>
|
2831
|
+
</math>
|
2832
|
+
</stem>
|
2833
|
+
</primary></index></dt><dd>
|
2834
|
+
<p id="_543e0447-dfc6-477e-00cb-1738d6853190"><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi></math></stem>-direction</p>
|
2835
|
+
</dd>
|
2836
|
+
</dl>
|
2837
|
+
</clause>
|
2838
|
+
</annex>
|
2839
|
+
</iso-standard>
|
2840
|
+
INPUT
|
2841
|
+
output = <<~OUTPUT
|
2842
|
+
<foreword displayorder='1'>
|
2843
|
+
<p>
|
2844
|
+
<xref target='N1'>
|
2845
|
+
Introduction, Definition List:
|
2846
|
+
<stem type='MathML'>
|
2847
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
2848
|
+
<msub>
|
2849
|
+
<mrow>
|
2850
|
+
<mover accent='true'>
|
2851
|
+
<mrow>
|
2852
|
+
<mi>e</mi>
|
2853
|
+
</mrow>
|
2854
|
+
<mo>^</mo>
|
2855
|
+
</mover>
|
2856
|
+
</mrow>
|
2857
|
+
<mrow>
|
2858
|
+
<mi>r</mi>
|
2859
|
+
</mrow>
|
2860
|
+
</msub>
|
2861
|
+
</math>
|
2862
|
+
<!-- (hat e)_((r)) -->
|
2863
|
+
</stem>
|
2864
|
+
</xref>
|
2865
|
+
</p>
|
2866
|
+
</foreword>
|
2867
|
+
OUTPUT
|
2868
|
+
expect(xmlpp(Nokogiri::XML(IsoDoc::PresentationXMLConvert.new({})
|
2869
|
+
.convert("test", input, true))
|
2870
|
+
.at("//xmlns:foreword").to_xml))
|
2871
|
+
.to be_equivalent_to xmlpp(output)
|
2872
|
+
end
|
2873
|
+
|
2803
2874
|
it "cross-references bookmarks" do
|
2804
2875
|
input = <<~INPUT
|
2805
2876
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
@@ -61,4 +61,39 @@ RSpec.describe IsoDoc do
|
|
61
61
|
expect(convert.pdf_options(nil))
|
62
62
|
.to eq({ "--param baseassetpath=" => "ABC" })
|
63
63
|
end
|
64
|
+
|
65
|
+
it "test pdf encryption options" do
|
66
|
+
convert = IsoDoc::XslfoPdfConvert.new(
|
67
|
+
{
|
68
|
+
pdfencryptionlength: "a",
|
69
|
+
pdfownerpassword: "b",
|
70
|
+
pdfuserpassword: "c",
|
71
|
+
pdfallowprint: "d",
|
72
|
+
pdfallowcopycontent: "e",
|
73
|
+
pdfalloweditcontent: "f",
|
74
|
+
pdfalloweditannotations: "g",
|
75
|
+
pdfallowfillinforms: "h",
|
76
|
+
pdfallowaccesscontent: "i",
|
77
|
+
pdfallowassembledocument: "j",
|
78
|
+
pdfallowprinthq: "k",
|
79
|
+
pdfencryptmetadata: "l",
|
80
|
+
},
|
81
|
+
)
|
82
|
+
|
83
|
+
expect(convert.pdf_options(nil))
|
84
|
+
.to eq({
|
85
|
+
"--allow-access-content" => "i",
|
86
|
+
"--allow-assemble-document" => "j",
|
87
|
+
"--allow-copy-content" => "e",
|
88
|
+
"--allow-edit-annotations" => "g",
|
89
|
+
"--allow-edit-content" => "f",
|
90
|
+
"--allow-fill-in-forms" => "h",
|
91
|
+
"--allow-print" => "d",
|
92
|
+
"--allow-print-hq" => "k",
|
93
|
+
"--encrypt-metadata" => "l",
|
94
|
+
"--encryption-length" => "a",
|
95
|
+
"--owner-password" => "b",
|
96
|
+
"--user-password" => "c",
|
97
|
+
})
|
98
|
+
end
|
64
99
|
end
|
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.8.
|
4
|
+
version: 1.8.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciimath
|
@@ -517,7 +517,7 @@ homepage: https://github.com/metanorma/isodoc
|
|
517
517
|
licenses:
|
518
518
|
- BSD-2-Clause
|
519
519
|
metadata: {}
|
520
|
-
post_install_message:
|
520
|
+
post_install_message:
|
521
521
|
rdoc_options: []
|
522
522
|
require_paths:
|
523
523
|
- lib
|
@@ -532,8 +532,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
532
532
|
- !ruby/object:Gem::Version
|
533
533
|
version: '0'
|
534
534
|
requirements: []
|
535
|
-
rubygems_version: 3.
|
536
|
-
signing_key:
|
535
|
+
rubygems_version: 3.1.6
|
536
|
+
signing_key:
|
537
537
|
specification_version: 4
|
538
538
|
summary: Convert documents in IsoDoc into Word and HTML in AsciiDoc.
|
539
539
|
test_files: []
|