isodoc 1.5.4 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +6 -4
- data/Gemfile +2 -2
- data/Rakefile +2 -2
- data/bin/rspec +1 -2
- data/isodoc.gemspec +11 -11
- data/lib/isodoc-yaml/i18n-ar.yaml +152 -0
- data/lib/isodoc-yaml/i18n-de.yaml +149 -0
- data/lib/isodoc-yaml/i18n-es.yaml +151 -0
- data/lib/isodoc-yaml/i18n-ru.yaml +154 -0
- data/lib/isodoc/base_style/all.css +7 -0
- data/lib/isodoc/base_style/metanorma_word.css +7 -0
- data/lib/isodoc/base_style/metanorma_word.scss +8 -0
- data/lib/isodoc/base_style/reset.css +7 -0
- data/lib/isodoc/base_style/reset.scss +9 -0
- data/lib/isodoc/base_style/scripts.html +187 -0
- data/lib/isodoc/class_utils.rb +6 -5
- data/lib/isodoc/common.rb +2 -0
- data/lib/isodoc/convert.rb +30 -17
- data/lib/isodoc/css.rb +42 -28
- data/lib/isodoc/function/blocks.rb +21 -4
- data/lib/isodoc/function/blocks_example_note.rb +2 -2
- data/lib/isodoc/function/cleanup.rb +1 -2
- data/lib/isodoc/function/form.rb +51 -0
- data/lib/isodoc/function/inline.rb +32 -10
- data/lib/isodoc/function/references.rb +55 -42
- data/lib/isodoc/function/table.rb +1 -0
- data/lib/isodoc/function/to_word_html.rb +29 -28
- data/lib/isodoc/function/utils.rb +41 -38
- data/lib/isodoc/gem_tasks.rb +30 -31
- data/lib/isodoc/html_convert.rb +6 -4
- data/lib/isodoc/html_function/form.rb +62 -0
- data/lib/isodoc/html_function/postprocess.rb +35 -76
- data/lib/isodoc/html_function/postprocess_footnotes.rb +59 -0
- data/lib/isodoc/i18n.rb +33 -31
- data/lib/isodoc/pdf_convert.rb +1 -3
- data/lib/isodoc/presentation_function/bibdata.rb +13 -10
- data/lib/isodoc/presentation_function/block.rb +17 -8
- data/lib/isodoc/presentation_function/inline.rb +75 -118
- data/lib/isodoc/presentation_function/math.rb +84 -0
- data/lib/isodoc/presentation_function/section.rb +20 -22
- data/lib/isodoc/presentation_xml_convert.rb +2 -1
- data/lib/isodoc/sassc_importer.rb +1 -1
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/body.rb +28 -24
- data/lib/isodoc/word_function/footnotes.rb +22 -15
- data/lib/isodoc/word_function/postprocess.rb +16 -6
- data/lib/isodoc/xref.rb +10 -11
- data/lib/isodoc/xref/xref_counter.rb +32 -17
- data/lib/isodoc/xref/xref_gen.rb +45 -32
- data/lib/isodoc/xref/xref_sect_gen.rb +33 -31
- data/lib/isodoc/xslfo_convert.rb +36 -25
- data/spec/assets/html_override.css +1 -0
- data/spec/assets/word_override.css +1 -0
- data/spec/isodoc/blocks_spec.rb +2518 -2570
- data/spec/isodoc/cleanup_spec.rb +1107 -1109
- data/spec/isodoc/footnotes_spec.rb +1 -16
- data/spec/isodoc/form_spec.rb +156 -0
- data/spec/isodoc/i18n_spec.rb +984 -972
- data/spec/isodoc/inline_spec.rb +984 -920
- data/spec/isodoc/lists_spec.rb +316 -315
- data/spec/isodoc/postproc_spec.rb +1692 -1538
- data/spec/isodoc/presentation_xml_spec.rb +345 -342
- data/spec/isodoc/ref_spec.rb +718 -723
- data/spec/isodoc/section_spec.rb +910 -902
- data/spec/isodoc/table_spec.rb +566 -556
- data/spec/isodoc/terms_spec.rb +252 -256
- data/spec/isodoc/xref_spec.rb +3040 -2985
- data/spec/isodoc/xslfo_convert_spec.rb +39 -0
- data/spec/spec_helper.rb +30 -29
- metadata +80 -70
- data/.rubocop.ribose.yml +0 -65
- data/.rubocop.tb.yml +0 -650
- data/lib/twitter-cldr/patch.rb +0 -39
data/spec/isodoc/terms_spec.rb
CHANGED
@@ -3,266 +3,262 @@ require "spec_helper"
|
|
3
3
|
RSpec.describe IsoDoc do
|
4
4
|
it "processes IsoXML terms" do
|
5
5
|
input = <<~"INPUT"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
<
|
12
|
-
<
|
13
|
-
<
|
14
|
-
<
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
<
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
<
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
<
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
</
|
51
|
-
|
52
|
-
|
53
|
-
<
|
54
|
-
<
|
55
|
-
|
56
|
-
<
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
<
|
62
|
-
|
63
|
-
</
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
</termnote>
|
68
|
-
<termsource status="identical">
|
69
|
-
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
|
70
|
-
</termsource></term>
|
71
|
-
</terms>
|
72
|
-
</sections>
|
73
|
-
</iso-standard>
|
6
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
7
|
+
<sections>
|
8
|
+
<terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
|
9
|
+
<p>For the purposes of this document, the following terms and definitions apply.</p>
|
10
|
+
<term id="paddy1"><preferred>paddy</preferred>
|
11
|
+
<domain>rice</domain>
|
12
|
+
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
13
|
+
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" keep-with-next="true" keep-lines-together="true">
|
14
|
+
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
15
|
+
<ul>
|
16
|
+
<li>A</li>
|
17
|
+
</ul>
|
18
|
+
</termexample>
|
19
|
+
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894">
|
20
|
+
<ul>
|
21
|
+
<li>A</li>
|
22
|
+
</ul>
|
23
|
+
</termexample>
|
24
|
+
<termsource status="modified">
|
25
|
+
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
|
26
|
+
<modification>
|
27
|
+
<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>
|
28
|
+
</modification>
|
29
|
+
</termsource>
|
30
|
+
<termsource status='identical'>
|
31
|
+
<origin citeas=''>
|
32
|
+
<termref base='IEV' target='xyz'>t1</termref>
|
33
|
+
</origin>
|
34
|
+
</termsource>
|
35
|
+
<termsource status='modified'>
|
36
|
+
<origin citeas=''>
|
37
|
+
<termref base='IEV' target='xyz'/>
|
38
|
+
</origin>
|
39
|
+
<modification>
|
40
|
+
<p id='_'>with adjustments</p>
|
41
|
+
</modification>
|
42
|
+
</termsource>
|
43
|
+
</term>
|
44
|
+
<term id="paddy"><preferred>paddy</preferred><admitted>paddy rice</admitted>
|
45
|
+
<admitted>rough rice</admitted>
|
46
|
+
<deprecates>cargo rice</deprecates>
|
47
|
+
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
48
|
+
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
|
49
|
+
<ul>
|
50
|
+
<li>A</li>
|
51
|
+
</ul>
|
52
|
+
</termexample>
|
53
|
+
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e" keep-with-next="true" keep-lines-together="true">
|
54
|
+
<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>
|
55
|
+
</termnote>
|
56
|
+
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74f">
|
57
|
+
<ul><li>A</li></ul>
|
58
|
+
<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>
|
59
|
+
</termnote>
|
60
|
+
<termsource status="identical">
|
61
|
+
<origin bibitemid="ISO7301" type="inline" droploc="true" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
|
62
|
+
<origin bibitemid="ISO7301" type="inline" case="lowercase" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
|
63
|
+
</termsource></term>
|
64
|
+
</terms>
|
65
|
+
</sections>
|
66
|
+
</iso-standard>
|
74
67
|
INPUT
|
75
68
|
|
76
69
|
presxml = <<~"PRESXML"
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
</title>
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
</locality>ISO 7301:2011, Clause 3.1</origin>
|
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
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
</locality>ISO 7301:2011,
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
<p class="zzSTDTitle1"/>
|
175
|
-
<div id="_terms_and_definitions">
|
176
|
-
<h1> 1.   Terms and Definitions </h1>
|
177
|
-
<p>For the purposes of this document,
|
178
|
-
the following terms and definitions apply.</p>
|
179
|
-
<p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
|
180
|
-
|
181
|
-
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p>
|
182
|
-
<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>
|
183
|
-
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
184
|
-
<ul>
|
185
|
-
<li>A</li>
|
186
|
-
</ul>
|
187
|
-
</div>
|
188
|
-
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p class="example-title">EXAMPLE 2</p>
|
189
|
-
<ul>
|
190
|
-
<li>A</li>
|
191
|
-
</ul>
|
192
|
-
</div>
|
193
|
-
|
194
|
-
<p>[TERMREF]
|
195
|
-
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
196
|
-
[MODIFICATION] The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
197
|
-
[/TERMREF]</p>
|
198
|
-
<p>[TERMREF] Termbase IEV, term ID xyz [/TERMREF]</p>
|
199
|
-
<p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
|
200
|
-
<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>
|
201
|
-
<p class="AltTerms" style="text-align:left;">rough rice</p>
|
202
|
-
<p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
|
203
|
-
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
|
204
|
-
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
|
205
|
-
<ul>
|
206
|
-
<li>A</li>
|
207
|
-
</ul>
|
208
|
-
</div>
|
209
|
-
<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>
|
210
|
-
<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>
|
211
|
-
<p>[TERMREF]
|
212
|
-
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
213
|
-
[/TERMREF]</p></div>
|
214
|
-
</div>
|
215
|
-
</body>
|
216
|
-
</html>
|
217
|
-
OUTPUT
|
218
|
-
|
219
|
-
word = <<~"WORD"
|
220
|
-
#{WORD_HDR}
|
221
|
-
<p class="zzSTDTitle1"/>
|
222
|
-
<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,
|
223
|
-
the following terms and definitions apply.</p>
|
224
|
-
<p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
|
225
|
-
|
226
|
-
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p>
|
227
|
-
<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>
|
228
|
-
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
229
|
-
<ul>
|
230
|
-
<li>A</li>
|
231
|
-
</ul>
|
232
|
-
</div>
|
233
|
-
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p class="example-title">EXAMPLE 2</p>
|
234
|
-
<ul>
|
235
|
-
<li>A</li>
|
236
|
-
</ul>
|
237
|
-
</div>
|
70
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
71
|
+
<sections>
|
72
|
+
<terms id='_terms_and_definitions' obligation='normative'>
|
73
|
+
<title depth='1'>
|
74
|
+
1.
|
75
|
+
<tab/>
|
76
|
+
Terms and Definitions
|
77
|
+
</title>
|
78
|
+
<p>For the purposes of this document, the following terms and definitions apply.</p>
|
79
|
+
<term id='paddy1'><name>1.1.</name>
|
80
|
+
<preferred>paddy</preferred>
|
81
|
+
<domain>rice</domain>
|
82
|
+
<definition>
|
83
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
|
84
|
+
</definition>
|
85
|
+
<termexample id='_bd57bbf1-f948-4bae-b0ce-73c00431f892' keep-with-next='true' keep-lines-together='true'>
|
86
|
+
<name>EXAMPLE 1</name>
|
87
|
+
<p id='_65c9a509-9a89-4b54-a890-274126aeb55c'>Foreign seeds, husks, bran, sand, dust.</p>
|
88
|
+
<ul>
|
89
|
+
<li>A</li>
|
90
|
+
</ul>
|
91
|
+
</termexample>
|
92
|
+
<termexample id='_bd57bbf1-f948-4bae-b0ce-73c00431f894'>
|
93
|
+
<name>EXAMPLE 2</name>
|
94
|
+
<ul>
|
95
|
+
<li>A</li>
|
96
|
+
</ul>
|
97
|
+
</termexample>
|
98
|
+
<termsource status='modified'>
|
99
|
+
<origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'>
|
100
|
+
<referenceFrom>3.1</referenceFrom>
|
101
|
+
</locality>ISO 7301:2011, Clause 3.1</origin>
|
102
|
+
<modification>
|
103
|
+
<p id='_e73a417d-ad39-417d-a4c8-20e4e2529489'>
|
104
|
+
The term "cargo rice" is shown as deprecated, and Note 1 to entry
|
105
|
+
is not included here
|
106
|
+
</p>
|
107
|
+
</modification>
|
108
|
+
</termsource>
|
109
|
+
<termsource status='identical'>
|
110
|
+
<origin citeas=''>
|
111
|
+
<termref base='IEV' target='xyz'>t1</termref>
|
112
|
+
</origin>
|
113
|
+
</termsource>
|
114
|
+
<termsource status='modified'>
|
115
|
+
<origin citeas=''>
|
116
|
+
<termref base='IEV' target='xyz'/>
|
117
|
+
</origin>
|
118
|
+
<modification>
|
119
|
+
<p id='_'>with adjustments</p>
|
120
|
+
</modification>
|
121
|
+
</termsource>
|
122
|
+
</term>
|
123
|
+
<term id='paddy'><name>1.2.</name>
|
124
|
+
<preferred>paddy</preferred>
|
125
|
+
<admitted>paddy rice</admitted>
|
126
|
+
<admitted>rough rice</admitted>
|
127
|
+
<deprecates>cargo rice</deprecates>
|
128
|
+
<definition>
|
129
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
|
130
|
+
</definition>
|
131
|
+
<termexample id='_bd57bbf1-f948-4bae-b0ce-73c00431f893'>
|
132
|
+
<name>EXAMPLE</name>
|
133
|
+
<ul>
|
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'>
|
140
|
+
The starch of waxy rice consists almost entirely of amylopectin. The
|
141
|
+
kernels have a tendency to stick together after cooking.
|
142
|
+
</p>
|
143
|
+
</termnote>
|
144
|
+
<termnote id='_671a1994-4783-40d0-bc81-987d06ffb74f'>
|
145
|
+
<name>Note 2 to entry</name>
|
146
|
+
<ul>
|
147
|
+
<li>A</li>
|
148
|
+
</ul>
|
149
|
+
<p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
|
150
|
+
The starch of waxy rice consists almost entirely of amylopectin. The
|
151
|
+
kernels have a tendency to stick together after cooking.
|
152
|
+
</p>
|
153
|
+
</termnote>
|
154
|
+
<termsource status='identical'>
|
155
|
+
<origin bibitemid='ISO7301' type='inline' droploc='true' citeas='ISO 7301:2011'><locality type='clause'>
|
156
|
+
<referenceFrom>3.1</referenceFrom>
|
157
|
+
</locality>ISO 7301:2011, 3.1</origin>
|
158
|
+
<origin bibitemid='ISO7301' type='inline' case='lowercase' citeas='ISO 7301:2011'><locality type='clause'>
|
159
|
+
<referenceFrom>3.1</referenceFrom>
|
160
|
+
</locality>ISO 7301:2011, clause 3.1</origin>
|
161
|
+
</termsource>
|
162
|
+
</term>
|
163
|
+
</terms>
|
164
|
+
</sections>
|
165
|
+
</iso-standard>
|
166
|
+
PRESXML
|
238
167
|
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
<p>
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
168
|
+
html = <<~"OUTPUT"
|
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>
|
209
|
+
</div>
|
210
|
+
</body>
|
211
|
+
</html>
|
212
|
+
OUTPUT
|
262
213
|
|
263
|
-
WORD
|
264
|
-
|
265
|
-
|
266
|
-
|
214
|
+
word = <<~"WORD"
|
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
|
+
WORD
|
257
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
258
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
259
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
260
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
261
|
+
expect(xmlpp(IsoDoc::WordConvert.new({})
|
262
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(word)
|
267
263
|
end
|
268
264
|
end
|