metanorma-standoc 1.9.1 → 1.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +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
@@ -16,37 +16,37 @@ RSpec.describe Asciidoctor::Standoc do
|
|
16
16
|
* [[[ref1,XYZ 123]]] _Title_
|
17
17
|
INPUT
|
18
18
|
#{BLANK_HDR}
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
</preface>
|
36
|
-
<sections> </sections>
|
37
|
-
<bibliography>
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
</bibliography>
|
49
|
-
|
19
|
+
<preface>
|
20
|
+
<foreword id='_' obligation='informative'>
|
21
|
+
<title>Foreword</title>
|
22
|
+
<admitted>term1</admitted>
|
23
|
+
<deprecates>term1</deprecates>
|
24
|
+
<domain>term1</domain>
|
25
|
+
<inherit>
|
26
|
+
<eref type='inline' bibitemid='ref1' citeas='XYZ 123'/>
|
27
|
+
</inherit>
|
28
|
+
<autonumber type='table'>3</autonumber>
|
29
|
+
<add>
|
30
|
+
a
|
31
|
+
<xref target='clause'/>
|
32
|
+
</add>
|
33
|
+
<del>B</del>
|
34
|
+
</foreword>
|
35
|
+
</preface>
|
36
|
+
<sections> </sections>
|
37
|
+
<bibliography>
|
38
|
+
<references id='_' obligation='informative' normative="false">
|
39
|
+
<title>Bibliography</title>
|
40
|
+
<bibitem id='ref1'>
|
41
|
+
<formattedref format='application/x-isodoc+xml'>
|
42
|
+
<em>Title</em>
|
43
|
+
</formattedref>
|
44
|
+
<docidentifier>XYZ 123</docidentifier>
|
45
|
+
<docnumber>123</docnumber>
|
46
|
+
</bibitem>
|
47
|
+
</references>
|
48
|
+
</bibliography>
|
49
|
+
</standard-document>
|
50
50
|
OUTPUT
|
51
51
|
end
|
52
52
|
|
@@ -67,55 +67,55 @@ RSpec.describe Asciidoctor::Standoc do
|
|
67
67
|
|
68
68
|
Text [[id3]]
|
69
69
|
INPUT
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
<index to="id2">
|
95
|
-
|
96
|
-
</index>
|
97
|
-
<em>P</em>
|
98
|
-
<index to="id3">
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
</index>
|
103
|
-
<index to="id3">
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
</index>
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
</standard-document>
|
70
|
+
#{BLANK_HDR}
|
71
|
+
<sections>
|
72
|
+
<p id='_'>
|
73
|
+
<index-xref also='true'>
|
74
|
+
<primary>B</primary>
|
75
|
+
<target>
|
76
|
+
C
|
77
|
+
<sub>x</sub>
|
78
|
+
</target>
|
79
|
+
</index-xref>
|
80
|
+
<index-xref also='false'>
|
81
|
+
<primary>D</primary>
|
82
|
+
<secondary>
|
83
|
+
<em>E</em>
|
84
|
+
</secondary>
|
85
|
+
<target>F</target>
|
86
|
+
</index-xref>
|
87
|
+
<index-xref also='true'>
|
88
|
+
<primary>G</primary>
|
89
|
+
<secondary>H</secondary>
|
90
|
+
<tertiary>I</tertiary>
|
91
|
+
<target>J</target>
|
92
|
+
</index-xref>
|
93
|
+
P
|
94
|
+
<index to="id2">
|
95
|
+
<primary>P</primary>
|
96
|
+
</index>
|
97
|
+
<em>P</em>
|
98
|
+
<index to="id3">
|
99
|
+
<primary>
|
100
|
+
<em>P</em>
|
101
|
+
</primary>
|
102
|
+
</index>
|
103
|
+
<index to="id3">
|
104
|
+
<primary>Q</primary>
|
105
|
+
<secondary>R</secondary>
|
106
|
+
<tertiary>S</tertiary>
|
107
|
+
</index>
|
108
|
+
</p>
|
109
|
+
<p id='_'>
|
110
|
+
Text
|
111
|
+
<bookmark id='id2'/>
|
112
|
+
</p>
|
113
|
+
<p id='_'>
|
114
|
+
Text
|
115
|
+
<bookmark id='id3'/>
|
116
|
+
</p>
|
117
|
+
</sections>
|
118
|
+
</standard-document>
|
119
119
|
OUTPUT
|
120
120
|
end
|
121
121
|
|
@@ -127,34 +127,33 @@ RSpec.describe Asciidoctor::Standoc do
|
|
127
127
|
this lang:en[English] lang:fr-Latn[Français] section is lang:en[silly] lang:fr[fou]
|
128
128
|
|
129
129
|
INPUT
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
</sections>
|
151
|
-
|
130
|
+
#{BLANK_HDR}
|
131
|
+
<sections>
|
132
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
133
|
+
<title>
|
134
|
+
<variant lang='en'>English</variant>
|
135
|
+
<variant lang='fr' script='Latn'>Français</variant>
|
136
|
+
</title>
|
137
|
+
<p id='_'>
|
138
|
+
this
|
139
|
+
<variant>
|
140
|
+
<variant lang='en'>English</variant>
|
141
|
+
<variant lang='fr' script='Latn'>Français</variant>
|
142
|
+
</variant>
|
143
|
+
section is
|
144
|
+
<variant>
|
145
|
+
<variant lang='en'>silly</variant>
|
146
|
+
<variant lang='fr'>fou</variant>
|
147
|
+
</variant>
|
148
|
+
</p>
|
149
|
+
</clause>
|
150
|
+
</sections>
|
151
|
+
</standard-document>
|
152
152
|
OUTPUT
|
153
153
|
end
|
154
154
|
|
155
|
-
|
156
|
-
|
157
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
155
|
+
it "processes the Asciidoctor::Standoc concept macros" do
|
156
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
158
157
|
#{ASCIIDOC_BLANK_HDR}
|
159
158
|
{{clause1}}
|
160
159
|
{{clause1,w\[o\]rd}}
|
@@ -179,129 +178,129 @@ RSpec.describe Asciidoctor::Standoc do
|
|
179
178
|
[bibliography]
|
180
179
|
== Bibliography
|
181
180
|
* [[[blah,blah]]] _Blah_
|
182
|
-
INPUT
|
183
|
-
#{BLANK_HDR}
|
184
|
-
<preface>
|
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
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
</preface>
|
285
|
-
<sections>
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
</sections>
|
291
|
-
<bibliography>
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
</bibliography>
|
302
|
-
</standard-document>
|
303
|
-
OUTPUT
|
304
|
-
|
181
|
+
INPUT
|
182
|
+
#{BLANK_HDR}
|
183
|
+
<preface>
|
184
|
+
<foreword id='_' obligation='informative'>
|
185
|
+
<title>Foreword</title>
|
186
|
+
<p id='_'>
|
187
|
+
<concept>
|
188
|
+
<xref target='clause1'/>
|
189
|
+
</concept>
|
190
|
+
<concept>
|
191
|
+
<xref target='clause1'>w[o]rd</xref>
|
192
|
+
</concept>
|
193
|
+
<concept term='term'>
|
194
|
+
<xref target='clause1'>w[o]rd</xref>
|
195
|
+
</concept>
|
196
|
+
<concept>
|
197
|
+
<eref/>
|
198
|
+
</concept>
|
199
|
+
<concept>
|
200
|
+
<eref>word</eref>
|
201
|
+
</concept>
|
202
|
+
<concept term='term'>
|
203
|
+
<eref>word</eref>
|
204
|
+
</concept>
|
205
|
+
<concept>
|
206
|
+
<eref>
|
207
|
+
<localityStack>
|
208
|
+
<locality type='clause'>
|
209
|
+
<referenceFrom>3.1</referenceFrom>
|
210
|
+
</locality>
|
211
|
+
</localityStack>
|
212
|
+
</eref>
|
213
|
+
</concept>
|
214
|
+
<concept>
|
215
|
+
<eref>
|
216
|
+
<localityStack>
|
217
|
+
<locality type='clause'>
|
218
|
+
<referenceFrom>3.1</referenceFrom>
|
219
|
+
</locality>
|
220
|
+
</localityStack>
|
221
|
+
word
|
222
|
+
</eref>
|
223
|
+
</concept>
|
224
|
+
<concept term='term'>
|
225
|
+
<eref>
|
226
|
+
<localityStack>
|
227
|
+
<locality type='clause'>
|
228
|
+
<referenceFrom>3.1</referenceFrom>
|
229
|
+
</locality>
|
230
|
+
</localityStack>
|
231
|
+
word
|
232
|
+
</eref>
|
233
|
+
</concept>
|
234
|
+
<concept>
|
235
|
+
<eref>
|
236
|
+
<localityStack>
|
237
|
+
<locality type='clause'>
|
238
|
+
<referenceFrom>3.1</referenceFrom>
|
239
|
+
</locality>
|
240
|
+
<locality type='figure'>
|
241
|
+
<referenceFrom>a</referenceFrom>
|
242
|
+
</locality>
|
243
|
+
</localityStack>
|
244
|
+
</eref>
|
245
|
+
</concept>
|
246
|
+
<concept>
|
247
|
+
<eref>
|
248
|
+
<localityStack>
|
249
|
+
<locality type='clause'>
|
250
|
+
<referenceFrom>3.1</referenceFrom>
|
251
|
+
</locality>
|
252
|
+
<locality type='figure'>
|
253
|
+
<referenceFrom>a</referenceFrom>
|
254
|
+
</locality>
|
255
|
+
</localityStack>
|
256
|
+
word
|
257
|
+
</eref>
|
258
|
+
</concept>
|
259
|
+
<concept term='term'>
|
260
|
+
<eref>
|
261
|
+
<localityStack>
|
262
|
+
<locality type='clause'>
|
263
|
+
<referenceFrom>3.1</referenceFrom>
|
264
|
+
</locality>
|
265
|
+
<locality type='figure'>
|
266
|
+
<referenceFrom>a</referenceFrom>
|
267
|
+
</locality>
|
268
|
+
</localityStack>
|
269
|
+
word
|
270
|
+
</eref>
|
271
|
+
</concept>
|
272
|
+
<concept>
|
273
|
+
<termref base='IEV' target='135-13-13'/>
|
274
|
+
</concept>
|
275
|
+
<concept>
|
276
|
+
<termref base='IEV' target='135-13-13'>word</termref>
|
277
|
+
</concept>
|
278
|
+
<concept term='term'>
|
279
|
+
<termref base='IEV' target='135-13-13'>word</termref>
|
280
|
+
</concept>
|
281
|
+
</p>
|
282
|
+
</foreword>
|
283
|
+
</preface>
|
284
|
+
<sections>
|
285
|
+
<clause id='clause1' inline-header='false' obligation='normative'>
|
286
|
+
<title>Clause</title>
|
287
|
+
<p id='_'>Terms are defined here</p>
|
288
|
+
</clause>
|
289
|
+
</sections>
|
290
|
+
<bibliography>
|
291
|
+
<references id='_' obligation='informative' normative="false">
|
292
|
+
<title>Bibliography</title>
|
293
|
+
<bibitem id='blah'>
|
294
|
+
<formattedref format='application/x-isodoc+xml'>
|
295
|
+
<em>Blah</em>
|
296
|
+
</formattedref>
|
297
|
+
<docidentifier>blah</docidentifier>
|
298
|
+
</bibitem>
|
299
|
+
</references>
|
300
|
+
</bibliography>
|
301
|
+
</standard-document>
|
302
|
+
OUTPUT
|
303
|
+
end
|
305
304
|
|
306
305
|
it "processes the TODO custom admonition" do
|
307
306
|
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
@@ -316,141 +315,141 @@ OUTPUT
|
|
316
315
|
[TODO]
|
317
316
|
Note3
|
318
317
|
INPUT
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
318
|
+
#{BLANK_HDR}
|
319
|
+
<sections><review reviewer="(Unknown)" id="_" date="#{Date.today}T00:00:00Z">
|
320
|
+
<p id="_"/>
|
321
|
+
</review>
|
322
|
+
<review reviewer="(Unknown)" id="_" date="#{Date.today}T00:00:00Z">
|
323
|
+
<p id="_">Note2</p>
|
324
|
+
</review>
|
325
|
+
<review reviewer="(Unknown)" id="_" date="#{Date.today}T00:00:00Z">
|
326
|
+
<p id="_">Note3</p>
|
327
|
+
</review></sections>
|
328
|
+
</standard-document>
|
330
329
|
OUTPUT
|
331
330
|
end
|
332
331
|
|
333
332
|
it "generates pseudocode examples, with formatting and initial indentation" do
|
334
|
-
|
335
|
-
|
333
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
334
|
+
#{ASCIIDOC_BLANK_HDR}
|
336
335
|
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
336
|
+
[pseudocode,subsequence="A",number="3",keep-with-next=true,keep-lines-together=true]
|
337
|
+
[%unnumbered]
|
338
|
+
====
|
339
|
+
*A* +
|
340
|
+
[smallcap]#B#
|
342
341
|
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
<p id="_"> <em>C</em></p></figure>
|
352
|
-
</sections>
|
353
|
-
</standard-document>
|
354
|
-
|
355
|
-
|
342
|
+
_C_
|
343
|
+
====
|
344
|
+
INPUT
|
345
|
+
#{BLANK_HDR}
|
346
|
+
<sections>
|
347
|
+
<figure id="_" subsequence='A' class="pseudocode" unnumbered="true" number="3" keep-with-next="true" keep-lines-together="true">
|
348
|
+
<p id="_"> <strong>A</strong><br/>
|
349
|
+
<smallcap>B</smallcap></p>
|
350
|
+
<p id="_"> <em>C</em></p></figure>
|
351
|
+
</sections>
|
352
|
+
</standard-document>
|
353
|
+
OUTPUT
|
354
|
+
end
|
356
355
|
|
357
|
-
|
358
|
-
|
359
|
-
|
356
|
+
it "supplies line breaks in pseudocode" do
|
357
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
358
|
+
#{ASCIIDOC_BLANK_HDR}
|
360
359
|
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
360
|
+
[pseudocode]
|
361
|
+
====
|
362
|
+
A
|
363
|
+
B
|
365
364
|
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
<figure id='_' class='pseudocode'>
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
</sections>
|
385
|
-
</standard-document>
|
386
|
-
|
387
|
-
|
365
|
+
D
|
366
|
+
E
|
367
|
+
====
|
368
|
+
INPUT
|
369
|
+
#{BLANK_HDR}
|
370
|
+
<sections>
|
371
|
+
<figure id='_' class='pseudocode'>
|
372
|
+
<p id='_'>
|
373
|
+
A
|
374
|
+
<br/>
|
375
|
+
B
|
376
|
+
</p>
|
377
|
+
<p id='_'>
|
378
|
+
D
|
379
|
+
<br/>
|
380
|
+
E
|
381
|
+
</p>
|
382
|
+
</figure>
|
383
|
+
</sections>
|
384
|
+
</standard-document>
|
385
|
+
OUTPUT
|
386
|
+
end
|
388
387
|
|
389
|
-
|
390
|
-
|
391
|
-
|
388
|
+
it "skips embedded blocks when supplying line breaks in pseudocode" do
|
389
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
390
|
+
#{ASCIIDOC_BLANK_HDR}
|
392
391
|
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
<figure id='_' class='pseudocode'>
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
<mo>=</mo>
|
415
|
-
<mfrac>
|
416
|
-
<mrow>
|
417
|
-
<mn>1</mn>
|
418
|
-
</mrow>
|
419
|
-
<mrow>
|
420
|
-
<mi>v</mi>
|
421
|
-
</mrow>
|
422
|
-
</mfrac>
|
423
|
-
<munderover>
|
424
|
-
<mrow>
|
425
|
-
<mo>∑</mo>
|
426
|
-
</mrow>
|
427
|
-
<mrow>
|
428
|
-
<mrow>
|
429
|
-
<mi>i</mi>
|
392
|
+
[pseudocode]
|
393
|
+
====
|
394
|
+
[stem]
|
395
|
+
++++
|
396
|
+
bar X' = (1)/(v) sum_(i = 1)^(v) t_(i)
|
397
|
+
++++
|
398
|
+
====
|
399
|
+
INPUT
|
400
|
+
#{BLANK_HDR}
|
401
|
+
<sections>
|
402
|
+
<figure id='_' class='pseudocode'>
|
403
|
+
<formula id='_'>
|
404
|
+
<stem type='MathML'>
|
405
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
406
|
+
<mover accent="true">
|
407
|
+
<mrow>
|
408
|
+
<mi>X</mi>
|
409
|
+
</mrow>
|
410
|
+
<mo>¯</mo>
|
411
|
+
</mover>
|
412
|
+
<mo>′</mo>
|
430
413
|
<mo>=</mo>
|
431
|
-
<
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
</
|
452
|
-
|
453
|
-
|
414
|
+
<mfrac>
|
415
|
+
<mrow>
|
416
|
+
<mn>1</mn>
|
417
|
+
</mrow>
|
418
|
+
<mrow>
|
419
|
+
<mi>v</mi>
|
420
|
+
</mrow>
|
421
|
+
</mfrac>
|
422
|
+
<munderover>
|
423
|
+
<mrow>
|
424
|
+
<mo>∑</mo>
|
425
|
+
</mrow>
|
426
|
+
<mrow>
|
427
|
+
<mrow>
|
428
|
+
<mi>i</mi>
|
429
|
+
<mo>=</mo>
|
430
|
+
<mn>1</mn>
|
431
|
+
</mrow>
|
432
|
+
</mrow>
|
433
|
+
<mrow>
|
434
|
+
<mi>v</mi>
|
435
|
+
</mrow>
|
436
|
+
</munderover>
|
437
|
+
<msub>
|
438
|
+
<mrow>
|
439
|
+
<mi>t</mi>
|
440
|
+
</mrow>
|
441
|
+
<mrow>
|
442
|
+
<mi>i</mi>
|
443
|
+
</mrow>
|
444
|
+
</msub>
|
445
|
+
</math>
|
446
|
+
</stem>
|
447
|
+
</formula>
|
448
|
+
</figure>
|
449
|
+
</sections>
|
450
|
+
</standard-document>
|
451
|
+
OUTPUT
|
452
|
+
end
|
454
453
|
|
455
454
|
it "processes the Ruby markups" do
|
456
455
|
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
@@ -458,13 +457,13 @@ OUTPUT
|
|
458
457
|
|
459
458
|
ruby:楽聖少女[がくせいしょうじょ]
|
460
459
|
INPUT
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
460
|
+
#{BLANK_HDR}
|
461
|
+
<sections>
|
462
|
+
<p id="_">
|
463
|
+
<ruby>楽聖少女<rp>(</rp><rt>がくせいしょうじょ</rt><rp>)</rp></ruby>
|
464
|
+
</p>
|
465
|
+
</sections>
|
466
|
+
</standard-document>
|
468
467
|
OUTPUT
|
469
468
|
end
|
470
469
|
|
@@ -488,43 +487,43 @@ OUTPUT
|
|
488
487
|
* C
|
489
488
|
--
|
490
489
|
INPUT
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
</fn>
|
521
|
-
|
522
|
-
|
523
|
-
|
490
|
+
#{BLANK_HDR}
|
491
|
+
<sections>
|
492
|
+
<p id="_">
|
493
|
+
<fn reference='1'>
|
494
|
+
<table id='_'>
|
495
|
+
<thead>
|
496
|
+
<tr>
|
497
|
+
<th valign='top' align='left'>a</th>
|
498
|
+
<th valign='top' align='left'>b</th>
|
499
|
+
</tr>
|
500
|
+
</thead>
|
501
|
+
<tbody>
|
502
|
+
<tr>
|
503
|
+
<td valign='top' align='left'>c</td>
|
504
|
+
<td valign='top' align='left'>d</td>
|
505
|
+
</tr>
|
506
|
+
</tbody>
|
507
|
+
</table>
|
508
|
+
<ul id='_'>
|
509
|
+
<li>
|
510
|
+
<p id='_'>A</p>
|
511
|
+
</li>
|
512
|
+
<li>
|
513
|
+
<p id='_'>B</p>
|
514
|
+
</li>
|
515
|
+
<li>
|
516
|
+
<p id='_'>C</p>
|
517
|
+
</li>
|
518
|
+
</ul>
|
519
|
+
</fn>
|
520
|
+
</p>
|
521
|
+
</sections>
|
522
|
+
</standard-document>
|
524
523
|
OUTPUT
|
525
524
|
end
|
526
525
|
|
527
|
-
|
526
|
+
it "processes the footnoteblock macro with failed reference" do
|
528
527
|
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
529
528
|
#{ASCIIDOC_BLANK_HDR}
|
530
529
|
|
@@ -544,49 +543,149 @@ OUTPUT
|
|
544
543
|
* C
|
545
544
|
--
|
546
545
|
INPUT
|
547
|
-
|
546
|
+
#{BLANK_HDR}
|
547
|
+
<sections>
|
548
|
+
<p id='_'>
|
549
|
+
<fn reference='1'>[ERROR]</fn>
|
550
|
+
</p>
|
551
|
+
<note id='id2'>
|
552
|
+
<table id='_'>
|
553
|
+
<thead>
|
554
|
+
<tr>
|
555
|
+
<th valign='top' align='left'>a</th>
|
556
|
+
<th valign='top' align='left'>b</th>
|
557
|
+
</tr>
|
558
|
+
</thead>
|
559
|
+
<tbody>
|
560
|
+
<tr>
|
561
|
+
<td valign='top' align='left'>c</td>
|
562
|
+
<td valign='top' align='left'>d</td>
|
563
|
+
</tr>
|
564
|
+
</tbody>
|
565
|
+
</table>
|
566
|
+
<ul id='_'>
|
567
|
+
<li>
|
568
|
+
<p id='_'>A</p>
|
569
|
+
</li>
|
570
|
+
<li>
|
571
|
+
<p id='_'>B</p>
|
572
|
+
</li>
|
573
|
+
<li>
|
574
|
+
<p id='_'>C</p>
|
575
|
+
</li>
|
576
|
+
</ul>
|
577
|
+
</note>
|
578
|
+
</sections>
|
579
|
+
</standard-document>
|
580
|
+
OUTPUT
|
581
|
+
end
|
582
|
+
|
583
|
+
it "processes input form macros" do
|
584
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
585
|
+
#{ASCIIDOC_BLANK_HDR}
|
586
|
+
|
587
|
+
[form,id=N0,name=N1,action="/action_page.php"]
|
588
|
+
--
|
589
|
+
label:fname[First name:] +
|
590
|
+
input:text[id=fname,name=fname] +
|
591
|
+
label:lname[Last name:] +
|
592
|
+
input:text[id=lname,name=lname] +
|
593
|
+
label:pwd[Password:] +
|
594
|
+
input:password[id=pwd,name=pwd] +
|
595
|
+
input:radio[id=male,name=gender,value=male]
|
596
|
+
label:male[Male] +
|
597
|
+
input:radio[id=female,name=gender,value=female]
|
598
|
+
label:female[Female] +
|
599
|
+
input:radio[id=other,name=gender,value=other]
|
600
|
+
label:other[Other] +
|
601
|
+
input:checkbox[id=vehicle1,name=vehicle1,value=Bike,checked=true]
|
602
|
+
label:vehicle1[I have a bike] +
|
603
|
+
input:checkbox[id=vehicle2,name=vehicle2,value=Car]
|
604
|
+
label:vehicle2[I have a car] +
|
605
|
+
input:checkbox[id=vehicle3,name=vehicle3,value=Boat]
|
606
|
+
label:vehicle3[I have a boat] +
|
607
|
+
input:date[id=birthday,name=birthday] +
|
608
|
+
label:myfile[Select a file:]
|
609
|
+
input:file[id=myfile,name=myfile] +
|
610
|
+
label:cars[Select a car:] +
|
611
|
+
select:[id=cars,name=cars,value=fiat,size=4,disabled=true,multiple=true]
|
612
|
+
option:[Volvo,value=volvo,disabled=true]
|
613
|
+
option:[Saab,value=saab]
|
614
|
+
option:[Fiat,value=fiat]
|
615
|
+
option:[Audi,value=audi]
|
616
|
+
textarea:[id=t1,name=message,rows=10,cols=30,value="The cat was playing in the garden."]
|
617
|
+
input:button[value="Click Me!"]
|
618
|
+
input:button[]
|
619
|
+
input:submit[value="Submit"]
|
620
|
+
--
|
621
|
+
INPUT
|
622
|
+
#{BLANK_HDR}
|
548
623
|
<sections>
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
624
|
+
<form id='_' name='N1' action='/action_page.php'>
|
625
|
+
<p id='_'>
|
626
|
+
<label for='fname'>First name:</label>
|
627
|
+
<br/>
|
628
|
+
<input type='text' id='fname' name='fname'/>
|
629
|
+
<br/>
|
630
|
+
<label for='lname'>Last name:</label>
|
631
|
+
<br/>
|
632
|
+
<input type='text' id='lname' name='lname'/>
|
633
|
+
<br/>
|
634
|
+
<label for='pwd'>Password:</label>
|
635
|
+
<br/>
|
636
|
+
<input type='password' id='pwd' name='pwd'/>
|
637
|
+
<br/>
|
638
|
+
<input type='radio' id='male' name='gender' value='male'/>
|
639
|
+
<label for='male'>Male</label>
|
640
|
+
<br/>
|
641
|
+
<input type='radio' id='female' name='gender' value='female'/>
|
642
|
+
<label for='female'>Female</label>
|
643
|
+
<br/>
|
644
|
+
<input type='radio' id='other' name='gender' value='other'/>
|
645
|
+
<label for='other'>Other</label>
|
646
|
+
<br/>
|
647
|
+
<input type='checkbox' id='vehicle1' name='vehicle1' value='Bike' checked='true'/>
|
648
|
+
<label for='vehicle1'>I have a bike</label>
|
649
|
+
<br/>
|
650
|
+
<input type='checkbox' id='vehicle2' name='vehicle2' value='Car'/>
|
651
|
+
<label for='vehicle2'>I have a car</label>
|
652
|
+
<br/>
|
653
|
+
<input type='checkbox' id='vehicle3' name='vehicle3' value='Boat'/>
|
654
|
+
<label for='vehicle3'>I have a boat</label>
|
655
|
+
<br/>
|
656
|
+
<input type='date' id='birthday' name='birthday'/>
|
657
|
+
<br/>
|
658
|
+
<label for='myfile'>Select a file:</label>
|
659
|
+
<input type='file' id='myfile' name='myfile'/>
|
660
|
+
<br/>
|
661
|
+
<label for='cars'>Select a car:</label>
|
662
|
+
<br/>
|
663
|
+
<select id='cars' name='cars' size='4' disabled='true' multiple='true' value='fiat'>
|
664
|
+
<option disabled='true' value='volvo'/>
|
665
|
+
<option value='saab'/>
|
666
|
+
<option value='fiat'/>
|
667
|
+
<option value='audi'/>
|
668
|
+
</select>
|
669
|
+
<textarea id='t1' name='message' rows='10' cols='30' value='The cat was playing in the garden.'/>
|
670
|
+
<input type='button' value='Click Me!'/>
|
671
|
+
<input type='button'/>
|
672
|
+
<input type='submit' value='Submit'/>
|
673
|
+
</p>
|
674
|
+
</form>
|
675
|
+
</sections>
|
676
|
+
</standard-document>
|
581
677
|
OUTPUT
|
582
678
|
end
|
583
679
|
|
584
|
-
|
680
|
+
describe "term inline macros" do
|
585
681
|
subject(:convert) do
|
586
682
|
xmlpp(
|
587
683
|
strip_guid(
|
588
684
|
Asciidoctor.convert(
|
589
|
-
input, backend: :standoc, header_footer: true
|
685
|
+
input, backend: :standoc, header_footer: true
|
686
|
+
)
|
687
|
+
)
|
688
|
+
)
|
590
689
|
end
|
591
690
|
let(:input) do
|
592
691
|
<<~XML
|
@@ -625,11 +724,11 @@ OUTPUT
|
|
625
724
|
XML
|
626
725
|
end
|
627
726
|
|
628
|
-
it
|
727
|
+
it "converts macro into the correct xml" do
|
629
728
|
expect(convert).to(be_equivalent_to(xmlpp(output)))
|
630
729
|
end
|
631
730
|
|
632
|
-
context
|
731
|
+
context "default params" do
|
633
732
|
let(:input) do
|
634
733
|
<<~XML
|
635
734
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -668,12 +767,12 @@ OUTPUT
|
|
668
767
|
XML
|
669
768
|
end
|
670
769
|
|
671
|
-
it
|
770
|
+
it "uses `name` as termref name" do
|
672
771
|
expect(convert).to(be_equivalent_to(xmlpp(output)))
|
673
772
|
end
|
674
773
|
end
|
675
774
|
|
676
|
-
|
775
|
+
context "multiply exising ids in document" do
|
677
776
|
let(:input) do
|
678
777
|
<<~XML
|
679
778
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -731,12 +830,12 @@ OUTPUT
|
|
731
830
|
XML
|
732
831
|
end
|
733
832
|
|
734
|
-
it
|
833
|
+
it "generates unique ids which do not match existing ids" do
|
735
834
|
expect(convert).to(be_equivalent_to(xmlpp(output)))
|
736
835
|
end
|
737
836
|
end
|
738
837
|
|
739
|
-
|
838
|
+
context "when missing actual ref" do
|
740
839
|
let(:input) do
|
741
840
|
<<~XML
|
742
841
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -765,8 +864,8 @@ OUTPUT
|
|
765
864
|
<title>Terms and definitions</title>
|
766
865
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
767
866
|
<term id='term-name-identity'>
|
768
|
-
|
769
|
-
</term>
|
867
|
+
<preferred>name identity</preferred>
|
868
|
+
</term>
|
770
869
|
<term id='name-check'>
|
771
870
|
<preferred>name check</preferred>
|
772
871
|
<definition>
|
@@ -783,8 +882,7 @@ OUTPUT
|
|
783
882
|
<xref target='term-name-identity'/>
|
784
883
|
) is a term
|
785
884
|
</p>
|
786
|
-
<p id="_">Moreover, (<strong>term “missing” not resolved</strong>) is a term
|
787
|
-
</p>
|
885
|
+
<p id="_">Moreover, (<strong>term “missing” not resolved</strong>) is a term</p>
|
788
886
|
</definition>
|
789
887
|
</term>
|
790
888
|
</terms>
|
@@ -793,11 +891,9 @@ OUTPUT
|
|
793
891
|
XML
|
794
892
|
end
|
795
893
|
|
796
|
-
it
|
894
|
+
it "generates unique ids which do not match existing ids" do
|
797
895
|
expect(convert).to(be_equivalent_to(xmlpp(output)))
|
798
896
|
end
|
799
897
|
end
|
800
|
-
|
801
|
-
end
|
802
|
-
|
898
|
+
end
|
803
899
|
end
|