metanorma-standoc 1.9.1 → 1.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +0 -2
- data/lib/asciidoctor/standoc/blocks.rb +18 -3
- data/lib/asciidoctor/standoc/blocks_notes.rb +29 -18
- data/lib/asciidoctor/standoc/cleanup.rb +1 -0
- data/lib/asciidoctor/standoc/cleanup_block.rb +30 -12
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +23 -12
- data/lib/asciidoctor/standoc/cleanup_ref.rb +3 -2
- data/lib/asciidoctor/standoc/converter.rb +7 -2
- data/lib/asciidoctor/standoc/datamodel/plantuml_renderer.rb +67 -66
- data/lib/asciidoctor/standoc/isodoc.rng +174 -0
- data/lib/asciidoctor/standoc/macros.rb +11 -11
- data/lib/asciidoctor/standoc/macros_form.rb +63 -0
- data/lib/asciidoctor/standoc/ref_sect.rb +20 -17
- data/lib/asciidoctor/standoc/section.rb +3 -1
- data/lib/asciidoctor/standoc/terms.rb +24 -17
- data/lib/asciidoctor/standoc/utils.rb +3 -3
- data/lib/asciidoctor/standoc/validate.rb +18 -16
- data/lib/metanorma-standoc.rb +0 -1
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +1 -1
- data/spec/asciidoctor/blocks_spec.rb +829 -734
- data/spec/asciidoctor/cleanup_sections_spec.rb +38 -1
- data/spec/asciidoctor/isobib_cache_spec.rb +406 -358
- data/spec/asciidoctor/macros_spec.rb +537 -441
- data/spec/asciidoctor/macros_yaml2text_spec.rb +1 -1
- data/spec/asciidoctor/section_spec.rb +367 -297
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +50 -50
- data/spec/vcr_cassettes/isobib_get_123.yml +12 -12
- data/spec/vcr_cassettes/isobib_get_123_1.yml +24 -24
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +33 -33
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +12 -12
- data/spec/vcr_cassettes/isobib_get_124.yml +12 -12
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +14 -14
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +46 -46
- metadata +5 -4
@@ -34,9 +34,9 @@ module Asciidoctor
|
|
34
34
|
fragment = doc.fragment("")
|
35
35
|
::Nokogiri::XML::Builder.with fragment, &block
|
36
36
|
fragment.to_xml(encoding: "US-ASCII", indent: 0).lines.map do |l|
|
37
|
-
l.gsub(/>\n$/, ">").gsub(/\s*\n$/m, " ").gsub("–", "\u0096")
|
38
|
-
gsub("—", "\u0097").gsub("–", "\u0096")
|
39
|
-
gsub("—", "\u0097")
|
37
|
+
l.gsub(/>\n$/, ">").gsub(/\s*\n$/m, " ").gsub("–", "\u0096")
|
38
|
+
.gsub("—", "\u0097").gsub("–", "\u0096")
|
39
|
+
.gsub("—", "\u0097")
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
@@ -7,7 +7,6 @@ require "iev"
|
|
7
7
|
module Asciidoctor
|
8
8
|
module Standoc
|
9
9
|
module Validate
|
10
|
-
|
11
10
|
SOURCELOCALITY = "./termsource/origin//locality[@type = 'clause']/"\
|
12
11
|
"referenceFrom".freeze
|
13
12
|
|
@@ -55,13 +54,13 @@ module Asciidoctor
|
|
55
54
|
clean_abort("Numeric reference in normative references", doc.to_xml)
|
56
55
|
end
|
57
56
|
|
58
|
-
def repeat_id_validate1(ids,
|
59
|
-
if ids[
|
60
|
-
@log.add("Anchors",
|
61
|
-
"at line #{ids[
|
57
|
+
def repeat_id_validate1(ids, elem)
|
58
|
+
if ids[elem["id"]]
|
59
|
+
@log.add("Anchors", elem, "Anchor #{elem['id']} has already been "\
|
60
|
+
"used at line #{ids[elem['id']]}")
|
62
61
|
raise StandardError.new "Error: multiple instances of same ID"
|
63
62
|
else
|
64
|
-
ids[
|
63
|
+
ids[elem["id"]] = elem.line
|
65
64
|
end
|
66
65
|
ids
|
67
66
|
end
|
@@ -78,17 +77,9 @@ module Asciidoctor
|
|
78
77
|
end
|
79
78
|
|
80
79
|
def schema_validate(doc, schema)
|
81
|
-
Tempfile.open(["tmp", ".xml"], :
|
80
|
+
Tempfile.open(["tmp", ".xml"], encoding: "UTF-8") do |f|
|
82
81
|
begin
|
83
|
-
f
|
84
|
-
f.close
|
85
|
-
errors = Jing.new(schema).validate(f.path)
|
86
|
-
warn "Syntax Valid!" if errors.none?
|
87
|
-
errors.each do |e|
|
88
|
-
@log.add("Metanorma XML Syntax",
|
89
|
-
"XML Line #{"%06d" % e[:line]}:#{e[:column]}",
|
90
|
-
e[:message])
|
91
|
-
end
|
82
|
+
schema_validate1(f, doc, schema)
|
92
83
|
rescue Jing::Error => e
|
93
84
|
clean_abort("Jing failed with error: #{e}", doc.to_xml)
|
94
85
|
ensure
|
@@ -97,6 +88,17 @@ module Asciidoctor
|
|
97
88
|
end
|
98
89
|
end
|
99
90
|
|
91
|
+
def schema_validate1(file, doc, schema)
|
92
|
+
file.write(doc.to_xml)
|
93
|
+
file.close
|
94
|
+
errors = Jing.new(schema).validate(file.path)
|
95
|
+
warn "Syntax Valid!" if errors.none?
|
96
|
+
errors.each do |e|
|
97
|
+
@log.add("Metanorma XML Syntax",
|
98
|
+
"XML Line #{'%06d' % e[:line]}:#{e[:column]}", e[:message])
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
100
102
|
# RelaxNG cannot cope well with wildcard attributes. So we strip
|
101
103
|
# any attributes from FormattedString instances (which can contain
|
102
104
|
# xs:any markup, and are signalled with @format) before validation.
|
data/lib/metanorma-standoc.rb
CHANGED
data/metanorma-standoc.gemspec
CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
|
29
29
|
spec.add_dependency "asciidoctor", "~> 2.0.0"
|
30
30
|
spec.add_dependency "iev", "~> 0.2.1"
|
31
|
-
spec.add_dependency "isodoc", "~> 1.6.
|
31
|
+
spec.add_dependency "isodoc", "~> 1.6.2"
|
32
32
|
spec.add_dependency "metanorma-plugin-datastruct"
|
33
33
|
spec.add_dependency "metanorma-plugin-lutaml"
|
34
34
|
spec.add_dependency "ruby-jing"
|
@@ -1,26 +1,31 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
require "open3"
|
3
3
|
|
4
|
+
OPTIONS = [backend: :standoc, header_footer: true].freeze
|
5
|
+
|
4
6
|
RSpec.describe Asciidoctor::Standoc do
|
5
|
-
|
6
|
-
|
7
|
+
it "processes format-specific pass blocks" do
|
8
|
+
input = <<~INPUT
|
7
9
|
#{ASCIIDOC_BLANK_HDR}
|
8
|
-
|
10
|
+
|
9
11
|
[format="rfc,html"]
|
10
12
|
++++
|
11
13
|
<abc>X > Y</abc>
|
12
14
|
++++
|
13
15
|
INPUT
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
output = <<~OUTPUT
|
17
|
+
#{BLANK_HDR}
|
18
|
+
<sections>
|
19
|
+
<passthrough formats='rfc,html'><abc>X > Y</abc></passthrough>
|
20
|
+
</sections>
|
21
|
+
</standard-document>
|
19
22
|
OUTPUT
|
23
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
24
|
+
.to be_equivalent_to xmlpp(output)
|
20
25
|
end
|
21
26
|
|
22
27
|
it "processes Metanorma XML pass blocks" do
|
23
|
-
|
28
|
+
input = <<~INPUT
|
24
29
|
#{ASCIIDOC_BLANK_HDR}
|
25
30
|
|
26
31
|
++++
|
@@ -31,16 +36,19 @@ RSpec.describe Asciidoctor::Standoc do
|
|
31
36
|
Y</abc>
|
32
37
|
++++
|
33
38
|
INPUT
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
+
output = <<~OUTPUT
|
40
|
+
#{BLANK_HDR}
|
41
|
+
<sections>
|
42
|
+
<abc>X > Y</abc>
|
43
|
+
</sections>
|
44
|
+
</standard-document>
|
39
45
|
OUTPUT
|
46
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
47
|
+
.to be_equivalent_to xmlpp(output)
|
40
48
|
end
|
41
49
|
|
42
50
|
it "processes open blocks" do
|
43
|
-
|
51
|
+
input = <<~INPUT
|
44
52
|
#{ASCIIDOC_BLANK_HDR}
|
45
53
|
--
|
46
54
|
x
|
@@ -50,23 +58,26 @@ RSpec.describe Asciidoctor::Standoc do
|
|
50
58
|
z
|
51
59
|
--
|
52
60
|
INPUT
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
61
|
+
output = <<~OUTPUT
|
62
|
+
#{BLANK_HDR}
|
63
|
+
<sections><p id="_">x</p>
|
64
|
+
<p id="_">y</p>
|
65
|
+
<p id="_">z</p></sections>
|
66
|
+
</standard-document>
|
58
67
|
OUTPUT
|
68
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
69
|
+
.to be_equivalent_to xmlpp(output)
|
59
70
|
end
|
60
71
|
|
61
72
|
it "processes stem blocks" do
|
62
|
-
|
73
|
+
input = <<~INPUT
|
63
74
|
#{ASCIIDOC_BLANK_HDR}
|
64
75
|
|
65
76
|
[[ABC]]
|
66
77
|
[stem%inequality,number=3,keep-with-next=true,keep-lines-together=true]
|
67
78
|
++++
|
68
|
-
r = 1 %
|
69
|
-
r = 1 %
|
79
|
+
r = 1 %
|
80
|
+
r = 1 %
|
70
81
|
++++
|
71
82
|
|
72
83
|
[stem%unnumbered]
|
@@ -85,155 +96,158 @@ RSpec.describe Asciidoctor::Standoc do
|
|
85
96
|
++++
|
86
97
|
|
87
98
|
INPUT
|
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
|
-
|
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
|
-
|
165
|
-
|
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
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
99
|
+
output = <<~OUTPUT
|
100
|
+
#{BLANK_HDR}
|
101
|
+
<sections>
|
102
|
+
<formula id='ABC' number='3' keep-with-next='true' keep-lines-together='true' inequality='true'>
|
103
|
+
<stem type='MathML'>
|
104
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
105
|
+
<mi>r</mi>
|
106
|
+
<mo>=</mo>
|
107
|
+
<mn>1</mn>
|
108
|
+
<mi>%</mi>
|
109
|
+
<mi>r</mi>
|
110
|
+
<mo>=</mo>
|
111
|
+
<mn>1</mn>
|
112
|
+
<mi>%</mi>
|
113
|
+
</math>
|
114
|
+
</stem>
|
115
|
+
</formula>
|
116
|
+
<formula id='_' unnumbered='true'>
|
117
|
+
<stem type='MathML'>
|
118
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
119
|
+
<msub>
|
120
|
+
<mrow>
|
121
|
+
<mrow>
|
122
|
+
<mi mathvariant='bold-italic'>F</mi>
|
123
|
+
</mrow>
|
124
|
+
</mrow>
|
125
|
+
<mrow>
|
126
|
+
<mrow>
|
127
|
+
<mi mathvariant='bold-italic'>Α</mi>
|
128
|
+
</mrow>
|
129
|
+
</mrow>
|
130
|
+
</msub>
|
131
|
+
</math>
|
132
|
+
</stem>
|
133
|
+
</formula>
|
134
|
+
<formula id='_' subsequence='A'>
|
135
|
+
<stem type='MathML'>
|
136
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
137
|
+
<mrow>
|
138
|
+
<mi>M</mi>
|
139
|
+
<mo>=</mo>
|
140
|
+
<mo>[</mo>
|
141
|
+
<mtable>
|
142
|
+
<mtr>
|
143
|
+
<mtd>
|
144
|
+
<mrow>
|
145
|
+
<mo>−</mo>
|
146
|
+
<mi>sin</mi>
|
147
|
+
</mrow>
|
148
|
+
<msub>
|
149
|
+
<mi>λ</mi>
|
150
|
+
<mn>0</mn>
|
151
|
+
</msub>
|
152
|
+
</mtd>
|
153
|
+
<mtd>
|
154
|
+
<mi>cos</mi>
|
155
|
+
<msub>
|
156
|
+
<mi>λ</mi>
|
157
|
+
<mn>0</mn>
|
158
|
+
</msub>
|
159
|
+
</mtd>
|
160
|
+
<mtd>
|
161
|
+
<mn>0</mn>
|
162
|
+
</mtd>
|
163
|
+
</mtr>
|
164
|
+
<mtr>
|
165
|
+
<mtd>
|
166
|
+
<mrow>
|
167
|
+
<mo>−</mo>
|
168
|
+
<mi>sin</mi>
|
169
|
+
</mrow>
|
170
|
+
<msub>
|
171
|
+
<mi>φ</mi>
|
172
|
+
<mn>0</mn>
|
173
|
+
</msub>
|
174
|
+
<mi>cos</mi>
|
175
|
+
<msub>
|
176
|
+
<mi>λ</mi>
|
177
|
+
<mn>0</mn>
|
178
|
+
</msub>
|
179
|
+
</mtd>
|
180
|
+
<mtd>
|
181
|
+
<mrow>
|
182
|
+
<mo>−</mo>
|
183
|
+
<mi>sin</mi>
|
184
|
+
</mrow>
|
185
|
+
<msub>
|
186
|
+
<mi>φ</mi>
|
187
|
+
<mn>0</mn>
|
188
|
+
</msub>
|
189
|
+
<mi>sin</mi>
|
190
|
+
<msub>
|
191
|
+
<mi>λ</mi>
|
192
|
+
<mn>0</mn>
|
193
|
+
</msub>
|
194
|
+
</mtd>
|
195
|
+
<mtd>
|
196
|
+
<mi>cos</mi>
|
197
|
+
<msub>
|
198
|
+
<mi>φ</mi>
|
199
|
+
<mn>0</mn>
|
200
|
+
</msub>
|
201
|
+
</mtd>
|
202
|
+
</mtr>
|
203
|
+
<mtr>
|
204
|
+
<mtd>
|
205
|
+
<mi>cos</mi>
|
206
|
+
<msub>
|
207
|
+
<mi>φ</mi>
|
208
|
+
<mn>0</mn>
|
209
|
+
</msub>
|
210
|
+
<mi>cos</mi>
|
211
|
+
<msub>
|
212
|
+
<mi>λ</mi>
|
213
|
+
<mn>0</mn>
|
214
|
+
</msub>
|
215
|
+
</mtd>
|
216
|
+
<mtd>
|
217
|
+
<mi>cos</mi>
|
218
|
+
<msub>
|
219
|
+
<mi>φ</mi>
|
220
|
+
<mn>0</mn>
|
221
|
+
</msub>
|
222
|
+
<mi>sin</mi>
|
223
|
+
<msub>
|
224
|
+
<mi>λ</mi>
|
225
|
+
<mn>0</mn>
|
226
|
+
</msub>
|
227
|
+
</mtd>
|
228
|
+
<mtd>
|
229
|
+
<mi>sin</mi>
|
230
|
+
<msub>
|
231
|
+
<mi>φ</mi>
|
232
|
+
<mn>0</mn>
|
233
|
+
</msub>
|
234
|
+
</mtd>
|
235
|
+
</mtr>
|
236
|
+
</mtable>
|
237
|
+
<mo>]</mo>
|
238
|
+
</mrow>
|
239
|
+
</math>
|
240
|
+
</stem>
|
241
|
+
</formula>
|
242
|
+
</sections>
|
243
|
+
</standard-document>
|
232
244
|
OUTPUT
|
245
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
246
|
+
.to be_equivalent_to xmlpp(output)
|
233
247
|
end
|
234
|
-
|
235
|
-
|
236
|
-
|
248
|
+
|
249
|
+
it "ignores review blocks unless document is in draft mode" do
|
250
|
+
input = <<~INPUT
|
237
251
|
#{ASCIIDOC_BLANK_HDR}
|
238
252
|
[[foreword]]
|
239
253
|
.Foreword
|
@@ -245,16 +259,17 @@ RSpec.describe Asciidoctor::Standoc do
|
|
245
259
|
|
246
260
|
For further information on the Foreword, see *ISO/IEC Directives, Part 2, 2016, Clause 12.*
|
247
261
|
****
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
262
|
+
INPUT
|
263
|
+
output = <<~OUTPUT
|
264
|
+
#{BLANK_HDR}
|
265
|
+
<sections><p id="foreword">Foreword</p>
|
266
|
+
</sections>
|
267
|
+
</standard-document>
|
268
|
+
OUTPUT
|
269
|
+
end
|
255
270
|
|
256
271
|
it "processes review blocks if document is in draft mode" do
|
257
|
-
|
272
|
+
input = <<~INPUT
|
258
273
|
= Document title
|
259
274
|
Author
|
260
275
|
:docfile: test.adoc
|
@@ -272,7 +287,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
272
287
|
|
273
288
|
For further information on the Foreword, see *ISO/IEC Directives, Part 2, 2016, Clause 12.*
|
274
289
|
****
|
275
|
-
|
290
|
+
INPUT
|
291
|
+
output = <<~OUTPUT
|
276
292
|
<standard-document xmlns="https://www.metanorma.org/ns/standoc" type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
277
293
|
<bibdata type="standard">
|
278
294
|
<title language="en" format="text/plain">Document title</title>
|
@@ -296,11 +312,13 @@ RSpec.describe Asciidoctor::Standoc do
|
|
296
312
|
<p id="_">For further information on the Foreword, see <strong>ISO/IEC Directives, Part 2, 2016, Clause 12.</strong></p></review></sections>
|
297
313
|
</standard-document>
|
298
314
|
|
299
|
-
|
315
|
+
OUTPUT
|
316
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
317
|
+
.to be_equivalent_to xmlpp(output)
|
300
318
|
end
|
301
319
|
|
302
320
|
it "processes term notes" do
|
303
|
-
|
321
|
+
input = <<~INPUT
|
304
322
|
#{ASCIIDOC_BLANK_HDR}
|
305
323
|
== Terms and Definitions
|
306
324
|
|
@@ -312,29 +330,32 @@ RSpec.describe Asciidoctor::Standoc do
|
|
312
330
|
====
|
313
331
|
XYZ
|
314
332
|
====
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
</
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
333
|
+
INPUT
|
334
|
+
output = <<~OUTPUT
|
335
|
+
#{BLANK_HDR}
|
336
|
+
<sections>
|
337
|
+
<terms id="_" obligation="normative">
|
338
|
+
<title>Terms and definitions</title>
|
339
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
340
|
+
<term id="term-term1">
|
341
|
+
<preferred>Term1</preferred>
|
342
|
+
<termnote id="_">
|
343
|
+
<p id="_">This is a note</p>
|
344
|
+
</termnote>
|
345
|
+
<termnote id='_'>
|
346
|
+
<p id='_'>XYZ</p>
|
347
|
+
</termnote>
|
348
|
+
</term>
|
349
|
+
</terms>
|
350
|
+
</sections>
|
351
|
+
</standard-document>
|
352
|
+
OUTPUT
|
353
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
354
|
+
.to be_equivalent_to xmlpp(output)
|
334
355
|
end
|
335
356
|
|
336
|
-
|
337
|
-
|
357
|
+
it "processes term notes as plain notes in nonterm clauses" do
|
358
|
+
input = <<~INPUT
|
338
359
|
#{ASCIIDOC_BLANK_HDR}
|
339
360
|
== Terms and Definitions
|
340
361
|
|
@@ -348,33 +369,35 @@ RSpec.describe Asciidoctor::Standoc do
|
|
348
369
|
=== Term1
|
349
370
|
|
350
371
|
NOTE: This is a note
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
</
|
360
|
-
|
361
|
-
|
362
|
-
</
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
</
|
368
|
-
</
|
369
|
-
</
|
370
|
-
</
|
371
|
-
</
|
372
|
-
|
373
|
-
|
372
|
+
INPUT
|
373
|
+
output = <<~OUTPUT
|
374
|
+
#{BLANK_HDR}
|
375
|
+
<sections>
|
376
|
+
<terms id="_" obligation="normative">
|
377
|
+
<title>Terms and definitions</title>
|
378
|
+
<p id="_">No terms and definitions are listed in this document.</p>
|
379
|
+
<note id='_'>
|
380
|
+
<p id='_'>This is not a termnote</p>
|
381
|
+
</note>
|
382
|
+
<example id='_'>
|
383
|
+
<p id='_'>This is not a termexample</p>
|
384
|
+
</example>
|
385
|
+
<clause id="_" inline-header="false" obligation="normative">
|
386
|
+
<title>Term1</title>
|
387
|
+
<note id="_">
|
388
|
+
<p id="_">This is a note</p>
|
389
|
+
</note>
|
390
|
+
</clause>
|
391
|
+
</terms>
|
392
|
+
</sections>
|
393
|
+
</standard-document>
|
394
|
+
OUTPUT
|
395
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
396
|
+
.to be_equivalent_to xmlpp(output)
|
374
397
|
end
|
375
398
|
|
376
|
-
|
377
|
-
|
399
|
+
it "processes term notes as plain notes in definitions subclauses of terms & definitions" do
|
400
|
+
input = <<~INPUT
|
378
401
|
#{ASCIIDOC_BLANK_HDR}
|
379
402
|
== Terms and Definitions
|
380
403
|
|
@@ -383,28 +406,30 @@ RSpec.describe Asciidoctor::Standoc do
|
|
383
406
|
=== Symbols
|
384
407
|
|
385
408
|
NOTE: This is a note
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
<
|
391
|
-
<
|
392
|
-
|
393
|
-
</
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
</
|
399
|
-
</
|
400
|
-
</
|
401
|
-
</
|
402
|
-
|
403
|
-
|
409
|
+
INPUT
|
410
|
+
output = <<~OUTPUT
|
411
|
+
#{BLANK_HDR}
|
412
|
+
<sections>
|
413
|
+
<terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
|
414
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
415
|
+
<term id="term-term1">
|
416
|
+
<preferred>Term1</preferred>
|
417
|
+
</term>
|
418
|
+
<definitions id="_" obligation="normative" type="symbols">
|
419
|
+
<title>Symbols</title>
|
420
|
+
<note id="_">
|
421
|
+
<p id="_">This is a note</p>
|
422
|
+
</note>
|
423
|
+
</definitions></terms>
|
424
|
+
</sections>
|
425
|
+
</standard-document>
|
426
|
+
OUTPUT
|
427
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
428
|
+
.to be_equivalent_to xmlpp(output)
|
404
429
|
end
|
405
430
|
|
406
|
-
|
407
|
-
|
431
|
+
it "processes notes" do
|
432
|
+
input = <<~INPUT
|
408
433
|
#{ASCIIDOC_BLANK_HDR}
|
409
434
|
NOTE: This is a note
|
410
435
|
|
@@ -417,31 +442,34 @@ RSpec.describe Asciidoctor::Standoc do
|
|
417
442
|
====
|
418
443
|
XYZ
|
419
444
|
====
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
445
|
+
INPUT
|
446
|
+
output = <<~OUTPUT
|
447
|
+
#{BLANK_HDR}
|
448
|
+
<preface><foreword id="_" obligation="informative">
|
449
|
+
<title>Foreword</title>
|
450
|
+
<note id="_">
|
451
|
+
<p id="_">This is a note</p>
|
452
|
+
</note>
|
453
|
+
</foreword></preface><sections>
|
454
|
+
<note id='_' number="7" subsequence="A" keep-with-next="true" keep-lines-together="true" type="classified">
|
455
|
+
<p id='_'>XYZ</p>
|
456
|
+
</note>
|
457
|
+
<clause id="_" inline-header="false" obligation="normative">
|
458
|
+
<title>Clause 1</title>
|
459
|
+
<note id="ABC">
|
460
|
+
<p id="_">This is a note</p>
|
461
|
+
</note>
|
462
|
+
</clause></sections>
|
463
|
+
|
464
|
+
</standard-document>
|
439
465
|
|
440
|
-
|
441
|
-
|
466
|
+
OUTPUT
|
467
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
468
|
+
.to be_equivalent_to xmlpp(output)
|
469
|
+
end
|
442
470
|
|
443
|
-
|
444
|
-
|
471
|
+
it "processes literals" do
|
472
|
+
input = <<~INPUT
|
445
473
|
#{ASCIIDOC_BLANK_HDR}
|
446
474
|
|
447
475
|
[[ABC]]
|
@@ -450,7 +478,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
450
478
|
<LITERAL>
|
451
479
|
FIGURATIVE
|
452
480
|
....
|
453
|
-
|
481
|
+
INPUT
|
482
|
+
output = <<~OUTPUT
|
454
483
|
#{BLANK_HDR}
|
455
484
|
<sections>
|
456
485
|
<figure id="ABC" keep-with-next="true" keep-lines-together="true">
|
@@ -461,14 +490,17 @@ RSpec.describe Asciidoctor::Standoc do
|
|
461
490
|
</sections>
|
462
491
|
</standard-document>
|
463
492
|
|
464
|
-
|
465
|
-
|
493
|
+
OUTPUT
|
494
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
495
|
+
.to be_equivalent_to xmlpp(output)
|
496
|
+
end
|
466
497
|
|
467
|
-
|
468
|
-
|
498
|
+
it "processes simple admonitions with Asciidoc names" do
|
499
|
+
input = <<~INPUT
|
469
500
|
#{ASCIIDOC_BLANK_HDR}
|
470
501
|
CAUTION: Only use paddy or parboiled rice for the determination of husked rice yield.
|
471
|
-
|
502
|
+
INPUT
|
503
|
+
output = <<~OUTPUT
|
472
504
|
#{BLANK_HDR}
|
473
505
|
<sections>
|
474
506
|
<admonition id="_" type="caution">
|
@@ -477,14 +509,15 @@ RSpec.describe Asciidoctor::Standoc do
|
|
477
509
|
</sections>
|
478
510
|
</standard-document>
|
479
511
|
|
480
|
-
|
481
|
-
|
482
|
-
|
512
|
+
OUTPUT
|
513
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
514
|
+
.to be_equivalent_to xmlpp(output)
|
515
|
+
end
|
483
516
|
|
484
|
-
|
485
|
-
|
517
|
+
it "processes complex admonitions with non-Asciidoc names" do
|
518
|
+
input = <<~INPUT
|
486
519
|
#{ASCIIDOC_BLANK_HDR}
|
487
|
-
|
520
|
+
|
488
521
|
[[ABC]]
|
489
522
|
[CAUTION,type=Safety Precautions,keep-with-next="true",keep-lines-together="true"]
|
490
523
|
.Precautions
|
@@ -495,7 +528,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
495
528
|
. More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.
|
496
529
|
. Celery makes them sad.
|
497
530
|
====
|
498
|
-
|
531
|
+
INPUT
|
532
|
+
output = <<~OUTPUT
|
499
533
|
#{BLANK_HDR}
|
500
534
|
<sections>
|
501
535
|
<admonition id="ABC" type="safety precautions" keep-with-next="true" keep-lines-together="true">
|
@@ -514,11 +548,13 @@ RSpec.describe Asciidoctor::Standoc do
|
|
514
548
|
</sections>
|
515
549
|
</standard-document>
|
516
550
|
|
517
|
-
|
518
|
-
|
551
|
+
OUTPUT
|
552
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
553
|
+
.to be_equivalent_to xmlpp(output)
|
554
|
+
end
|
519
555
|
|
520
|
-
|
521
|
-
|
556
|
+
it "processes term examples" do
|
557
|
+
input = <<~INPUT
|
522
558
|
#{ASCIIDOC_BLANK_HDR}
|
523
559
|
== Terms and Definitions
|
524
560
|
|
@@ -527,26 +563,28 @@ RSpec.describe Asciidoctor::Standoc do
|
|
527
563
|
[[ABC]]
|
528
564
|
[example]
|
529
565
|
This is an example
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
<
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
<termexample id="ABC">
|
540
|
-
|
541
|
-
</termexample></term>
|
542
|
-
</terms>
|
543
|
-
</sections>
|
544
|
-
</standard-document>
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
566
|
+
INPUT
|
567
|
+
output = <<~OUTPUT
|
568
|
+
#{BLANK_HDR}
|
569
|
+
<sections>
|
570
|
+
<terms id="_" obligation="normative">
|
571
|
+
<title>Terms and definitions</title>
|
572
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
573
|
+
<term id="term-term1">
|
574
|
+
<preferred>Term1</preferred>
|
575
|
+
<termexample id="ABC">
|
576
|
+
<p id="_">This is an example</p>
|
577
|
+
</termexample></term>
|
578
|
+
</terms>
|
579
|
+
</sections>
|
580
|
+
</standard-document>
|
581
|
+
OUTPUT
|
582
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
583
|
+
.to be_equivalent_to xmlpp(output)
|
584
|
+
end
|
585
|
+
|
586
|
+
it "processes term examples as plain examples in nonterm clauses" do
|
587
|
+
input = <<~INPUT
|
550
588
|
#{ASCIIDOC_BLANK_HDR}
|
551
589
|
== Terms and Definitions
|
552
590
|
|
@@ -555,26 +593,29 @@ RSpec.describe Asciidoctor::Standoc do
|
|
555
593
|
|
556
594
|
[example]
|
557
595
|
This is an example
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
<
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
</
|
569
|
-
</
|
570
|
-
</
|
571
|
-
</
|
572
|
-
</
|
573
|
-
|
574
|
-
|
596
|
+
INPUT
|
597
|
+
output = <<~OUTPUT
|
598
|
+
#{BLANK_HDR}
|
599
|
+
<sections>
|
600
|
+
<terms id="_" obligation="normative">
|
601
|
+
<title>Terms and definitions</title>
|
602
|
+
<p id="_">No terms and definitions are listed in this document.</p>
|
603
|
+
<clause id="_" inline-header="false" obligation="normative">
|
604
|
+
<title>Term1</title>
|
605
|
+
<example id="_">
|
606
|
+
<p id="_">This is an example</p>
|
607
|
+
</example>
|
608
|
+
</clause>
|
609
|
+
</terms>
|
610
|
+
</sections>
|
611
|
+
</standard-document>
|
612
|
+
OUTPUT
|
613
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
614
|
+
.to be_equivalent_to xmlpp(output)
|
615
|
+
end
|
575
616
|
|
576
617
|
it "processes term examples as plain examples in definitions subclauses of terms & definitions" do
|
577
|
-
|
618
|
+
input = <<~INPUT
|
578
619
|
#{ASCIIDOC_BLANK_HDR}
|
579
620
|
== Terms and Definitions
|
580
621
|
|
@@ -584,27 +625,29 @@ RSpec.describe Asciidoctor::Standoc do
|
|
584
625
|
|
585
626
|
[example]
|
586
627
|
This is an example
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
<
|
592
|
-
|
593
|
-
</
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
</
|
599
|
-
</
|
600
|
-
</
|
601
|
-
</
|
602
|
-
|
628
|
+
INPUT
|
629
|
+
output = <<~OUTPUT
|
630
|
+
#{BLANK_HDR}
|
631
|
+
<sections>
|
632
|
+
<terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
|
633
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p><term id="term-term1">
|
634
|
+
<preferred>Term1</preferred>
|
635
|
+
</term>
|
636
|
+
<definitions id="_" obligation="normative" type="symbols">
|
637
|
+
<title>Symbols</title>
|
638
|
+
<example id="_">
|
639
|
+
<p id="_">This is an example</p>
|
640
|
+
</example>
|
641
|
+
</definitions></terms>
|
642
|
+
</sections>
|
643
|
+
</standard-document>
|
644
|
+
OUTPUT
|
645
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
646
|
+
.to be_equivalent_to xmlpp(output)
|
603
647
|
end
|
604
648
|
|
605
|
-
|
606
|
-
|
607
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
649
|
+
it "processes examples" do
|
650
|
+
input = <<~INPUT
|
608
651
|
#{ASCIIDOC_BLANK_HDR}
|
609
652
|
|
610
653
|
[[ABC]]
|
@@ -625,7 +668,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
625
668
|
====
|
626
669
|
This is yet another example
|
627
670
|
====
|
628
|
-
|
671
|
+
INPUT
|
672
|
+
output = <<~OUTPUT
|
629
673
|
#{BLANK_HDR}
|
630
674
|
<sections>
|
631
675
|
<example id="ABC" subsequence="A" keep-with-next='true' keep-lines-together='next'>
|
@@ -636,16 +680,19 @@ RSpec.describe Asciidoctor::Standoc do
|
|
636
680
|
<example id="_" number="3"><p id="_">This is yet another example</p></example>
|
637
681
|
</sections>
|
638
682
|
</standard-document>
|
639
|
-
|
640
|
-
|
683
|
+
OUTPUT
|
684
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
685
|
+
.to be_equivalent_to xmlpp(output)
|
686
|
+
end
|
641
687
|
|
642
|
-
|
643
|
-
|
688
|
+
it "processes preambles" do
|
689
|
+
input = <<~INPUT
|
644
690
|
#{ASCIIDOC_BLANK_HDR}
|
645
691
|
This is a preamble
|
646
692
|
|
647
693
|
== Section 1
|
648
|
-
|
694
|
+
INPUT
|
695
|
+
output = <<~OUTPUT
|
649
696
|
#{BLANK_HDR}
|
650
697
|
<preface><foreword id="_" obligation="informative">
|
651
698
|
<title>Foreword</title>
|
@@ -655,17 +702,20 @@ RSpec.describe Asciidoctor::Standoc do
|
|
655
702
|
<title>Section 1</title>
|
656
703
|
</clause></sections>
|
657
704
|
</standard-document>
|
658
|
-
|
659
|
-
|
705
|
+
OUTPUT
|
706
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
707
|
+
.to be_equivalent_to xmlpp(output)
|
708
|
+
end
|
660
709
|
|
661
|
-
|
662
|
-
|
710
|
+
it "processes preambles with titles" do
|
711
|
+
input = <<~INPUT
|
663
712
|
#{ASCIIDOC_BLANK_HDR}
|
664
713
|
.Preamble
|
665
714
|
This is a preamble
|
666
715
|
|
667
716
|
== Section 1
|
668
|
-
|
717
|
+
INPUT
|
718
|
+
output = <<~OUTPUT
|
669
719
|
#{BLANK_HDR}
|
670
720
|
<preface><foreword id="_" obligation="informative">
|
671
721
|
<title>Foreword</title>
|
@@ -675,11 +725,13 @@ RSpec.describe Asciidoctor::Standoc do
|
|
675
725
|
<title>Section 1</title>
|
676
726
|
</clause></sections>
|
677
727
|
</standard-document>
|
678
|
-
|
679
|
-
|
728
|
+
OUTPUT
|
729
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
730
|
+
.to be_equivalent_to xmlpp(output)
|
731
|
+
end
|
680
732
|
|
681
733
|
it "processes subfigures" do
|
682
|
-
|
734
|
+
input = <<~INPUT
|
683
735
|
#{ASCIIDOC_BLANK_HDR}
|
684
736
|
[[figureC-2]]
|
685
737
|
.Stages of gelatinization
|
@@ -694,27 +746,30 @@ RSpec.describe Asciidoctor::Standoc do
|
|
694
746
|
image::spec/examples/rice_images/rice_image3_3.png[]
|
695
747
|
====
|
696
748
|
INPUT
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
749
|
+
output = <<~OUTPUT
|
750
|
+
#{BLANK_HDR}
|
751
|
+
<sections>
|
752
|
+
<figure id="figureC-2"><name>Stages of gelatinization</name><figure id="_">
|
753
|
+
<name>Initial stages: No grains are fully gelatinized (ungelatinized starch granules are visible inside the kernels)</name>
|
754
|
+
<image src="spec/examples/rice_images/rice_image3_1.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
755
|
+
</figure>
|
756
|
+
<figure id="_">
|
757
|
+
<name>Intermediate stages: Some fully gelatinized kernels are visible</name>
|
758
|
+
<image src="spec/examples/rice_images/rice_image3_2.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
759
|
+
</figure>
|
760
|
+
<figure id="_">
|
761
|
+
<name>Final stages: All kernels are fully gelatinized</name>
|
762
|
+
<image src="spec/examples/rice_images/rice_image3_3.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
763
|
+
</figure></figure>
|
764
|
+
</sections>
|
765
|
+
</standard-document>
|
713
766
|
OUTPUT
|
767
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
768
|
+
.to be_equivalent_to xmlpp(output)
|
714
769
|
end
|
715
770
|
|
716
|
-
|
717
|
-
|
771
|
+
it "processes figures within examples" do
|
772
|
+
input = <<~INPUT
|
718
773
|
#{ASCIIDOC_BLANK_HDR}
|
719
774
|
[[figureC-2]]
|
720
775
|
.Stages of gelatinization
|
@@ -731,29 +786,31 @@ RSpec.describe Asciidoctor::Standoc do
|
|
731
786
|
image::spec/examples/rice_images/rice_image3_3.png[]
|
732
787
|
====
|
733
788
|
INPUT
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
789
|
+
output = <<~OUTPUT
|
790
|
+
#{BLANK_HDR}
|
791
|
+
<sections>
|
792
|
+
<example id="figureC-2"><name>Stages of gelatinization</name><figure id="_">
|
793
|
+
<name>Initial stages: No grains are fully gelatinized (ungelatinized starch granules are visible inside the kernels)</name>
|
794
|
+
<image src="spec/examples/rice_images/rice_image3_1.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
795
|
+
</figure>
|
796
|
+
<p id="_">Text</p>
|
797
|
+
<figure id="_">
|
798
|
+
<name>Intermediate stages: Some fully gelatinized kernels are visible</name>
|
799
|
+
<image src="spec/examples/rice_images/rice_image3_2.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
800
|
+
</figure>
|
801
|
+
<figure id="_">
|
802
|
+
<name>Final stages: All kernels are fully gelatinized</name>
|
803
|
+
<image src="spec/examples/rice_images/rice_image3_3.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
804
|
+
</figure></example>
|
805
|
+
</sections>
|
806
|
+
</standard-document>
|
751
807
|
OUTPUT
|
808
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
809
|
+
.to be_equivalent_to xmlpp(output)
|
752
810
|
end
|
753
811
|
|
754
|
-
|
755
|
-
|
756
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
812
|
+
it "processes images" do
|
813
|
+
input = <<~INPUT
|
757
814
|
#{ASCIIDOC_BLANK_HDR}
|
758
815
|
|
759
816
|
[[ABC]]
|
@@ -761,7 +818,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
761
818
|
.Split-it-right sample divider
|
762
819
|
image::spec/examples/rice_images/rice_image1.png[alttext]
|
763
820
|
|
764
|
-
|
821
|
+
INPUT
|
822
|
+
output = <<~OUTPUT
|
765
823
|
#{BLANK_HDR}
|
766
824
|
<sections>
|
767
825
|
<figure id="ABC" unnumbered="true" number="3">
|
@@ -770,17 +828,20 @@ RSpec.describe Asciidoctor::Standoc do
|
|
770
828
|
</figure>
|
771
829
|
</sections>
|
772
830
|
</standard-document>
|
773
|
-
|
774
|
-
|
831
|
+
OUTPUT
|
832
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
833
|
+
.to be_equivalent_to xmlpp(output)
|
834
|
+
end
|
775
835
|
|
776
|
-
|
777
|
-
|
836
|
+
it "processes data URI images" do
|
837
|
+
input = <<~INPUT
|
778
838
|
#{ASCIIDOC_BLANK_HDR}
|
779
839
|
[subsequence=A]
|
780
840
|
.Split-it-right sample divider
|
781
841
|
image::data:image/*;base64,iVBORw0KGgoAAAANSUhEUgAAAM4AAAAjCAYAAADcxTWYAAAAAXNSR0IArs4c6QAAExZJREFUeAHtnQmYVcWVx6t3oGn2xRVwQUEQIiKi0YgGVNxmjBCXQcOHkTiaxIwy6mSMqKhJXJKMcUky7kZjBDUoKsEIqIggLsEFUFFAFGSHpmm2Xub3v30LDuW7bwEUP+ed7/u9OudU3br3VtWpqnvfoykYdN2zbgekEccOgZOhNzSHDTAbJsBfYS5sl2wsLHVF9bXu5x/e4w6oWuBWl1RsVz35g3ZtC7TYvNZ90LSju7Hz+a62oMiV1W3atRe0E85evAN1DOLY38GeQR0a3W3hO3A93AL/CXnJt8A3pgUKt/NOruG40WCDZjn2HPgErIzAmAQ7EqS2vryeb4Fd3gLbEzjncdUjzZVPQz8DOkBX6Ai94G7w0g/lOW/k0/9/LVDvClz9N+i2cw2cPbj3B8z9/x79CHgC1hv/W+gXwCnG1x/9QmNnVNXYRfV1rhF7YukZZBj5U+EhaJahbD77K2wBhUxdQSHPN8Wu8Ivho628+u2aFJfUHt898DLcCV+bh9xct092pZnEjfwU0skzZJ4JekkguRm0EtXIyCQl9TXRC4GlpS1dl7Xz3OrSC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eVnPWmthLmhndS4cC1UQ7fuVZit6PvEyzStxqm2KHgYVWE1in01GY/SIHWeSvm4zU+l1Tj8OXBH9MPCJ3Y9z5y582s0r3zubL0BTVZf35VsgqQUeJUNINOm3BD3GaBe1Br4gua44ijgvL3slTvWM41ed8iBP5hPGp1d5WZ1brzHbblrtHtnrJDeTf/3ZZuOqbZY5U2dezbfAzmiBDVSixxC9sUwZNDpJVoNXBRGtJP75RrbfekmXKHD8S4FUK84s8vU6VNIaCiItw4e2Zs35YeDy0hbuyd378Xsn/tJN6j9KmKGmfHa+BXZeC+QSOHrDMjU+9W9Jw1eT2hPaFUffa4TSH8dI6AeqLyvRS4Fm/OxmCX/dRv/Vh4InL/kW2JUtoH1ctqLRegzotfI/Ew7SqiNpCtqu6dttK/MwrrOOXPRS/nSq/vZwbXaLVS5V58vmWyCnFshlxVHFNZAUNMr3zzbaqqVacVRmuyXFjzu3u678gfkW2JEWyDVwMp3rLgqsAr2h+Kq+dMx0Tfn8fAvs9Bb4P/RCZMfd+bNlAAAAAElFTkSuQmCC[alttext]
|
782
842
|
|
783
|
-
|
843
|
+
INPUT
|
844
|
+
output = <<~OUTPUT
|
784
845
|
#{BLANK_HDR}
|
785
846
|
<sections>
|
786
847
|
<figure id="_" subsequence="A">
|
@@ -789,17 +850,20 @@ RSpec.describe Asciidoctor::Standoc do
|
|
789
850
|
</figure>
|
790
851
|
</sections>
|
791
852
|
</standard-document>
|
792
|
-
|
793
|
-
|
853
|
+
OUTPUT
|
854
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
855
|
+
.to be_equivalent_to xmlpp(output)
|
856
|
+
end
|
794
857
|
|
795
|
-
|
796
|
-
|
858
|
+
it "accepts attributes on images" do
|
859
|
+
input = <<~INPUT
|
797
860
|
#{ASCIIDOC_BLANK_HDR}
|
798
861
|
[height=4,width=3,alt="IMAGE",filename="riceimg1.png",titleattr="TITLE"]
|
799
862
|
.Caption
|
800
863
|
image::spec/examples/rice_images/rice_image1.png[]
|
801
864
|
|
802
|
-
|
865
|
+
INPUT
|
866
|
+
output = <<~OUTPUT
|
803
867
|
#{BLANK_HDR}
|
804
868
|
<sections>
|
805
869
|
<figure id="_"><name>Caption</name>
|
@@ -807,16 +871,19 @@ RSpec.describe Asciidoctor::Standoc do
|
|
807
871
|
</figure>
|
808
872
|
</sections>
|
809
873
|
</standard-document>
|
810
|
-
|
811
|
-
|
874
|
+
OUTPUT
|
875
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
876
|
+
.to be_equivalent_to xmlpp(output)
|
877
|
+
end
|
812
878
|
|
813
|
-
|
814
|
-
|
879
|
+
it "accepts auto for width and height attributes on images" do
|
880
|
+
input = <<~INPUT
|
815
881
|
#{ASCIIDOC_BLANK_HDR}
|
816
882
|
[height=4,width=auto]
|
817
883
|
image::spec/examples/rice_images/rice_image1.png[]
|
818
884
|
|
819
|
-
|
885
|
+
INPUT
|
886
|
+
output = <<~OUTPUT
|
820
887
|
#{BLANK_HDR}
|
821
888
|
<sections>
|
822
889
|
<figure id="_">
|
@@ -824,25 +891,30 @@ RSpec.describe Asciidoctor::Standoc do
|
|
824
891
|
</figure>
|
825
892
|
</sections>
|
826
893
|
</standard-document>
|
827
|
-
|
828
|
-
|
894
|
+
OUTPUT
|
895
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
896
|
+
.to be_equivalent_to xmlpp(output)
|
897
|
+
end
|
829
898
|
|
830
|
-
|
831
|
-
|
899
|
+
it "processes inline images with width and height attributes on images" do
|
900
|
+
input = <<~INPUT
|
832
901
|
#{ASCIIDOC_BLANK_HDR}
|
833
902
|
Hello image:spec/examples/rice_images/rice_image1.png[alt, 4, 3], how are you?
|
834
903
|
|
835
|
-
|
904
|
+
INPUT
|
905
|
+
output = <<~OUTPUT
|
836
906
|
#{BLANK_HDR}
|
837
907
|
<sections>
|
838
908
|
<p id="_">Hello <image src="spec/examples/rice_images/rice_image1.png" id="_" mimetype="image/png" height="3" width="4" alt="alt"/>, how are you?</p>
|
839
909
|
</sections>
|
840
910
|
</standard-document>
|
841
|
-
|
842
|
-
|
911
|
+
OUTPUT
|
912
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
913
|
+
.to be_equivalent_to xmlpp(output)
|
914
|
+
end
|
843
915
|
|
844
|
-
|
845
|
-
|
916
|
+
it "processes images as datauri" do
|
917
|
+
input = <<~INPUT
|
846
918
|
= Document title
|
847
919
|
Author
|
848
920
|
:docfile: test.adoc
|
@@ -853,25 +925,30 @@ RSpec.describe Asciidoctor::Standoc do
|
|
853
925
|
|
854
926
|
.Split-it-right sample divider
|
855
927
|
image::spec/examples/rice_images/rice_image1.png[]
|
856
|
-
|
857
|
-
|
928
|
+
INPUT
|
929
|
+
expect(strip_guid(Asciidoctor.convert(input, *OPTIONS)))
|
930
|
+
.to include '<image src="data:image/png;base64'
|
931
|
+
end
|
858
932
|
|
859
|
-
|
860
|
-
|
933
|
+
it "accepts attributes on paragraphs" do
|
934
|
+
input = <<~INPUT
|
861
935
|
#{ASCIIDOC_BLANK_HDR}
|
862
936
|
[align=right,keep-with-next=true,keep-lines-together=true]
|
863
937
|
This para is right-aligned.
|
864
|
-
|
938
|
+
INPUT
|
939
|
+
output = <<~OUTPUT
|
865
940
|
#{BLANK_HDR}
|
866
941
|
<sections>
|
867
942
|
<p align="right" id="_" keep-with-next="true" keep-lines-together="true">This para is right-aligned.</p>
|
868
943
|
</sections>
|
869
944
|
</standard-document>
|
870
|
-
|
871
|
-
|
945
|
+
OUTPUT
|
946
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
947
|
+
.to be_equivalent_to xmlpp(output)
|
948
|
+
end
|
872
949
|
|
873
|
-
|
874
|
-
|
950
|
+
it "processes blockquotes" do
|
951
|
+
input = <<~INPUT
|
875
952
|
#{ASCIIDOC_BLANK_HDR}
|
876
953
|
|
877
954
|
[[ABC]]
|
@@ -879,7 +956,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
879
956
|
____
|
880
957
|
Block quotation
|
881
958
|
____
|
882
|
-
|
959
|
+
INPUT
|
960
|
+
output = <<~OUTPUT
|
883
961
|
#{BLANK_HDR}
|
884
962
|
<sections>
|
885
963
|
<quote id="ABC" align="right" keep-with-next="true" keep-lines-together="true">
|
@@ -893,13 +971,15 @@ RSpec.describe Asciidoctor::Standoc do
|
|
893
971
|
</quote>
|
894
972
|
</sections>
|
895
973
|
</standard-document>
|
896
|
-
|
897
|
-
|
974
|
+
OUTPUT
|
975
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
976
|
+
.to be_equivalent_to xmlpp(output)
|
977
|
+
end
|
898
978
|
|
899
|
-
|
900
|
-
|
979
|
+
it "processes source code" do
|
980
|
+
input = <<~INPUT
|
901
981
|
#{ASCIIDOC_BLANK_HDR}
|
902
|
-
|
982
|
+
|
903
983
|
[[ABC]]
|
904
984
|
.Caption
|
905
985
|
[source%unnumbered,ruby,number=3,filename=sourcecode1.rb,keep-with-next=true,keep-lines-together=true]
|
@@ -909,7 +989,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
909
989
|
puts x
|
910
990
|
end
|
911
991
|
--
|
912
|
-
|
992
|
+
INPUT
|
993
|
+
output = <<~OUTPUT
|
913
994
|
#{BLANK_HDR}
|
914
995
|
<sections>
|
915
996
|
<sourcecode id="ABC" lang="ruby" filename="sourcecode1.rb" unnumbered="true" number="3" keep-with-next="true" keep-lines-together="true">
|
@@ -919,11 +1000,13 @@ RSpec.describe Asciidoctor::Standoc do
|
|
919
1000
|
end</sourcecode>
|
920
1001
|
</sections>
|
921
1002
|
</standard-document>
|
922
|
-
|
923
|
-
|
1003
|
+
OUTPUT
|
1004
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1005
|
+
.to be_equivalent_to xmlpp(output)
|
1006
|
+
end
|
924
1007
|
|
925
|
-
|
926
|
-
|
1008
|
+
it "processes callouts" do
|
1009
|
+
input = <<~INPUT
|
927
1010
|
#{ASCIIDOC_BLANK_HDR}
|
928
1011
|
[source,ruby]
|
929
1012
|
--
|
@@ -934,7 +1017,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
934
1017
|
--
|
935
1018
|
<1> This is one callout
|
936
1019
|
<2> This is another callout
|
937
|
-
|
1020
|
+
INPUT
|
1021
|
+
output = <<~OUTPUT
|
938
1022
|
#{BLANK_HDR}
|
939
1023
|
<sections><sourcecode id="_" lang="ruby">puts "Hello, world." <callout target="_">1</callout>
|
940
1024
|
%w{a b c}.each do |x|
|
@@ -946,11 +1030,13 @@ RSpec.describe Asciidoctor::Standoc do
|
|
946
1030
|
</annotation></sourcecode>
|
947
1031
|
</sections>
|
948
1032
|
</standard-document>
|
949
|
-
|
950
|
-
|
1033
|
+
OUTPUT
|
1034
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1035
|
+
.to be_equivalent_to xmlpp(output)
|
1036
|
+
end
|
951
1037
|
|
952
|
-
|
953
|
-
|
1038
|
+
it "processes unmodified term sources" do
|
1039
|
+
input = <<~INPUT
|
954
1040
|
#{ASCIIDOC_BLANK_HDR}
|
955
1041
|
== Terms and Definitions
|
956
1042
|
|
@@ -974,58 +1060,61 @@ RSpec.describe Asciidoctor::Standoc do
|
|
974
1060
|
|
975
1061
|
[.source]
|
976
1062
|
{{IEV:xyz,t1,t2}}
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
</
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1063
|
+
INPUT
|
1064
|
+
output = <<~OUTPUT
|
1065
|
+
#{BLANK_HDR}
|
1066
|
+
<sections>
|
1067
|
+
<terms id="_" obligation="normative">
|
1068
|
+
<title>Terms and definitions</title><p id="_">For the purposes of this document,
|
1069
|
+
the following terms and definitions apply.</p>
|
1070
|
+
<term id="term-term1">
|
1071
|
+
<preferred>Term1</preferred>
|
1072
|
+
<termsource status="identical">
|
1073
|
+
<origin bibitemid="ISO2191" type="inline" citeas="">
|
1074
|
+
<localityStack>
|
1075
|
+
<locality type="section"><referenceFrom>1</referenceFrom></locality>
|
1076
|
+
</localityStack>
|
1077
|
+
</origin>
|
1078
|
+
</termsource>
|
1079
|
+
<termsource status="identical">
|
1080
|
+
<origin bibitemid="ISO2191" type="inline" citeas="" case='capital' droploc='true'>
|
1081
|
+
<localityStack>
|
1082
|
+
<locality type="section"><referenceFrom>1</referenceFrom></locality>
|
1083
|
+
</localityStack>
|
1084
|
+
</origin>
|
1085
|
+
</termsource>
|
1086
|
+
</term>
|
1087
|
+
<term id='term-term2'>
|
1088
|
+
<preferred>Term2</preferred>
|
1089
|
+
<definition>
|
1090
|
+
<p id='_'>Definition</p>
|
1091
|
+
</definition>
|
1092
|
+
<termsource status='identical'>
|
1093
|
+
<origin citeas=''>
|
1094
|
+
<termref base='IEV' target='xyz'/>
|
1095
|
+
</origin>
|
1096
|
+
</termsource>
|
1097
|
+
<termsource status='identical'>
|
1098
|
+
<origin citeas=''>
|
1099
|
+
<termref base='IEV' target='xyz'>t1</termref>
|
1100
|
+
</origin>
|
1101
|
+
</termsource>
|
1102
|
+
<termsource status='identical'>
|
1103
|
+
<origin citeas=''>
|
1104
|
+
<termref base='IEV' target='xyz'>t1</termref>
|
1105
|
+
</origin>
|
1106
|
+
</termsource>
|
1107
|
+
</term>
|
1108
|
+
</terms>
|
1109
|
+
</sections>
|
1110
|
+
</standard-document>
|
1111
|
+
OUTPUT
|
1112
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1113
|
+
.to be_equivalent_to xmlpp(output)
|
1114
|
+
end
|
1026
1115
|
|
1027
|
-
|
1028
|
-
|
1116
|
+
it "processes modified term sources" do
|
1117
|
+
input = <<~INPUT
|
1029
1118
|
#{ASCIIDOC_BLANK_HDR}
|
1030
1119
|
== Terms and Definitions
|
1031
1120
|
|
@@ -1040,47 +1129,50 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1040
1129
|
|
1041
1130
|
[.source]
|
1042
1131
|
{{IEV:xyz}}, with adjustments
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
</
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1132
|
+
INPUT
|
1133
|
+
output = <<~OUTPUT
|
1134
|
+
#{BLANK_HDR}
|
1135
|
+
<sections>
|
1136
|
+
<terms id="_" obligation="normative">
|
1137
|
+
<title>Terms and definitions</title>
|
1138
|
+
<p id="_">For the purposes of this document,
|
1139
|
+
the following terms and definitions apply.</p>
|
1140
|
+
<term id="term-term1">
|
1141
|
+
<preferred>Term1</preferred>
|
1142
|
+
<termsource status="modified">
|
1143
|
+
<origin bibitemid="ISO2191" type="inline" citeas="">
|
1144
|
+
<localityStack>
|
1145
|
+
<locality type="section"><referenceFrom>1</referenceFrom></locality>
|
1146
|
+
</localityStack>
|
1147
|
+
</origin>
|
1148
|
+
<modification>
|
1149
|
+
<p id="_">with adjustments</p>
|
1150
|
+
</modification>
|
1151
|
+
</termsource>
|
1152
|
+
</term>
|
1153
|
+
<term id='term-term2'>
|
1154
|
+
<preferred>Term2</preferred>
|
1155
|
+
<definition>
|
1156
|
+
<p id='_'>Definition</p>
|
1157
|
+
</definition>
|
1158
|
+
<termsource status='modified'>
|
1159
|
+
<origin citeas=''>
|
1160
|
+
<termref base='IEV' target='xyz'/>
|
1161
|
+
</origin>
|
1162
|
+
<modification>
|
1163
|
+
<p id='_'>with adjustments</p>
|
1164
|
+
</modification>
|
1165
|
+
</termsource>
|
1166
|
+
</term>
|
1167
|
+
</terms>
|
1168
|
+
</sections>
|
1169
|
+
</standard-document>
|
1170
|
+
OUTPUT
|
1171
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1172
|
+
.to be_equivalent_to xmlpp(output)
|
1173
|
+
end
|
1082
1174
|
|
1083
|
-
|
1175
|
+
it "processes recommendation" do
|
1084
1176
|
input = <<~"INPUT"
|
1085
1177
|
#{ASCIIDOC_BLANK_HDR}
|
1086
1178
|
[.recommendation,label="/ogc/recommendation/wfs/2",subject="user",inherit="/ss/584/2015/level/1; /ss/584/2015/level/2",options="unnumbered",type=verification,model=ogc]
|
@@ -1088,24 +1180,25 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1088
1180
|
I recommend this
|
1089
1181
|
====
|
1090
1182
|
INPUT
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
<subject>user</subject>
|
1097
|
-
<inherit>/ss/584/2015/level/1</inherit>
|
1098
|
-
<inherit>/ss/584/2015/level/2</inherit>
|
1099
|
-
|
1100
|
-
</recommendation>
|
1101
|
-
|
1102
|
-
|
1183
|
+
output = <<~"OUTPUT"
|
1184
|
+
#{BLANK_HDR}
|
1185
|
+
<sections>
|
1186
|
+
<recommendation id="_" unnumbered="true" type="verification" model="ogc">
|
1187
|
+
<label>/ogc/recommendation/wfs/2</label>
|
1188
|
+
<subject>user</subject>
|
1189
|
+
<inherit>/ss/584/2015/level/1</inherit>
|
1190
|
+
<inherit>/ss/584/2015/level/2</inherit>
|
1191
|
+
<description><p id="_">I recommend this</p></description>
|
1192
|
+
</recommendation>
|
1193
|
+
</sections>
|
1194
|
+
</standard-document>
|
1103
1195
|
OUTPUT
|
1104
1196
|
|
1105
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input,
|
1197
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1198
|
+
.to be_equivalent_to xmlpp(output)
|
1106
1199
|
end
|
1107
1200
|
|
1108
|
-
|
1201
|
+
it "processes requirement" do
|
1109
1202
|
input = <<~"INPUT"
|
1110
1203
|
#{ASCIIDOC_BLANK_HDR}
|
1111
1204
|
[[ABC]]
|
@@ -1115,22 +1208,23 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1115
1208
|
I recommend this
|
1116
1209
|
====
|
1117
1210
|
INPUT
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
</requirement>
|
1126
|
-
|
1127
|
-
|
1211
|
+
output = <<~OUTPUT
|
1212
|
+
#{BLANK_HDR}
|
1213
|
+
<sections>
|
1214
|
+
<requirement id="ABC" subsequence="A" number="3" keep-with-next="true" keep-lines-together="true">
|
1215
|
+
<title>Title</title>
|
1216
|
+
<inherit>/ss/584/2015/level/1 & /ss/584/2015/level/2</inherit>
|
1217
|
+
<description><p id="_">I recommend this</p></description>
|
1218
|
+
</requirement>
|
1219
|
+
</sections>
|
1220
|
+
</standard-document>
|
1128
1221
|
OUTPUT
|
1129
1222
|
|
1130
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input,
|
1223
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1224
|
+
.to be_equivalent_to xmlpp(output)
|
1131
1225
|
end
|
1132
1226
|
|
1133
|
-
|
1227
|
+
it "processes permission" do
|
1134
1228
|
input = <<~"INPUT"
|
1135
1229
|
#{ASCIIDOC_BLANK_HDR}
|
1136
1230
|
|
@@ -1140,21 +1234,21 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1140
1234
|
I recommend this
|
1141
1235
|
====
|
1142
1236
|
INPUT
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
</permission>
|
1149
|
-
|
1150
|
-
|
1237
|
+
output = <<~"OUTPUT"
|
1238
|
+
#{BLANK_HDR}
|
1239
|
+
<sections>
|
1240
|
+
<permission id="ABC">
|
1241
|
+
<description><p id="_">I recommend this</p></description>
|
1242
|
+
</permission>
|
1243
|
+
</sections>
|
1244
|
+
</standard-document>
|
1151
1245
|
OUTPUT
|
1152
1246
|
|
1153
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input,
|
1247
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1248
|
+
.to be_equivalent_to xmlpp(output)
|
1154
1249
|
end
|
1155
1250
|
|
1156
|
-
|
1157
|
-
it "processes nested permissions" do
|
1251
|
+
it "processes nested permissions" do
|
1158
1252
|
input = <<~"INPUT"
|
1159
1253
|
#{ASCIIDOC_BLANK_HDR}
|
1160
1254
|
[.permission]
|
@@ -1171,24 +1265,25 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1171
1265
|
=====
|
1172
1266
|
====
|
1173
1267
|
INPUT
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
<example id="_">
|
1179
|
-
|
1180
|
-
</example></description>
|
1181
|
-
<permission id="_">
|
1182
|
-
|
1183
|
-
</permission></permission>
|
1184
|
-
</sections>
|
1185
|
-
</standard-document>
|
1268
|
+
output = <<~"OUTPUT"
|
1269
|
+
#{BLANK_HDR}
|
1270
|
+
<sections>
|
1271
|
+
<permission id="_"><description><p id="_">I permit this</p>
|
1272
|
+
<example id="_">
|
1273
|
+
<p id="_">Example 2</p>
|
1274
|
+
</example></description>
|
1275
|
+
<permission id="_">
|
1276
|
+
<description><p id="_">I also permit this</p></description>
|
1277
|
+
</permission></permission>
|
1278
|
+
</sections>
|
1279
|
+
</standard-document>
|
1186
1280
|
OUTPUT
|
1187
1281
|
|
1188
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input,
|
1282
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1283
|
+
.to be_equivalent_to xmlpp(output)
|
1189
1284
|
end
|
1190
1285
|
|
1191
|
-
|
1286
|
+
it "processes recommendation with internal markup of structure" do
|
1192
1287
|
input = <<~"INPUT"
|
1193
1288
|
#{ASCIIDOC_BLANK_HDR}
|
1194
1289
|
|
@@ -1204,7 +1299,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1204
1299
|
|Object |Value
|
1205
1300
|
|Mission | Accomplished
|
1206
1301
|
|===
|
1207
|
-
--
|
1302
|
+
--
|
1208
1303
|
|
1209
1304
|
As for the measurement targets,
|
1210
1305
|
|
@@ -1229,7 +1324,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1229
1324
|
end
|
1230
1325
|
----
|
1231
1326
|
--
|
1232
|
-
|
1327
|
+
|
1233
1328
|
[.import%exclude]
|
1234
1329
|
--
|
1235
1330
|
[source,CoreRoot]
|
@@ -1239,167 +1334,167 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1239
1334
|
--
|
1240
1335
|
====
|
1241
1336
|
INPUT
|
1242
|
-
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
<classification><tag>control-class</tag><value>Technical</value></classification><classification><tag>priority</tag><value>P0</value></classification><classification><tag>family</tag><value>System & Communications Protection</value></classification><classification><tag>family</tag><value>System and Communications Protocols</value></classification>
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1253
|
-
</mrow>
|
1254
|
-
<mrow>
|
1255
|
-
|
1256
|
-
</mrow>
|
1257
|
-
</mfrac><mo>=</mo><mn>0</mn></math></stem></formula></measurement-target>
|
1258
|
-
|
1259
|
-
if (success)
|
1260
|
-
|
1261
|
-
end</sourcecode></verification>
|
1262
|
-
|
1263
|
-
|
1264
|
-
|
1337
|
+
output = <<~"OUTPUT"
|
1338
|
+
#{BLANK_HDR}
|
1339
|
+
<sections>
|
1340
|
+
<recommendation id="ABC" obligation="permission,recommendation" filename="reqt1.rq"><label>/ogc/recommendation/wfs/2</label><subject>user</subject>
|
1341
|
+
<classification><tag>control-class</tag><value>Technical</value></classification><classification><tag>priority</tag><value>P0</value></classification><classification><tag>family</tag><value>System & Communications Protection</value></classification><classification><tag>family</tag><value>System and Communications Protocols</value></classification>
|
1342
|
+
<description><p id="_">I recommend <em>this</em>.</p>
|
1343
|
+
</description><specification exclude="false" type="tabular" keep-with-next="true" keep-lines-together="true"><p id="_">This is the object of the recommendation:</p><table id="_"> <tbody> <tr> <td valign="top" align="left">Object</td> <td valign="top" align="left">Value</td> </tr> <tr> <td valign="top" align="left">Mission</td> <td valign="top" align="left">Accomplished</td> </tr> </tbody></table></specification><description>
|
1344
|
+
<p id="_">As for the measurement targets,</p>
|
1345
|
+
</description><measurement-target exclude="false"><p id="_">The measurement target shall be measured as:</p><formula id="_"> <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac>
|
1346
|
+
<mrow>
|
1347
|
+
<mi>r</mi>
|
1348
|
+
</mrow>
|
1349
|
+
<mrow>
|
1350
|
+
<mn>1</mn>
|
1351
|
+
</mrow>
|
1352
|
+
</mfrac><mo>=</mo><mn>0</mn></math></stem></formula></measurement-target>
|
1353
|
+
<verification exclude="false"><p id="_">The following code will be run for verification:</p><sourcecode lang="CoreRoot" id="_">CoreRoot(success): HttpResponse
|
1354
|
+
if (success)
|
1355
|
+
recommendation(label: success-response)
|
1356
|
+
end</sourcecode></verification>
|
1357
|
+
<import exclude="true"> <sourcecode lang="CoreRoot" id="_">success-response()</sourcecode></import></recommendation>
|
1358
|
+
</sections>
|
1359
|
+
</standard-document>
|
1265
1360
|
OUTPUT
|
1266
1361
|
|
1267
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input,
|
1362
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1363
|
+
.to be_equivalent_to xmlpp(output)
|
1268
1364
|
end
|
1269
1365
|
|
1270
1366
|
it "processes delete change clauses" do
|
1271
1367
|
input = <<~"INPUT"
|
1272
|
-
#{ASCIIDOC_BLANK_HDR}
|
1273
|
-
[change="modify",locality="page=27",path="//table[2]",path_end="//table[2]/following-sibling:example[1]",title="Change"]
|
1274
|
-
==== Change Clause
|
1275
|
-
_This table contains information on polygon cells which are not included in ISO 10303-52. Remove table 2 completely and replace with:_
|
1276
|
-
INPUT
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1294
|
-
</sections>
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1368
|
+
#{ASCIIDOC_BLANK_HDR}
|
1369
|
+
[change="modify",locality="page=27",path="//table[2]",path_end="//table[2]/following-sibling:example[1]",title="Change"]
|
1370
|
+
==== Change Clause
|
1371
|
+
_This table contains information on polygon cells which are not included in ISO 10303-52. Remove table 2 completely and replace with:_
|
1372
|
+
INPUT
|
1373
|
+
output = <<~"OUTPUT"
|
1374
|
+
#{BLANK_HDR}
|
1375
|
+
<sections>
|
1376
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
1377
|
+
<title>Change Clause</title>
|
1378
|
+
<amend id='_' change='modify' path='//table[2]' path_end='//table[2]/following-sibling:example[1]' title='Change'>
|
1379
|
+
<description>
|
1380
|
+
<p id='_'>
|
1381
|
+
<em>
|
1382
|
+
This table contains information on polygon cells which are not
|
1383
|
+
included in ISO 10303-52. Remove table 2 completely and replace
|
1384
|
+
with:
|
1385
|
+
</em>
|
1386
|
+
</p>
|
1387
|
+
</description>
|
1388
|
+
</amend>
|
1389
|
+
</clause>
|
1390
|
+
</sections>
|
1391
|
+
</standard-document>
|
1392
|
+
OUTPUT
|
1393
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1394
|
+
.to be_equivalent_to xmlpp(output)
|
1299
1395
|
end
|
1300
1396
|
|
1301
1397
|
it "processes modify change clauses" do
|
1302
1398
|
input = <<~"INPUT"
|
1303
|
-
#{ASCIIDOC_BLANK_HDR}
|
1304
|
-
[change="modify",locality="page=27",path="//table[2]",path_end="//table[2]/following-sibling:example[1]",title="Change"]
|
1305
|
-
==== Change Clause
|
1399
|
+
#{ASCIIDOC_BLANK_HDR}
|
1400
|
+
[change="modify",locality="page=27",path="//table[2]",path_end="//table[2]/following-sibling:example[1]",title="Change"]
|
1401
|
+
==== Change Clause
|
1306
1402
|
|
1307
|
-
autonumber:table[2]
|
1308
|
-
autonumber:note[7]
|
1403
|
+
autonumber:table[2]
|
1404
|
+
autonumber:note[7]
|
1309
1405
|
|
1310
|
-
_This table contains information on polygon cells which are not included in ISO 10303-52. Remove table 2 completely and replace with:_
|
1406
|
+
_This table contains information on polygon cells which are not included in ISO 10303-52. Remove table 2 completely and replace with:_
|
1311
1407
|
|
1312
|
-
____
|
1313
|
-
.Edges of triangle and quadrilateral cells
|
1314
|
-
|===
|
1315
|
-
2+^.^h| triangle 2+^.^h| quadrilateral
|
1316
|
-
^.^| edge ^.^| vertices ^.^| edge ^.^| vertices
|
1317
|
-
^.^| 1 ^.^| 1, 2 ^.^| 1 ^.^| 1, 2
|
1318
|
-
^.^| 2 ^.^| 2, 3 ^.^| 2 ^.^| 2, 3
|
1319
|
-
^.^| 3 ^.^| 3, 1 ^.^| 3 ^.^| 3, 4
|
1320
|
-
| | ^.^| 4 ^.^| 4, 1
|
1321
|
-
|===
|
1408
|
+
____
|
1409
|
+
.Edges of triangle and quadrilateral cells
|
1410
|
+
|===
|
1411
|
+
2+^.^h| triangle 2+^.^h| quadrilateral
|
1412
|
+
^.^| edge ^.^| vertices ^.^| edge ^.^| vertices
|
1413
|
+
^.^| 1 ^.^| 1, 2 ^.^| 1 ^.^| 1, 2
|
1414
|
+
^.^| 2 ^.^| 2, 3 ^.^| 2 ^.^| 2, 3
|
1415
|
+
^.^| 3 ^.^| 3, 1 ^.^| 3 ^.^| 3, 4
|
1416
|
+
| | ^.^| 4 ^.^| 4, 1
|
1417
|
+
|===
|
1322
1418
|
|
1323
|
-
====
|
1324
|
-
This is not generalised further.
|
1325
|
-
====
|
1419
|
+
====
|
1420
|
+
This is not generalised further.
|
1421
|
+
====
|
1326
1422
|
|
1327
|
-
____
|
1423
|
+
____
|
1328
1424
|
|
1329
|
-
Any further exceptions can be ignored.
|
1425
|
+
Any further exceptions can be ignored.
|
1330
1426
|
INPUT
|
1331
1427
|
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
</description>
|
1396
|
-
|
1397
|
-
|
1398
|
-
</sections>
|
1399
|
-
|
1400
|
-
|
1401
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input,
|
1428
|
+
output = <<~"OUTPUT"
|
1429
|
+
#{BLANK_HDR}
|
1430
|
+
<sections>
|
1431
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
1432
|
+
<title>Change Clause</title>
|
1433
|
+
<amend id='_' change='modify' path='//table[2]' path_end='//table[2]/following-sibling:example[1]' title='Change'>
|
1434
|
+
<autonumber type='table'>2</autonumber>
|
1435
|
+
<autonumber type='note'>7</autonumber>
|
1436
|
+
<description>
|
1437
|
+
<p id='_'>
|
1438
|
+
<em>
|
1439
|
+
This table contains information on polygon cells which are not
|
1440
|
+
included in ISO 10303-52. Remove table 2 completely and replace
|
1441
|
+
with:
|
1442
|
+
</em>
|
1443
|
+
</p>
|
1444
|
+
</description>
|
1445
|
+
<newcontent id='_'>
|
1446
|
+
<table id='_'>
|
1447
|
+
<name>Edges of triangle and quadrilateral cells</name>
|
1448
|
+
<tbody>
|
1449
|
+
<tr>
|
1450
|
+
<th colspan='2' valign='middle' align='center'>triangle</th>
|
1451
|
+
<th colspan='2' valign='middle' align='center'>quadrilateral</th>
|
1452
|
+
</tr>
|
1453
|
+
<tr>
|
1454
|
+
<td valign='middle' align='center'>edge</td>
|
1455
|
+
<td valign='middle' align='center'>vertices</td>
|
1456
|
+
<td valign='middle' align='center'>edge</td>
|
1457
|
+
<td valign='middle' align='center'>vertices</td>
|
1458
|
+
</tr>
|
1459
|
+
<tr>
|
1460
|
+
<td valign='middle' align='center'>1</td>
|
1461
|
+
<td valign='middle' align='center'>1, 2</td>
|
1462
|
+
<td valign='middle' align='center'>1</td>
|
1463
|
+
<td valign='middle' align='center'>1, 2</td>
|
1464
|
+
</tr>
|
1465
|
+
<tr>
|
1466
|
+
<td valign='middle' align='center'>2</td>
|
1467
|
+
<td valign='middle' align='center'>2, 3</td>
|
1468
|
+
<td valign='middle' align='center'>2</td>
|
1469
|
+
<td valign='middle' align='center'>2, 3</td>
|
1470
|
+
</tr>
|
1471
|
+
<tr>
|
1472
|
+
<td valign='middle' align='center'>3</td>
|
1473
|
+
<td valign='middle' align='center'>3, 1</td>
|
1474
|
+
<td valign='middle' align='center'>3</td>
|
1475
|
+
<td valign='middle' align='center'>3, 4</td>
|
1476
|
+
</tr>
|
1477
|
+
<tr>
|
1478
|
+
<td valign='top' align='left'/>
|
1479
|
+
<td valign='top' align='left'/>
|
1480
|
+
<td valign='middle' align='center'>4</td>
|
1481
|
+
<td valign='middle' align='center'>4, 1</td>
|
1482
|
+
</tr>
|
1483
|
+
</tbody>
|
1484
|
+
</table>
|
1485
|
+
<example id='_'>
|
1486
|
+
<p id='_'>This is not generalised further.</p>
|
1487
|
+
</example>
|
1488
|
+
</newcontent>
|
1489
|
+
<description>
|
1490
|
+
<p id='_'>Any further exceptions can be ignored.</p>
|
1491
|
+
</description>
|
1492
|
+
</amend>
|
1493
|
+
</clause>
|
1494
|
+
</sections>
|
1495
|
+
</standard-document>
|
1496
|
+
OUTPUT
|
1497
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1498
|
+
.to be_equivalent_to xmlpp(output)
|
1402
1499
|
end
|
1403
|
-
|
1404
|
-
|
1405
1500
|
end
|