asciidoctor-rfc 0.8.0 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.hound.yml +3 -0
- data/.rubocop.ribose.yml +65 -0
- data/.rubocop.tb.yml +640 -0
- data/.rubocop.yml +13 -30
- data/.travis.yml +8 -3
- data/CODE_OF_CONDUCT.md +46 -0
- data/Gemfile +8 -1
- data/LICENSE +21 -17
- data/README.adoc +471 -52
- data/asciidoctor-rfc.gemspec +14 -13
- data/lib/asciidoctor-rfc.rb +4 -4
- data/lib/asciidoctor/rfc/common/base.rb +304 -58
- data/lib/asciidoctor/rfc/common/front.rb +3 -3
- data/lib/asciidoctor/rfc/v2/base.rb +71 -82
- data/lib/asciidoctor/rfc/v2/blocks.rb +33 -10
- data/lib/asciidoctor/rfc/v2/converter.rb +0 -3
- data/lib/asciidoctor/rfc/v2/inline_anchor.rb +35 -20
- data/lib/asciidoctor/rfc/v2/lists.rb +11 -13
- data/lib/asciidoctor/rfc/v2/table.rb +11 -9
- data/lib/asciidoctor/rfc/v2/validate.rb +18 -724
- data/lib/asciidoctor/rfc/v3/base.rb +75 -102
- data/lib/asciidoctor/rfc/v3/blocks.rb +7 -9
- data/lib/asciidoctor/rfc/v3/converter.rb +0 -1
- data/lib/asciidoctor/rfc/v3/front.rb +14 -7
- data/lib/asciidoctor/rfc/v3/inline_anchor.rb +12 -9
- data/lib/asciidoctor/rfc/v3/lists.rb +31 -45
- data/lib/asciidoctor/rfc/v3/table.rb +2 -2
- data/lib/asciidoctor/rfc/v3/validate.rb +19 -2153
- data/lib/asciidoctor/rfc/v3/validate.rng +1 -1
- data/lib/asciidoctor/rfc/version.rb +1 -1
- data/rfc2629-other.ent +61 -0
- data/rfc2629-xhtml.ent +165 -0
- data/rfc2629.dtd +312 -0
- data/spec/asciidoctor/rfc/v2/biblio_spec.rb +9 -0
- data/spec/asciidoctor/rfc/v2/comments_spec.rb +67 -1
- data/spec/asciidoctor/rfc/v2/crossref_spec.rb +127 -5
- data/spec/asciidoctor/rfc/v2/date_spec.rb +24 -28
- data/spec/asciidoctor/rfc/v2/dlist_spec.rb +5 -5
- data/spec/asciidoctor/rfc/v2/image_spec.rb +2 -2
- data/spec/asciidoctor/rfc/v2/inline_formatting_spec.rb +28 -0
- data/spec/asciidoctor/rfc/v2/listing_spec.rb +2 -2
- data/spec/asciidoctor/rfc/v2/literal_spec.rb +4 -4
- data/spec/asciidoctor/rfc/v2/preamble_spec.rb +1 -1
- data/spec/asciidoctor/rfc/v2/quote_spec.rb +1 -1
- data/spec/asciidoctor/rfc/v2/references_spec.rb +210 -3
- data/spec/asciidoctor/rfc/v2/section_spec.rb +33 -0
- data/spec/asciidoctor/rfc/v2/table_spec.rb +40 -1
- data/spec/asciidoctor/rfc/v2/text_spec.rb +71 -14
- data/spec/asciidoctor/rfc/v2/ulist_spec.rb +1 -1
- data/spec/asciidoctor/rfc/v3/biblio_spec.rb +13 -0
- data/spec/asciidoctor/rfc/v3/comments_spec.rb +71 -0
- data/spec/asciidoctor/rfc/v3/crossref_spec.rb +7 -0
- data/spec/asciidoctor/rfc/v3/dlist_spec.rb +4 -4
- data/spec/asciidoctor/rfc/v3/literal_spec.rb +1 -1
- data/spec/asciidoctor/rfc/v3/preamble_spec.rb +1 -1
- data/spec/asciidoctor/rfc/v3/references_spec.rb +208 -3
- data/spec/asciidoctor/rfc/v3/series_info_spec.rb +1 -1
- data/spec/asciidoctor/rfc/v3/table_spec.rb +70 -1
- data/spec/examples/README.adoc +42 -6
- data/spec/examples/biblio-insert-v2.adoc +29 -0
- data/spec/examples/biblio-insert-v3.adoc +30 -0
- data/spec/examples/davies-template-bare-06.adoc +1 -0
- data/spec/examples/draft-iab-html-rfc-bis.xml.adoc +2300 -0
- data/spec/examples/draft-iab-html-rfc-bis.xml.orig +1999 -0
- data/spec/examples/draft-iab-html-rfc-bis.xml.txt +2298 -0
- data/spec/examples/draft-iab-rfc-framework-bis.xml.adoc +662 -0
- data/spec/examples/draft-iab-rfc-framework-bis.xml.orig +476 -0
- data/spec/examples/draft-ietf-core-block-xx.mkd.adoc +8 -33
- data/spec/examples/hoffmanv2.xml.adoc +4 -0
- data/spec/examples/mib-doc-template-xml-06.adoc +6 -8
- data/spec/examples/refs-v2-database.xml +86 -0
- data/spec/examples/refs-v2.adoc +49 -0
- data/spec/examples/refs-v2.xml +50 -0
- data/spec/examples/refs-v2/AsciiDoc.xml +8 -0
- data/spec/examples/refs-v2/AsciiMathML.xml +8 -0
- data/spec/examples/refs-v2/IETF-BibXML.xml +9 -0
- data/spec/examples/refs-v2/MathJax.xml +8 -0
- data/spec/examples/refs-v2/NroffEdit.xml +8 -0
- data/spec/examples/refs-v2/TeX-LaTeX.xml +8 -0
- data/spec/examples/refs-v2/abarth +17 -0
- data/spec/examples/refs-v2/asciidoctor-bibliography.xml +19 -0
- data/spec/examples/refs-v2/asciidoctor-manual.xml +11 -0
- data/spec/examples/refs-v2/asciidoctor-rfc.xml +18 -0
- data/spec/examples/refs-v2/asciidoctor.xml +10 -0
- data/spec/examples/refs-v2/draftr.xml +8 -0
- data/spec/examples/refs-v2/kramdown-rfc2629.xml +8 -0
- data/spec/examples/refs-v2/lyx2rfc.xml +8 -0
- data/spec/examples/refs-v2/mmark.xml +9 -0
- data/spec/examples/refs-v2/pandoc2rfc.xml +8 -0
- data/spec/examples/refs-v2/reference.RFC.2119.xml +7 -0
- data/spec/examples/refs-v2/reference.RFC.5385.xml +7 -0
- data/spec/examples/refs-v2/reference.RFC.7328.xml +7 -0
- data/spec/examples/refs-v2/reference.RFC.7749.xml +7 -0
- data/spec/examples/refs-v2/reference.RFC.7763.xml +7 -0
- data/spec/examples/refs-v2/reference.RFC.7764.xml +7 -0
- data/spec/examples/refs-v2/reference.RFC.7990.xml +7 -0
- data/spec/examples/refs-v2/reference.RFC.7991.xml +7 -0
- data/spec/examples/refs-v3-database.xml +137 -0
- data/spec/examples/refs-v3.adoc +57 -0
- data/spec/examples/refs-v3.xml +90 -0
- data/spec/examples/refs-v3/AsciiDoc.xml +8 -0
- data/spec/examples/refs-v3/AsciiMathML.xml +8 -0
- data/spec/examples/refs-v3/IETF-BibXML.xml +9 -0
- data/spec/examples/refs-v3/MathJax.xml +8 -0
- data/spec/examples/refs-v3/NroffEdit.xml +8 -0
- data/spec/examples/refs-v3/TeX-LaTeX.xml +8 -0
- data/spec/examples/refs-v3/abarth +17 -0
- data/spec/examples/refs-v3/asciidoctor-bibliography.xml +19 -0
- data/spec/examples/refs-v3/asciidoctor-manual.xml +11 -0
- data/spec/examples/refs-v3/asciidoctor-rfc.xml +18 -0
- data/spec/examples/refs-v3/asciidoctor.xml +10 -0
- data/spec/examples/refs-v3/draftr.xml +8 -0
- data/spec/examples/refs-v3/kramdown-rfc2629.xml +8 -0
- data/spec/examples/refs-v3/lyx2rfc.xml +8 -0
- data/spec/examples/refs-v3/mathrefs.xml +19 -0
- data/spec/examples/refs-v3/mmark.xml +9 -0
- data/spec/examples/refs-v3/pandoc2rfc.xml +8 -0
- data/spec/examples/refs-v3/reference.RFC.2119.xml +7 -0
- data/spec/examples/refs-v3/reference.RFC.5385.xml +7 -0
- data/spec/examples/refs-v3/reference.RFC.7328.xml +7 -0
- data/spec/examples/refs-v3/reference.RFC.7749.xml +7 -0
- data/spec/examples/refs-v3/reference.RFC.7763.xml +7 -0
- data/spec/examples/refs-v3/reference.RFC.7764.xml +7 -0
- data/spec/examples/refs-v3/reference.RFC.7990.xml +7 -0
- data/spec/examples/refs-v3/reference.RFC.7991.xml +7 -0
- data/spec/examples/rfc2100.md.adoc +57 -44
- data/spec/examples/rfc3514.md.adoc +1 -1
- data/spec/examples/rfc6350.adoc +701 -695
- data/spec/examples/rfc6350.txt.orig +3372 -0
- data/spec/examples/rfc6350_refs.xml +774 -0
- data/spec/examples/rfc748.md.adoc +1 -1
- data/spec/examples/rfc7511.md.adoc +3 -3
- data/spec/examples/skel.mkd.adoc +1 -0
- data/spec/examples/stupid-s.mkd.adoc +4 -4
- metadata +94 -8
- data/spec/examples/rfc6350.bib +0 -763
@@ -0,0 +1,13 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
def remove_preptime(xml)
|
4
|
+
xml.gsub(/ prepTime="[^"]+"/, "").gsub(/ prepTime='[^']+'/, "")
|
5
|
+
end
|
6
|
+
|
7
|
+
describe Asciidoctor::RFC::V3::Converter do
|
8
|
+
# it "processes v3 sample biblio file" do
|
9
|
+
# system("rm -f spec/examples/refs-v3.new.xml")
|
10
|
+
# system("bin/asciidoctor-rfc3 -r asciidoctor-bibliography spec/examples/refs-v3.adoc -o spec/examples/refs-v3.new.xml")
|
11
|
+
# expect(remove_preptime(File.read("spec/examples/refs-v3.new.xml"))).to be_equivalent_to remove_prepTime(File.read("spec/examples/refs-v3.xml"))
|
12
|
+
# end
|
13
|
+
end
|
@@ -305,4 +305,75 @@ describe Asciidoctor::RFC::V3::Converter do
|
|
305
305
|
</rfc>
|
306
306
|
OUTPUT
|
307
307
|
end
|
308
|
+
|
309
|
+
it "renders inline XML comments" do
|
310
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3)).to be_equivalent_to <<~'OUTPUT'
|
311
|
+
= Document title
|
312
|
+
Author
|
313
|
+
|
314
|
+
== Section 1
|
315
|
+
A:: B [comment]#This is a comment# C D
|
316
|
+
C [comment]#This is another comment#:: D
|
317
|
+
INPUT
|
318
|
+
<section anchor="_section_1" numbered="false">
|
319
|
+
<name>Section 1</name>
|
320
|
+
<dl>
|
321
|
+
<dt>A</dt>
|
322
|
+
<dd>B <!--This is a comment--> C D</dd>
|
323
|
+
<dt>C <!--This is another comment--></dt>
|
324
|
+
<dd>D</dd>
|
325
|
+
</dl>
|
326
|
+
</section>
|
327
|
+
OUTPUT
|
328
|
+
end
|
329
|
+
|
330
|
+
|
331
|
+
it "renders XML comment paragraphs" do
|
332
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3)).to be_equivalent_to <<~'OUTPUT'
|
333
|
+
= Document title
|
334
|
+
Author
|
335
|
+
|
336
|
+
== Section 1
|
337
|
+
[.comment]
|
338
|
+
This is a
|
339
|
+
_paragraph comment_.
|
340
|
+
INPUT
|
341
|
+
<section anchor="_section_1" numbered="false">
|
342
|
+
<name>Section 1</name>
|
343
|
+
<!--This is a
|
344
|
+
_paragraph comment_.-->
|
345
|
+
</section>
|
346
|
+
OUTPUT
|
347
|
+
end
|
348
|
+
|
349
|
+
it "renders XML comment blocks" do
|
350
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3)).to be_equivalent_to <<~'OUTPUT'
|
351
|
+
= Document title
|
352
|
+
Author
|
353
|
+
|
354
|
+
== Section 1
|
355
|
+
[.comment]
|
356
|
+
--
|
357
|
+
This is a
|
358
|
+
_paragraph comment_.
|
359
|
+
|
360
|
+
And the comment runs over
|
361
|
+
|
362
|
+
several paragraphs.
|
363
|
+
--
|
364
|
+
INPUT
|
365
|
+
<section anchor="_section_1" numbered="false">
|
366
|
+
<name>Section 1</name>
|
367
|
+
<!--This is a
|
368
|
+
_paragraph comment_.
|
369
|
+
|
370
|
+
And the comment runs over
|
371
|
+
|
372
|
+
several paragraphs.
|
373
|
+
-->
|
374
|
+
</section>
|
375
|
+
OUTPUT
|
376
|
+
end
|
377
|
+
|
378
|
+
|
308
379
|
end
|
@@ -49,6 +49,9 @@ describe Asciidoctor::RFC::V3::Converter do
|
|
49
49
|
|
50
50
|
== Section 4
|
51
51
|
See <<crossreference,format=counter: text>>
|
52
|
+
|
53
|
+
== Section 5
|
54
|
+
See <<crossreference,format=title>>
|
52
55
|
INPUT
|
53
56
|
<?xml version="1.0" encoding="US-ASCII"?>
|
54
57
|
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
@@ -76,6 +79,10 @@ describe Asciidoctor::RFC::V3::Converter do
|
|
76
79
|
<name>Section 4</name>
|
77
80
|
<t>See <xref format="counter" target="crossreference">text</xref></t>
|
78
81
|
</section>
|
82
|
+
<section anchor="_section_5" numbered="false">
|
83
|
+
<name>Section 5</name>
|
84
|
+
<t>See <xref format="title" target="crossreference"/></t>
|
85
|
+
</section>
|
79
86
|
</middle>
|
80
87
|
</rfc>
|
81
88
|
OUTPUT
|
@@ -102,7 +102,7 @@ describe Asciidoctor::RFC::V3::Converter do
|
|
102
102
|
Author
|
103
103
|
|
104
104
|
== Section 1
|
105
|
-
A::
|
105
|
+
A::
|
106
106
|
+
|
107
107
|
B
|
108
108
|
INPUT
|
@@ -147,7 +147,7 @@ describe Asciidoctor::RFC::V3::Converter do
|
|
147
147
|
+
|
148
148
|
--
|
149
149
|
Note 2.
|
150
|
-
|
150
|
+
|
151
151
|
Note 3.
|
152
152
|
--
|
153
153
|
INPUT
|
@@ -189,7 +189,7 @@ describe Asciidoctor::RFC::V3::Converter do
|
|
189
189
|
Author
|
190
190
|
|
191
191
|
== Section 1
|
192
|
-
Notes::
|
192
|
+
Notes::
|
193
193
|
INPUT
|
194
194
|
<section anchor="_section_1" numbered="false">
|
195
195
|
<name>Section 1</name>
|
@@ -207,7 +207,7 @@ describe Asciidoctor::RFC::V3::Converter do
|
|
207
207
|
|
208
208
|
== Section 1
|
209
209
|
Notes1::
|
210
|
-
Notes2:: Definition
|
210
|
+
Notes2:: Definition
|
211
211
|
INPUT
|
212
212
|
<section anchor="_section_1" numbered="false">
|
213
213
|
<name>Section 1</name>
|
@@ -11,7 +11,7 @@ describe Asciidoctor::RFC::V3::Converter do
|
|
11
11
|
|
12
12
|
[bibliography]
|
13
13
|
== References
|
14
|
-
|
14
|
+
|
15
15
|
=== Normative References
|
16
16
|
++++
|
17
17
|
<reference anchor='ISO.IEC.10118-3' target='https://www.iso.org/standard/67116.html'>
|
@@ -86,7 +86,7 @@ describe Asciidoctor::RFC::V3::Converter do
|
|
86
86
|
== References
|
87
87
|
* [[[xxx,1]]]
|
88
88
|
* [[[gof,2]]]
|
89
|
-
|
89
|
+
|
90
90
|
=== Normative References
|
91
91
|
++++
|
92
92
|
<reference anchor='ISO.IEC.10118-3' target='https://www.iso.org/standard/67116.html'>
|
@@ -128,7 +128,7 @@ describe Asciidoctor::RFC::V3::Converter do
|
|
128
128
|
<title>Document title</title>
|
129
129
|
<author fullname="Author"/>
|
130
130
|
<date day="1" month="January" year="2000"/>
|
131
|
-
|
131
|
+
|
132
132
|
</front><middle>
|
133
133
|
<section anchor="_text" numbered="false">
|
134
134
|
<name>Text</name>
|
@@ -145,4 +145,209 @@ describe Asciidoctor::RFC::V3::Converter do
|
|
145
145
|
</rfc>
|
146
146
|
OUTPUT
|
147
147
|
end
|
148
|
+
|
149
|
+
it "renders external RFC XML references as includes" do
|
150
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true).to_s).to be_equivalent_to <<~'OUTPUT'
|
151
|
+
= The Holy Hand Grenade of Antioch
|
152
|
+
Arthur Pendragon
|
153
|
+
:doctype: internet-draft
|
154
|
+
|
155
|
+
== Hello
|
156
|
+
Hello
|
157
|
+
|
158
|
+
[bibliography]
|
159
|
+
== Normative References
|
160
|
+
++++
|
161
|
+
<reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119">
|
162
|
+
<front>
|
163
|
+
<title>
|
164
|
+
Key words for use in RFCs to Indicate Requirement Levels
|
165
|
+
</title>
|
166
|
+
<author initials="S." surname="Bradner" fullname="S. Bradner">
|
167
|
+
<organization/>
|
168
|
+
</author>
|
169
|
+
<date year="1997" month="March"/>
|
170
|
+
<abstract>
|
171
|
+
<t>
|
172
|
+
In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.
|
173
|
+
</t>
|
174
|
+
</abstract>
|
175
|
+
</front>
|
176
|
+
<seriesInfo name="BCP" value="14"/>
|
177
|
+
<seriesInfo name="RFC" value="2119"/>
|
178
|
+
<seriesInfo name="DOI" value="10.17487/RFC2119"/>
|
179
|
+
</reference>
|
180
|
+
++++
|
181
|
+
|
182
|
+
[bibliography]
|
183
|
+
== Informative References
|
184
|
+
++++
|
185
|
+
<reference anchor="I-D.abarth-cake">
|
186
|
+
<front>
|
187
|
+
<title>Simple HTTP State Management Mechanism</title>
|
188
|
+
<author initials="A" surname="Barth" fullname="Adam Barth">
|
189
|
+
<organization/>
|
190
|
+
</author>
|
191
|
+
<date month="August" day="22" year="2010"/>
|
192
|
+
<abstract>
|
193
|
+
<t>
|
194
|
+
This document describes a simple HTTP state management mechanism, called cake, that lets HTTP servers maintain stateful sessions with HTTP user agents. This mechanism is harmonized with the same-origin security model and provides both confidentiality and integrity protection against active network attackers. In addition, the mechanism is robust to cross-site request forgery attacks.Editorial Note (To be removed by RFC Editor) If you have suggestions for improving this document, please send email to mailto:http-state@ietf.org. Further Working Group information is available from https://tools.ietf.org/wg/httpstate/.
|
195
|
+
</t>
|
196
|
+
</abstract>
|
197
|
+
</front>
|
198
|
+
<seriesInfo name="Internet-Draft" value="draft-abarth-cake-00"/>
|
199
|
+
<format type="TXT" target="http://www.ietf.org/internet-drafts/draft-abarth-cake-00.txt"/>
|
200
|
+
</reference>
|
201
|
+
++++
|
202
|
+
INPUT
|
203
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
204
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
205
|
+
<?rfc strict="yes"?>
|
206
|
+
<?rfc compact="yes"?>
|
207
|
+
<?rfc subcompact="no"?>
|
208
|
+
<?rfc toc="yes"?>
|
209
|
+
<?rfc tocdepth="4"?>
|
210
|
+
<?rfc symrefs="yes"?>
|
211
|
+
<?rfc sortrefs="yes"?>
|
212
|
+
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" submissionType="IETF" prepTime="2000-01-01T05:00:00Z" version="3">
|
213
|
+
<front>
|
214
|
+
<title>The Holy Hand Grenade of Antioch</title>
|
215
|
+
<author fullname="Arthur Pendragon" surname="Pendragon"/>
|
216
|
+
<date day="1" month="January" year="2000"/>
|
217
|
+
</front><middle>
|
218
|
+
<section anchor="_hello" numbered="false">
|
219
|
+
<name>Hello</name>
|
220
|
+
<t>Hello</t>
|
221
|
+
</section>
|
222
|
+
</middle><back>
|
223
|
+
<references anchor="_normative_references">
|
224
|
+
<name>Normative References</name>
|
225
|
+
<xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml" parse="text"/>
|
226
|
+
</references>
|
227
|
+
<references anchor="_informative_references">
|
228
|
+
<name>Informative References</name>
|
229
|
+
<xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3//reference.I-D.draft-abarth-cake-00.xml" parse="text"/>
|
230
|
+
</references>
|
231
|
+
</back>
|
232
|
+
</rfc>
|
233
|
+
OUTPUT
|
234
|
+
end
|
235
|
+
|
236
|
+
it "renders skeletal external RFC XML references as includes" do
|
237
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true).to_s).to be_equivalent_to <<~'OUTPUT'
|
238
|
+
= The Holy Hand Grenade of Antioch
|
239
|
+
Arthur Pendragon
|
240
|
+
:doctype: internet-draft
|
241
|
+
|
242
|
+
== Hello
|
243
|
+
Hello
|
244
|
+
|
245
|
+
[bibliography]
|
246
|
+
== Normative References
|
247
|
+
++++
|
248
|
+
<reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119">
|
249
|
+
<front>
|
250
|
+
<title/>
|
251
|
+
<author/>
|
252
|
+
<date/>
|
253
|
+
</front>
|
254
|
+
</reference>
|
255
|
+
++++
|
256
|
+
|
257
|
+
[bibliography]
|
258
|
+
== Informative References
|
259
|
+
++++
|
260
|
+
<reference anchor="I-D.abarth-cake">
|
261
|
+
<front>
|
262
|
+
<title/>
|
263
|
+
<author/>
|
264
|
+
<date/>
|
265
|
+
</front>
|
266
|
+
</reference>
|
267
|
+
++++
|
268
|
+
INPUT
|
269
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
270
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
271
|
+
<?rfc strict="yes"?>
|
272
|
+
<?rfc compact="yes"?>
|
273
|
+
<?rfc subcompact="no"?>
|
274
|
+
<?rfc toc="yes"?>
|
275
|
+
<?rfc tocdepth="4"?>
|
276
|
+
<?rfc symrefs="yes"?>
|
277
|
+
<?rfc sortrefs="yes"?>
|
278
|
+
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" submissionType="IETF" prepTime="2000-01-01T05:00:00Z" version="3">
|
279
|
+
<front>
|
280
|
+
<title>The Holy Hand Grenade of Antioch</title>
|
281
|
+
<author fullname="Arthur Pendragon" surname="Pendragon"/>
|
282
|
+
<date day="1" month="January" year="2000"/>
|
283
|
+
|
284
|
+
</front><middle>
|
285
|
+
<section anchor="_hello" numbered="false">
|
286
|
+
<name>Hello</name>
|
287
|
+
<t>Hello</t>
|
288
|
+
</section>
|
289
|
+
</middle><back>
|
290
|
+
<references anchor="_normative_references">
|
291
|
+
<name>Normative References</name>
|
292
|
+
<xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml" parse="text"/>
|
293
|
+
</references>
|
294
|
+
<references anchor="_informative_references">
|
295
|
+
<name>Informative References</name>
|
296
|
+
<xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3//reference.I-D.abarth-cake.xml" parse="text"/>
|
297
|
+
</references>
|
298
|
+
</back>
|
299
|
+
</rfc>
|
300
|
+
OUTPUT
|
301
|
+
end
|
302
|
+
|
303
|
+
it "renders skeletal external RFC XML references with drafts as includes" do
|
304
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true).to_s).to be_equivalent_to <<~'OUTPUT'
|
305
|
+
= The Holy Hand Grenade of Antioch
|
306
|
+
Arthur Pendragon
|
307
|
+
:doctype: internet-draft
|
308
|
+
|
309
|
+
== Hello
|
310
|
+
Hello
|
311
|
+
|
312
|
+
[bibliography]
|
313
|
+
== Informative References
|
314
|
+
++++
|
315
|
+
<reference anchor="I-D.abarth-cake">
|
316
|
+
<front>
|
317
|
+
<title/>
|
318
|
+
<author/>
|
319
|
+
<date/>
|
320
|
+
</front>
|
321
|
+
<seriesInfo name="Internet-Draft" value="draft-abarth-cake-00"/>
|
322
|
+
</reference>
|
323
|
+
++++
|
324
|
+
INPUT
|
325
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
326
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
327
|
+
<?rfc strict="yes"?>
|
328
|
+
<?rfc compact="yes"?>
|
329
|
+
<?rfc subcompact="no"?>
|
330
|
+
<?rfc toc="yes"?>
|
331
|
+
<?rfc tocdepth="4"?>
|
332
|
+
<?rfc symrefs="yes"?>
|
333
|
+
<?rfc sortrefs="yes"?>
|
334
|
+
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" submissionType="IETF" prepTime="2000-01-01T05:00:00Z" version="3">
|
335
|
+
<front>
|
336
|
+
<title>The Holy Hand Grenade of Antioch</title>
|
337
|
+
<author fullname="Arthur Pendragon" surname="Pendragon"/>
|
338
|
+
<date day="1" month="January" year="2000"/>
|
339
|
+
</front><middle>
|
340
|
+
<section anchor="_hello" numbered="false">
|
341
|
+
<name>Hello</name>
|
342
|
+
<t>Hello</t>
|
343
|
+
</section>
|
344
|
+
</middle><back>
|
345
|
+
<references anchor="_informative_references">
|
346
|
+
<name>Informative References</name>
|
347
|
+
<xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3//reference.I-D.draft-abarth-cake-00.xml" parse="text"/>
|
348
|
+
</references>
|
349
|
+
</back>
|
350
|
+
</rfc>
|
351
|
+
OUTPUT
|
352
|
+
end
|
148
353
|
end
|
@@ -177,7 +177,7 @@ describe Asciidoctor::RFC::V3::Converter do
|
|
177
177
|
<seriesInfo name="" status="illegal" value="draft-xxx"/>
|
178
178
|
<author fullname="Author"/>
|
179
179
|
<date day="1" month="January" year="2000"/>
|
180
|
-
|
180
|
+
|
181
181
|
</front><middle>
|
182
182
|
<section anchor="_section_1" numbered="false">
|
183
183
|
<name>Section 1</name>
|
@@ -7,6 +7,7 @@ describe Asciidoctor::RFC::V3::Converter do
|
|
7
7
|
|
8
8
|
== Section 1
|
9
9
|
[[id]]
|
10
|
+
[options="footer"]
|
10
11
|
.Table Title
|
11
12
|
|===
|
12
13
|
|[[id]] head | head
|
@@ -19,6 +20,7 @@ describe Asciidoctor::RFC::V3::Converter do
|
|
19
20
|
^|centre aligned cell | cell
|
20
21
|
<|left aligned cell | cell
|
21
22
|
>|right aligned cell | cell
|
23
|
+
|
22
24
|
|foot | foot
|
23
25
|
|===
|
24
26
|
INPUT
|
@@ -63,11 +65,13 @@ describe Asciidoctor::RFC::V3::Converter do
|
|
63
65
|
<td align="right">right aligned cell</td>
|
64
66
|
<td align="left">cell</td>
|
65
67
|
</tr>
|
68
|
+
</tbody>
|
69
|
+
<tfoot>
|
66
70
|
<tr>
|
67
71
|
<td align="left">foot</td>
|
68
72
|
<td align="left">foot</td>
|
69
73
|
</tr>
|
70
|
-
</
|
74
|
+
</tfoot>
|
71
75
|
</table>
|
72
76
|
</section>
|
73
77
|
OUTPUT
|
@@ -272,4 +276,69 @@ describe Asciidoctor::RFC::V3::Converter do
|
|
272
276
|
</section>
|
273
277
|
OUTPUT
|
274
278
|
end
|
279
|
+
it "renders a table with no header row" do
|
280
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3)).to be_equivalent_to <<~'OUTPUT'
|
281
|
+
= Document title
|
282
|
+
Author
|
283
|
+
|
284
|
+
== Section 1
|
285
|
+
[[id]]
|
286
|
+
.Table Title
|
287
|
+
|===
|
288
|
+
|
289
|
+
h|header cell | body cell
|
290
|
+
| | body cell
|
291
|
+
2+| colspan of 2
|
292
|
+
.2+|rowspan of 2 | cell
|
293
|
+
|cell
|
294
|
+
^|centre aligned cell | cell
|
295
|
+
<|left aligned cell | cell
|
296
|
+
>|right aligned cell | cell
|
297
|
+
|foot | foot
|
298
|
+
|===
|
299
|
+
INPUT
|
300
|
+
<section anchor="_section_1" numbered="false">
|
301
|
+
<name>Section 1</name>
|
302
|
+
<table anchor="id">
|
303
|
+
<name>Table Title</name>
|
304
|
+
<tbody>
|
305
|
+
<tr>
|
306
|
+
<th align="left">header cell</th>
|
307
|
+
<td align="left">body cell</td>
|
308
|
+
</tr>
|
309
|
+
<tr>
|
310
|
+
<td align="left"></td>
|
311
|
+
<td align="left">body cell</td>
|
312
|
+
</tr>
|
313
|
+
<tr>
|
314
|
+
<td colspan="2" align="left">colspan of 2</td>
|
315
|
+
</tr>
|
316
|
+
<tr>
|
317
|
+
<td rowspan="2" align="left">rowspan of 2</td>
|
318
|
+
<td align="left">cell</td>
|
319
|
+
</tr>
|
320
|
+
<tr>
|
321
|
+
<td align="left">cell</td>
|
322
|
+
</tr>
|
323
|
+
<tr>
|
324
|
+
<td align="center">centre aligned cell</td>
|
325
|
+
<td align="left">cell</td>
|
326
|
+
</tr>
|
327
|
+
<tr>
|
328
|
+
<td align="left">left aligned cell</td>
|
329
|
+
<td align="left">cell</td>
|
330
|
+
</tr>
|
331
|
+
<tr>
|
332
|
+
<td align="right">right aligned cell</td>
|
333
|
+
<td align="left">cell</td>
|
334
|
+
</tr>
|
335
|
+
<tr>
|
336
|
+
<td align="left">foot</td>
|
337
|
+
<td align="left">foot</td>
|
338
|
+
</tr>
|
339
|
+
</tbody>
|
340
|
+
</table>
|
341
|
+
</section>
|
342
|
+
OUTPUT
|
343
|
+
end
|
275
344
|
end
|