metanorma-iso 1.9.6 → 1.10.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ubuntu.yml +41 -0
- data/Gemfile +3 -4
- data/Makefile +44 -0
- data/Rakefile +1 -1
- data/bin/rspec +1 -2
- data/lib/asciidoctor/iso/cleanup.rb +7 -6
- data/lib/asciidoctor/iso/front.rb +2 -2
- data/lib/asciidoctor/iso/isodoc.rng +254 -27
- data/lib/asciidoctor/iso/section.rb +1 -1
- data/lib/asciidoctor/iso/validate.rb +7 -7
- data/lib/asciidoctor/iso/validate_section.rb +1 -1
- data/lib/isodoc/iso/html/isodoc.css +0 -1
- data/lib/isodoc/iso/html/isodoc.scss +0 -1
- data/lib/isodoc/iso/html/style-human.css +0 -1
- data/lib/isodoc/iso/html/style-human.scss +0 -1
- data/lib/isodoc/iso/html/style-iso.css +0 -1
- data/lib/isodoc/iso/html/style-iso.scss +0 -1
- data/lib/isodoc/iso/i18n.rb +10 -9
- data/lib/isodoc/iso/iso.amendment.xsl +57 -17
- data/lib/isodoc/iso/iso.international-standard.xsl +57 -17
- data/lib/isodoc/iso/isosts_convert.rb +6 -2
- data/lib/isodoc/iso/presentation_xml_convert.rb +19 -9
- data/lib/isodoc/iso/sections.rb +2 -0
- data/lib/isodoc/iso/sts_convert.rb +5 -2
- data/lib/isodoc/iso/word_cleanup.rb +94 -0
- data/lib/isodoc/iso/word_convert.rb +12 -89
- data/lib/metanorma/iso/processor.rb +2 -2
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +4 -5
- data/spec/asciidoctor/base_spec.rb +543 -209
- data/spec/asciidoctor/blocks_spec.rb +22 -47
- data/spec/asciidoctor/cleanup_spec.rb +37 -20
- data/spec/asciidoctor/inline_spec.rb +10 -2
- data/spec/asciidoctor/refs_spec.rb +174 -88
- data/spec/asciidoctor/section_spec.rb +3 -3
- data/spec/isodoc/i18n_spec.rb +36 -22
- data/spec/isodoc/inline_spec.rb +6 -6
- data/spec/isodoc/section_spec.rb +4 -4
- data/spec/isodoc/table_spec.rb +6 -8
- data/spec/isodoc/terms_spec.rb +25 -25
- data/spec/isodoc/xref_spec.rb +1397 -1376
- data/spec/metanorma/processor_spec.rb +114 -15
- data/spec/spec_helper.rb +2 -1
- data/spec/vcr_cassettes/docrels.yml +427 -37
- data/spec/vcr_cassettes/sortrefs.yml +599 -0
- metadata +13 -24
data/spec/isodoc/terms_spec.rb
CHANGED
@@ -7,9 +7,9 @@ RSpec.describe IsoDoc do
|
|
7
7
|
<sections>
|
8
8
|
<terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
|
9
9
|
<term id="paddy1">
|
10
|
-
<preferred>paddy</preferred>
|
10
|
+
<preferred><expression><name>paddy</name></expression></preferred>
|
11
11
|
<domain>rice</domain>
|
12
|
-
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
12
|
+
<definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbal-definition></definition>
|
13
13
|
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
|
14
14
|
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
15
15
|
<ul>
|
@@ -31,11 +31,11 @@ RSpec.describe IsoDoc do
|
|
31
31
|
</term>
|
32
32
|
|
33
33
|
<term id="paddy">
|
34
|
-
<preferred>paddy</preferred>
|
35
|
-
<admitted>paddy rice</admitted>
|
36
|
-
<admitted>rough rice</admitted>
|
37
|
-
<deprecates>cargo rice</deprecates>
|
38
|
-
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
34
|
+
<preferred><expression><name>paddy</name></expression></preferred>
|
35
|
+
<admitted><expression><name>paddy rice</name></expression></admitted>
|
36
|
+
<admitted><expression><name>rough rice</name></expression></admitted>
|
37
|
+
<deprecates><expression><name>cargo rice</name></expression></deprecates>
|
38
|
+
<definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbal-definition></definition>
|
39
39
|
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e">
|
40
40
|
<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>
|
41
41
|
</termnote>
|
@@ -53,11 +53,11 @@ RSpec.describe IsoDoc do
|
|
53
53
|
</termsource>
|
54
54
|
</term>
|
55
55
|
<term id="A">
|
56
|
-
<preferred>term1</preferred>
|
57
|
-
<definition>term1 definition</definition>
|
56
|
+
<preferred><expression><name>term1</name></expression></preferred>
|
57
|
+
<definition><verbal-definition>term1 definition</verbal-definition></definition>
|
58
58
|
<term id="B">
|
59
|
-
<preferred>term2</preferred>
|
60
|
-
<definition>term2 definition</definition>
|
59
|
+
<preferred><expression><name>term2</name></expression></preferred>
|
60
|
+
<definition><verbal-definition>term2 definition</verbal-definition></definition>
|
61
61
|
</term>
|
62
62
|
</term>
|
63
63
|
</terms>
|
@@ -65,16 +65,16 @@ RSpec.describe IsoDoc do
|
|
65
65
|
</iso-standard>
|
66
66
|
INPUT
|
67
67
|
presxml = <<~OUTPUT
|
68
|
+
<?xml version='1.0'?>
|
68
69
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
69
70
|
<sections>
|
70
71
|
<terms id='_terms_and_definitions' obligation='normative' displayorder='1'>
|
71
72
|
<title depth='1'>1<tab/>Terms and Definitions</title>
|
72
73
|
|
73
74
|
<term id='paddy1'><name>1.1</name>
|
74
|
-
<preferred>paddy</preferred>
|
75
|
-
<domain>rice</domain>
|
75
|
+
<preferred><strong>paddy</strong></preferred>
|
76
76
|
<definition>
|
77
|
-
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'
|
77
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'><rice> rice retaining its husk after threshing</p>
|
78
78
|
</definition>
|
79
79
|
<termexample id='_bd57bbf1-f948-4bae-b0ce-73c00431f892'>
|
80
80
|
<name>EXAMPLE 1</name>
|
@@ -97,7 +97,7 @@ RSpec.describe IsoDoc do
|
|
97
97
|
</termsource>
|
98
98
|
</term>
|
99
99
|
<term id='paddy'><name>1.2</name>
|
100
|
-
<preferred>paddy</preferred>
|
100
|
+
<preferred><strong>paddy</strong></preferred>
|
101
101
|
<admitted>paddy rice</admitted>
|
102
102
|
<admitted>rough rice</admitted>
|
103
103
|
<deprecates>cargo rice</deprecates>
|
@@ -129,11 +129,11 @@ RSpec.describe IsoDoc do
|
|
129
129
|
</term>
|
130
130
|
<term id='A'>
|
131
131
|
<name>1.3</name>
|
132
|
-
<preferred>term1</preferred>
|
132
|
+
<preferred><strong>term1</strong></preferred>
|
133
133
|
<definition>term1 definition</definition>
|
134
134
|
<term id='B'>
|
135
135
|
<name>1.3.1</name>
|
136
|
-
<preferred>term2</preferred>
|
136
|
+
<preferred><strong>term2</strong></preferred>
|
137
137
|
<definition>term2 definition</definition>
|
138
138
|
</term>
|
139
139
|
</term>
|
@@ -147,7 +147,7 @@ RSpec.describe IsoDoc do
|
|
147
147
|
<p class="zzSTDTitle1"/>
|
148
148
|
<div id="_terms_and_definitions">
|
149
149
|
<h1>1  Terms and Definitions</h1>
|
150
|
-
<p class="TermNum" id="paddy1">1.1</p><p class="Terms" style="text-align:left;">paddy</p>
|
150
|
+
<p class="TermNum" id="paddy1">1.1</p><p class="Terms" style="text-align:left;"><b>paddy</b></p>
|
151
151
|
|
152
152
|
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p>
|
153
153
|
<div class="example" id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
|
@@ -168,7 +168,7 @@ RSpec.describe IsoDoc do
|
|
168
168
|
[MODIFICATION]The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
169
169
|
[/TERMREF]</p>
|
170
170
|
<p class="TermNum" id="paddy">1.2</p>
|
171
|
-
<p class="Terms" style="text-align:left;">paddy</p>
|
171
|
+
<p class="Terms" style="text-align:left;"><b>paddy</b></p>
|
172
172
|
<p class="AltTerms" style="text-align:left;">paddy rice</p>
|
173
173
|
<p class="AltTerms" style="text-align:left;">rough rice</p>
|
174
174
|
<p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
|
@@ -194,10 +194,10 @@ RSpec.describe IsoDoc do
|
|
194
194
|
<p>[TERMREF]<a href="#ISO7301">ISO 7301:2011, 3.1</a>
|
195
195
|
[/TERMREF]</p>
|
196
196
|
<p class='TermNum' id='A'>1.3</p>
|
197
|
-
<p class='Terms' style='text-align:left;'>term1</p>
|
197
|
+
<p class='Terms' style='text-align:left;'><b>term1</b></p>
|
198
198
|
term1 definition
|
199
199
|
<p class='TermNum' id='B'>1.3.1</p>
|
200
|
-
<p class='Terms' style='text-align:left;'>term2</p>
|
200
|
+
<p class='Terms' style='text-align:left;'><b>term2</b></p>
|
201
201
|
term2 definition
|
202
202
|
</div>
|
203
203
|
</div>
|
@@ -207,7 +207,7 @@ RSpec.describe IsoDoc do
|
|
207
207
|
|
208
208
|
word = <<~OUTPUT
|
209
209
|
<div id="_terms_and_definitions"><h1>1<span style="mso-tab-count:1">  </span>Terms and Definitions</h1>
|
210
|
-
<p class="TermNum" id="paddy1">1.1</p><p class="Terms" style="text-align:left;">paddy</p>
|
210
|
+
<p class="TermNum" id="paddy1">1.1</p><p class="Terms" style="text-align:left;"><b>paddy</b></p>
|
211
211
|
|
212
212
|
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f" class="Definition"><rice> rice retaining its husk after threshing</p>
|
213
213
|
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example"><p><span class="example_label">EXAMPLE 1</span><span style="mso-tab-count:1">  </span>Foreign seeds, husks, bran, sand, dust.</p><ul>
|
@@ -222,7 +222,7 @@ RSpec.describe IsoDoc do
|
|
222
222
|
[MODIFICATION]The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
223
223
|
[/TERMREF]</p>
|
224
224
|
<p class="TermNum" id="paddy">1.2</p>
|
225
|
-
<p class="Terms" style="text-align:left;">paddy</p>
|
225
|
+
<p class="Terms" style="text-align:left;"><b>paddy</b></p>
|
226
226
|
<p class="AltTerms" style="text-align:left;">paddy rice</p>
|
227
227
|
<p class="AltTerms" style="text-align:left;">rough rice</p>
|
228
228
|
<p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
|
@@ -237,10 +237,10 @@ RSpec.describe IsoDoc do
|
|
237
237
|
<p class="Source">[TERMREF]<a href="#ISO7301">ISO 7301:2011, 3.1</a>
|
238
238
|
[/TERMREF]</p>
|
239
239
|
<p class='TermNum' id='A'>1.3</p>
|
240
|
-
<p class='Terms' style='text-align:left;'>term1</p>
|
240
|
+
<p class='Terms' style='text-align:left;'><b>term1</b></p>
|
241
241
|
term1 definition
|
242
242
|
<p class='TermNum' id='B'>1.3.1</p>
|
243
|
-
<p class='Terms' style='text-align:left;'>term2</p>
|
243
|
+
<p class='Terms' style='text-align:left;'><b>term2</b></p>
|
244
244
|
term2 definition
|
245
245
|
</div>
|
246
246
|
OUTPUT
|