isodoc 2.1.0.2 → 2.1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/isodoc.gemspec +6 -3
- data/lib/isodoc/base_style/all.css +227 -0
- data/lib/isodoc/base_style/blocks.css +0 -0
- data/lib/isodoc/base_style/blocks.scss +7 -0
- data/lib/isodoc/base_style/coverpage.css +0 -0
- data/lib/isodoc/base_style/defaults.css +0 -0
- data/lib/isodoc/base_style/metanorma_word.css +47 -0
- data/lib/isodoc/base_style/nav.css +0 -0
- data/lib/isodoc/base_style/reset.css +125 -0
- data/lib/isodoc/base_style/typography.css +0 -0
- data/lib/isodoc/class_utils.rb +1 -1
- data/lib/isodoc/function/blocks.rb +1 -1
- data/lib/isodoc/function/cleanup.rb +1 -1
- data/lib/isodoc/function/inline.rb +4 -2
- data/lib/isodoc/function/lists.rb +24 -9
- data/lib/isodoc/function/table.rb +1 -1
- data/lib/isodoc/function/to_word_html.rb +3 -2
- data/lib/isodoc/function/utils.rb +18 -8
- data/lib/isodoc/gem_tasks.rb +19 -10
- data/lib/isodoc/html_function/html.rb +2 -2
- data/lib/isodoc/i18n.rb +19 -0
- data/lib/isodoc/metadata.rb +2 -2
- data/lib/isodoc/presentation_function/block.rb +3 -3
- data/lib/isodoc/presentation_function/image.rb +1 -1
- data/lib/isodoc/presentation_function/inline.rb +13 -6
- data/lib/isodoc/presentation_function/section.rb +3 -1
- data/lib/isodoc/presentation_function/xrefs.rb +22 -6
- data/lib/isodoc/presentation_xml_convert.rb +1 -0
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/body.rb +9 -6
- data/lib/isodoc/word_function/postprocess.rb +1 -1
- data/lib/isodoc/word_function/postprocess_cover.rb +5 -5
- data/lib/isodoc/xref/xref_gen.rb +6 -6
- metadata +16 -69
- data/.github/workflows/rake.yml +0 -15
- data/.github/workflows/release.yml +0 -24
- data/.hound.yml +0 -5
- data/.oss-guides.rubocop.yml +0 -1077
- data/.rubocop.yml +0 -10
- data/Rakefile +0 -8
- data/bin/rspec +0 -17
- data/spec/assets/header.html +0 -7
- data/spec/assets/html.scss +0 -20
- data/spec/assets/html_override.css +0 -1
- data/spec/assets/htmlcover.html +0 -4
- data/spec/assets/htmlintro.html +0 -5
- data/spec/assets/i18n.yaml +0 -41
- data/spec/assets/iso.xml +0 -8
- data/spec/assets/odf.emf +0 -0
- data/spec/assets/odf.svg +0 -1
- data/spec/assets/odf1.svg +0 -4
- data/spec/assets/outputtest/a.xml +0 -66
- data/spec/assets/outputtest/iso.international-standard.xsl +0 -3011
- data/spec/assets/rice_image1 +0 -0
- data/spec/assets/rice_image1.png +0 -0
- data/spec/assets/scripts.html +0 -3
- data/spec/assets/scripts_override.html +0 -3
- data/spec/assets/std.css +0 -2
- data/spec/assets/word.css +0 -2
- data/spec/assets/word_override.css +0 -1
- data/spec/assets/wordcover.html +0 -3
- data/spec/assets/wordintro.html +0 -4
- data/spec/isodoc/blocks_spec.rb +0 -2934
- data/spec/isodoc/cleanup_spec.rb +0 -1056
- data/spec/isodoc/footnotes_spec.rb +0 -264
- data/spec/isodoc/form_spec.rb +0 -160
- data/spec/isodoc/i18n_spec.rb +0 -1201
- data/spec/isodoc/inline_spec.rb +0 -2301
- data/spec/isodoc/lists_spec.rb +0 -469
- data/spec/isodoc/metadata_spec.rb +0 -401
- data/spec/isodoc/postproc_spec.rb +0 -2941
- data/spec/isodoc/presentation_xml_spec.rb +0 -1476
- data/spec/isodoc/ref_spec.rb +0 -955
- data/spec/isodoc/section_spec.rb +0 -2123
- data/spec/isodoc/table_spec.rb +0 -588
- data/spec/isodoc/terms_spec.rb +0 -712
- data/spec/isodoc/utils_spec.rb +0 -57
- data/spec/isodoc/xref_numbering_spec.rb +0 -378
- data/spec/isodoc/xref_spec.rb +0 -1837
- data/spec/isodoc/xslfo_convert_spec.rb +0 -103
- data/spec/spec_helper.rb +0 -81
data/spec/isodoc/utils_spec.rb
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe IsoDoc::ClassUtils do
|
4
|
-
it "cases text" do
|
5
|
-
expect(::IsoDoc::Common.case_strict("ABC CDE", "lowercase", "Hans"))
|
6
|
-
.to eq "ABC CDE"
|
7
|
-
expect(::IsoDoc::Common.case_strict("ABC CDE", "lowercase", "Latn"))
|
8
|
-
.to eq "aBC CDE"
|
9
|
-
expect(::IsoDoc::Common.case_strict("abc cde", "capital", "Latn"))
|
10
|
-
.to eq "Abc cde"
|
11
|
-
expect(::IsoDoc::Common.case_strict("abc cde", "allcaps", "Latn"))
|
12
|
-
.to eq "ABC cde"
|
13
|
-
expect(::IsoDoc::Common.case_strict("ABC CDE", "lowercase", "Hans", firstonly: true))
|
14
|
-
.to eq "ABC CDE"
|
15
|
-
expect(::IsoDoc::Common.case_strict("ABC CDE", "lowercase", "Latn", firstonly: true))
|
16
|
-
.to eq "aBC CDE"
|
17
|
-
expect(::IsoDoc::Common.case_strict("abc cde", "capital", "Latn", firstonly: true))
|
18
|
-
.to eq "Abc cde"
|
19
|
-
expect(::IsoDoc::Common.case_strict("abc cde", "allcaps", "Latn", firstonly: true))
|
20
|
-
.to eq "ABC cde"
|
21
|
-
expect(::IsoDoc::Common.case_strict("ABC CDE", "lowercase", "Hans", firstonly: false))
|
22
|
-
.to eq "ABC CDE"
|
23
|
-
expect(::IsoDoc::Common.case_strict("ABC CDE", "lowercase", "Latn", firstonly: false))
|
24
|
-
.to eq "aBC cDE"
|
25
|
-
expect(::IsoDoc::Common.case_strict("abc cde", "capital", "Latn", firstonly: false))
|
26
|
-
.to eq "Abc Cde"
|
27
|
-
expect(::IsoDoc::Common.case_strict("abc cde", "allcaps", "Latn", firstonly: false))
|
28
|
-
.to eq "ABC CDE"
|
29
|
-
end
|
30
|
-
|
31
|
-
it "cases text with formatting" do
|
32
|
-
expect(::IsoDoc::Common
|
33
|
-
.case_with_markup("<a>ABC</a> CDE", "lowercase", "Hans"))
|
34
|
-
.to eq "<a>ABC</a> CDE"
|
35
|
-
expect(::IsoDoc::Common
|
36
|
-
.case_with_markup("<a>ABC</a> CDE", "lowercase", "Latn"))
|
37
|
-
.to eq "<a>aBC</a> CDE"
|
38
|
-
expect(::IsoDoc::Common
|
39
|
-
.case_with_markup("<a>abc</a> cde", "capital", "Latn"))
|
40
|
-
.to eq "<a>Abc</a> cde"
|
41
|
-
expect(::IsoDoc::Common
|
42
|
-
.case_with_markup("<a>abc</a> cde", "allcaps", "Latn"))
|
43
|
-
.to eq "<a>ABC</a> cde"
|
44
|
-
expect(::IsoDoc::Common
|
45
|
-
.case_with_markup("<a>ABC</a> CDE", "lowercase", "Hans", firstonly: false))
|
46
|
-
.to eq "<a>ABC</a> CDE"
|
47
|
-
expect(::IsoDoc::Common
|
48
|
-
.case_with_markup("<a>ABC</a> CDE", "lowercase", "Latn", firstonly: false))
|
49
|
-
.to eq "<a>aBC</a> cDE"
|
50
|
-
expect(::IsoDoc::Common
|
51
|
-
.case_with_markup("<a>abc</a> cde", "capital", "Latn", firstonly: false))
|
52
|
-
.to eq "<a>Abc</a> Cde"
|
53
|
-
expect(::IsoDoc::Common
|
54
|
-
.case_with_markup("<a>abc</a> cde", "allcaps", "Latn", firstonly: false))
|
55
|
-
.to eq "<a>ABC</a> CDE"
|
56
|
-
end
|
57
|
-
end
|
@@ -1,378 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe IsoDoc do
|
4
|
-
it "realises subsequences" do
|
5
|
-
input = <<~INPUT
|
6
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
7
|
-
<preface>
|
8
|
-
<foreword id="fwd">
|
9
|
-
<p>
|
10
|
-
<xref target="N1"/>
|
11
|
-
<xref target="N2"/>
|
12
|
-
<xref target="N3"/>
|
13
|
-
<xref target="N4"/>
|
14
|
-
<xref target="N5"/>
|
15
|
-
<xref target="N6"/>
|
16
|
-
<xref target="N7"/>
|
17
|
-
<xref target="N8"/>
|
18
|
-
</p>
|
19
|
-
</foreword>
|
20
|
-
<introduction id="intro">
|
21
|
-
<figure id="N1"> <name>Split-it-right sample divider</name>
|
22
|
-
<image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
|
23
|
-
</figure>
|
24
|
-
<figure id="N2" subsequence="A"> <name>Split-it-right sample divider</name>
|
25
|
-
<image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
|
26
|
-
</figure>
|
27
|
-
<figure id="N3" subsequence="A"> <name>Split-it-right sample divider</name>
|
28
|
-
<image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
|
29
|
-
</figure>
|
30
|
-
<figure id="N4" subsequence="B"> <name>Split-it-right sample divider</name>
|
31
|
-
<image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
|
32
|
-
</figure>
|
33
|
-
<figure id="N5" subsequence="B"> <name>Split-it-right sample divider</name>
|
34
|
-
<image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
|
35
|
-
</figure>
|
36
|
-
<figure id="N6" subsequence="B"> <name>Split-it-right sample divider</name>
|
37
|
-
<image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
|
38
|
-
</figure>
|
39
|
-
<figure id="N7"> <name>Split-it-right sample divider</name>
|
40
|
-
<image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
|
41
|
-
</figure>
|
42
|
-
<figure id="N8"> <name>Split-it-right sample divider</name>
|
43
|
-
<image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
|
44
|
-
</figure>
|
45
|
-
</introduction>
|
46
|
-
</iso-standard>
|
47
|
-
INPUT
|
48
|
-
output = <<~OUTPUT
|
49
|
-
<foreword id='fwd' displayorder="1">
|
50
|
-
<p>
|
51
|
-
<xref target='N1'>Figure 1</xref>
|
52
|
-
<xref target='N2'>Figure 2a</xref>
|
53
|
-
<xref target='N3'>Figure 2b</xref>
|
54
|
-
<xref target='N4'>Figure 3a</xref>
|
55
|
-
<xref target='N5'>Figure 3b</xref>
|
56
|
-
<xref target='N6'>Figure 3c</xref>
|
57
|
-
<xref target='N7'>Figure 4</xref>
|
58
|
-
<xref target='N8'>Figure 5</xref>
|
59
|
-
</p>
|
60
|
-
</foreword>
|
61
|
-
OUTPUT
|
62
|
-
expect(xmlpp(Nokogiri::XML(IsoDoc::PresentationXMLConvert.new({})
|
63
|
-
.convert("test", input, true))
|
64
|
-
.at("//xmlns:foreword").to_xml))
|
65
|
-
.to be_equivalent_to xmlpp(output)
|
66
|
-
end
|
67
|
-
|
68
|
-
it "realises numbering overrides" do
|
69
|
-
input = <<~INPUT
|
70
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
71
|
-
<preface>
|
72
|
-
<foreword id="fwd">
|
73
|
-
<p>
|
74
|
-
<xref target="N1"/>
|
75
|
-
<xref target="N2"/>
|
76
|
-
<xref target="N3"/>
|
77
|
-
<xref target="N4"/>
|
78
|
-
<xref target="N5"/>
|
79
|
-
<xref target="N6"/>
|
80
|
-
<xref target="N7"/>
|
81
|
-
<xref target="N8"/>
|
82
|
-
<xref target="N9"/>
|
83
|
-
<xref target="N10"/>
|
84
|
-
<xref target="N11"/>
|
85
|
-
<xref target="N12"/>
|
86
|
-
<xref target="N13"/>
|
87
|
-
</p>
|
88
|
-
<p>
|
89
|
-
<xref target="S1"/>
|
90
|
-
<xref target="S2"/>
|
91
|
-
<xref target="S3"/>
|
92
|
-
<xref target="S4"/>
|
93
|
-
<xref target="S12"/>
|
94
|
-
<xref target="S13"/>
|
95
|
-
<xref target="S14"/>
|
96
|
-
<xref target="S15"/>
|
97
|
-
<xref target="S16"/>
|
98
|
-
<xref target="S17"/>
|
99
|
-
<xref target="S18"/>
|
100
|
-
<xref target="S19"/>
|
101
|
-
<xref target="S20"/>
|
102
|
-
<xref target="S21"/>
|
103
|
-
<xref target="S22"/>
|
104
|
-
<xref target="S23"/>
|
105
|
-
<xref target="S24"/>
|
106
|
-
<xref target="S25"/>
|
107
|
-
<xref target="S26"/>
|
108
|
-
<xref target="S27"/>
|
109
|
-
<xref target="S28"/>
|
110
|
-
<xref target="S29"/>
|
111
|
-
<xref target="S30"/>
|
112
|
-
</p>
|
113
|
-
</foreword>
|
114
|
-
<introduction id="intro">
|
115
|
-
<figure id="N1"> <name>Split-it-right sample divider</name>
|
116
|
-
<image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
|
117
|
-
</figure>
|
118
|
-
<figure id="N2" number="A"> <name>Split-it-right sample divider</name>
|
119
|
-
<image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
|
120
|
-
</figure>
|
121
|
-
<figure id="N3"> <name>Split-it-right sample divider</name>
|
122
|
-
<image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
|
123
|
-
</figure>
|
124
|
-
<figure id="N4" number="7"> <name>Split-it-right sample divider</name>
|
125
|
-
<image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
|
126
|
-
</figure>
|
127
|
-
<figure id="N5"> <name>Split-it-right sample divider</name>
|
128
|
-
<image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
|
129
|
-
</figure>
|
130
|
-
<figure id="N6" subsequence="B"> <name>Split-it-right sample divider</name>
|
131
|
-
<image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
|
132
|
-
</figure>
|
133
|
-
<figure id="N7" subsequence="B" number="c"> <name>Split-it-right sample divider</name>
|
134
|
-
<image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
|
135
|
-
</figure>
|
136
|
-
<figure id="N8" subsequence="B"> <name>Split-it-right sample divider</name>
|
137
|
-
<image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
|
138
|
-
</figure>
|
139
|
-
<figure id="N9" subsequence="C" number="20f"> <name>Split-it-right sample divider</name>
|
140
|
-
<image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
|
141
|
-
</figure>
|
142
|
-
<figure id="N10" subsequence="C"> <name>Split-it-right sample divider</name>
|
143
|
-
<image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
|
144
|
-
</figure>
|
145
|
-
<figure id="N11" number="A.1"> <name>Split-it-right sample divider</name>
|
146
|
-
<image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
|
147
|
-
</figure>
|
148
|
-
<figure id="N12"> <name>Split-it-right sample divider</name>
|
149
|
-
<image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
|
150
|
-
</figure>
|
151
|
-
<figure id="N13" number="100"> <name>Split-it-right sample divider</name>
|
152
|
-
<image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png"/>
|
153
|
-
</figure>
|
154
|
-
</introduction>
|
155
|
-
</preface>
|
156
|
-
<sections>
|
157
|
-
<clause id='S1' number='1bis' type='scope' inline-header='false' obligation='normative'>
|
158
|
-
<title>Scope</title>
|
159
|
-
<p id='_'>Text</p>
|
160
|
-
</clause>
|
161
|
-
<terms id='S3' number='3bis' obligation='normative'>
|
162
|
-
<title>Terms and definitions</title>
|
163
|
-
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
164
|
-
<term id='S4' number='4bis'>
|
165
|
-
<preferred><expression><name>Term1</name></expression></preferred>
|
166
|
-
</term>
|
167
|
-
</terms>
|
168
|
-
<definitions id='S12' number='12bis' type='abbreviated_terms' obligation='normative'>
|
169
|
-
<title>Abbreviated terms</title>
|
170
|
-
</definitions>
|
171
|
-
<clause id='S13' number='13bis' inline-header='false' obligation='normative'>
|
172
|
-
<title>Clause 4</title>
|
173
|
-
<clause id='S14' number='14bis' inline-header='false' obligation='normative'>
|
174
|
-
<title>Introduction</title>
|
175
|
-
</clause>
|
176
|
-
<clause id='S15' inline-header='false' obligation='normative'>
|
177
|
-
<title>Clause A</title>
|
178
|
-
</clause>
|
179
|
-
<clause id='S16' inline-header='false' obligation='normative'>
|
180
|
-
<title>Clause B</title>
|
181
|
-
</clause>
|
182
|
-
<clause id='S17' number='0' inline-header='false' obligation='normative'>
|
183
|
-
<title>Clause C</title>
|
184
|
-
</clause>
|
185
|
-
<clause id='S18' inline-header='false' obligation='normative'>
|
186
|
-
<title>Clause D</title>
|
187
|
-
</clause>
|
188
|
-
<clause id='S19' inline-header='false' obligation='normative'>
|
189
|
-
<title>Clause E</title>
|
190
|
-
</clause>
|
191
|
-
<clause id='S20' number='a' inline-header='false' obligation='normative'>
|
192
|
-
<title>Clause F</title>
|
193
|
-
</clause>
|
194
|
-
<clause id='S21' inline-header='false' obligation='normative'>
|
195
|
-
<title>Clause G</title>
|
196
|
-
</clause>
|
197
|
-
<clause id='S22' number='B' inline-header='false' obligation='normative'>
|
198
|
-
<title>Clause H</title>
|
199
|
-
</clause>
|
200
|
-
<clause id='S23' inline-header='false' obligation='normative'>
|
201
|
-
<title>Clause I</title>
|
202
|
-
</clause>
|
203
|
-
</clause>
|
204
|
-
<clause id='S24' number='16bis' inline-header='false' obligation='normative'>
|
205
|
-
<title>Terms and Definitions</title>
|
206
|
-
</clause>
|
207
|
-
</sections>
|
208
|
-
<annex id='S25' obligation='normative'>
|
209
|
-
<title>First Annex</title>
|
210
|
-
</annex>
|
211
|
-
<annex id='S26' number='17bis' inline-header='false' obligation='normative'>
|
212
|
-
<title>Annex</title>
|
213
|
-
<clause id='S27' number='18bis' inline-header='false' obligation='normative'>
|
214
|
-
<title>Annex A.1</title>
|
215
|
-
</clause>
|
216
|
-
</annex>
|
217
|
-
<annex id='S28' inline-header='false' obligation='normative'>
|
218
|
-
<title>Another Annex</title>
|
219
|
-
</annex>
|
220
|
-
<bibliography>
|
221
|
-
<references id='S2' number='2bis' normative='true' obligation='informative'>
|
222
|
-
<title>Normative references</title>
|
223
|
-
<p id='_'>There are no normative references in this document.</p>
|
224
|
-
</references>
|
225
|
-
<clause id='S29' number='19bis' obligation='informative'>
|
226
|
-
<title>Bibliography</title>
|
227
|
-
<references id='S30' number='20bis' normative='false' obligation='informative'>
|
228
|
-
<title>Bibliography Subsection</title>
|
229
|
-
</references>
|
230
|
-
</clause>
|
231
|
-
</bibliography>
|
232
|
-
</iso-standard>
|
233
|
-
INPUT
|
234
|
-
output = <<~OUTPUT
|
235
|
-
<foreword id='fwd' displayorder='1'>
|
236
|
-
<p>
|
237
|
-
<xref target='N1'>Figure 1</xref>
|
238
|
-
<xref target='N2'>Figure A</xref>
|
239
|
-
<xref target='N3'>Figure B</xref>
|
240
|
-
<xref target='N4'>Figure 7</xref>
|
241
|
-
<xref target='N5'>Figure 8</xref>
|
242
|
-
<xref target='N6'>Figure 9a</xref>
|
243
|
-
<xref target='N7'>Figure 9c</xref>
|
244
|
-
<xref target='N8'>Figure 9d</xref>
|
245
|
-
<xref target='N9'>Figure 20f</xref>
|
246
|
-
<xref target='N10'>Figure 20g</xref>
|
247
|
-
<xref target='N11'>Figure A.1</xref>
|
248
|
-
<xref target='N12'>Figure A.2</xref>
|
249
|
-
<xref target='N13'>Figure 100</xref>
|
250
|
-
</p>
|
251
|
-
<p>
|
252
|
-
<xref target='S1'>Clause 1bis</xref>
|
253
|
-
<xref target='S2'>Clause 2bis</xref>
|
254
|
-
<xref target='S3'>Clause 3bis</xref>
|
255
|
-
<xref target='S4'>Clause 3bis.4bis</xref>
|
256
|
-
<xref target='S12'>Clause 12bis</xref>
|
257
|
-
<xref target='S13'>Clause 13bis</xref>
|
258
|
-
<xref target='S14'>Clause 13bis.14bis</xref>
|
259
|
-
<xref target='S15'>Clause 13bis.14bit</xref>
|
260
|
-
<xref target='S16'>Clause 13bis.14biu</xref>
|
261
|
-
<xref target='S17'>Clause 13bis.0</xref>
|
262
|
-
<xref target='S18'>Clause 13bis.1</xref>
|
263
|
-
<xref target='S19'>Clause 13bis.2</xref>
|
264
|
-
<xref target='S20'>Clause 13bis.a</xref>
|
265
|
-
<xref target='S21'>Clause 13bis.b</xref>
|
266
|
-
<xref target='S22'>Clause 13bis.B</xref>
|
267
|
-
<xref target='S23'>Clause 13bis.C</xref>
|
268
|
-
<xref target='S24'>Clause 16bis</xref>
|
269
|
-
<xref target='S25'>Annex A</xref>
|
270
|
-
<xref target='S26'>Annex 17bis</xref>
|
271
|
-
<xref target='S27'>Annex 17bis.18bis</xref>
|
272
|
-
<xref target='S28'>Annex 17bit</xref>
|
273
|
-
<xref target='S29'>Bibliography</xref>
|
274
|
-
<xref target='S30'>Bibliography Subsection</xref>
|
275
|
-
</p>
|
276
|
-
</foreword>
|
277
|
-
OUTPUT
|
278
|
-
expect(xmlpp(Nokogiri::XML(IsoDoc::PresentationXMLConvert.new({})
|
279
|
-
.convert("test", input, true))
|
280
|
-
.at("//xmlns:foreword").to_xml))
|
281
|
-
.to be_equivalent_to xmlpp(output)
|
282
|
-
end
|
283
|
-
|
284
|
-
it "realises roman counter for xrefs" do
|
285
|
-
a = IsoDoc::XrefGen::Counter.new(0, numerals: :roman)
|
286
|
-
a.increment({})
|
287
|
-
expect(a.print).to eq "I"
|
288
|
-
a.increment({})
|
289
|
-
expect(a.print).to eq "II"
|
290
|
-
a.increment({})
|
291
|
-
expect(a.print).to eq "III"
|
292
|
-
a.increment({})
|
293
|
-
expect(a.print).to eq "IV"
|
294
|
-
a.increment({})
|
295
|
-
expect(a.print).to eq "V"
|
296
|
-
end
|
297
|
-
|
298
|
-
it "skips I in counter for xrefs" do
|
299
|
-
a = IsoDoc::XrefGen::Counter.new("@", skip_i: true)
|
300
|
-
a.increment({})
|
301
|
-
a.increment({})
|
302
|
-
a.increment({})
|
303
|
-
a.increment({})
|
304
|
-
a.increment({})
|
305
|
-
a.increment({})
|
306
|
-
a.increment({})
|
307
|
-
a.increment({})
|
308
|
-
expect(a.print).to eq "H"
|
309
|
-
a.increment({})
|
310
|
-
expect(a.print).to eq "J"
|
311
|
-
a = IsoDoc::XrefGen::Counter.new("@")
|
312
|
-
a.increment({})
|
313
|
-
a.increment({})
|
314
|
-
a.increment({})
|
315
|
-
a.increment({})
|
316
|
-
a.increment({})
|
317
|
-
a.increment({})
|
318
|
-
a.increment({})
|
319
|
-
a.increment({})
|
320
|
-
expect(a.print).to eq "H"
|
321
|
-
a.increment({})
|
322
|
-
expect(a.print).to eq "I"
|
323
|
-
end
|
324
|
-
|
325
|
-
it "increments counter past Z for xrefs" do
|
326
|
-
a = IsoDoc::XrefGen::Counter.new("Z")
|
327
|
-
a.increment({})
|
328
|
-
expect(a.print).to eq "AA"
|
329
|
-
a.increment({})
|
330
|
-
expect(a.print).to eq "AB"
|
331
|
-
a = IsoDoc::XrefGen::Counter.new("BZ")
|
332
|
-
a.increment({})
|
333
|
-
expect(a.print).to eq "CA"
|
334
|
-
a.increment({})
|
335
|
-
expect(a.print).to eq "CB"
|
336
|
-
a = IsoDoc::XrefGen::Counter.new("z")
|
337
|
-
a.increment({})
|
338
|
-
expect(a.print).to eq "aa"
|
339
|
-
a.increment({})
|
340
|
-
expect(a.print).to eq "ab"
|
341
|
-
a = IsoDoc::XrefGen::Counter.new("Az")
|
342
|
-
a.increment({})
|
343
|
-
expect(a.print).to eq "Ba"
|
344
|
-
a.increment({})
|
345
|
-
expect(a.print).to eq "Bb"
|
346
|
-
end
|
347
|
-
|
348
|
-
it "returns initial unincremented value" do
|
349
|
-
input = <<~INPUT
|
350
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
351
|
-
<preface>
|
352
|
-
<foreword id="fwd">
|
353
|
-
<note id="A" unnumbered="true"/>
|
354
|
-
<note id="B" unnumbered="false"/>
|
355
|
-
<note id="C" unnumbered="true"/>
|
356
|
-
</foreword>
|
357
|
-
</preface>
|
358
|
-
</iso-standard>
|
359
|
-
INPUT
|
360
|
-
output = <<~OUTPUT
|
361
|
-
<foreword id='fwd' displayorder='1'>
|
362
|
-
<note id='A' unnumbered='true'>
|
363
|
-
<name>NOTE </name>
|
364
|
-
</note>
|
365
|
-
<note id='B' unnumbered='false'>
|
366
|
-
<name>NOTE </name>
|
367
|
-
</note>
|
368
|
-
<note id='C' unnumbered='true'>
|
369
|
-
<name>NOTE </name>
|
370
|
-
</note>
|
371
|
-
</foreword>
|
372
|
-
OUTPUT
|
373
|
-
expect(xmlpp(Nokogiri::XML(IsoDoc::PresentationXMLConvert.new({})
|
374
|
-
.convert("test", input, true))
|
375
|
-
.at("//xmlns:foreword").to_xml))
|
376
|
-
.to be_equivalent_to xmlpp(output)
|
377
|
-
end
|
378
|
-
end
|