asciidoctor-rfc 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +5 -0
  3. data/.oss-guides.rubocop.yml +1077 -0
  4. data/.rspec +1 -0
  5. data/.rubocop.yml +19 -1063
  6. data/.travis.yml +3 -2
  7. data/Guardfile +22 -0
  8. data/README.adoc +1151 -0
  9. data/Rakefile +1 -1
  10. data/asciidoctor-rfc.gemspec +20 -3
  11. data/bin/asciidoctor-rfc2 +15 -0
  12. data/bin/asciidoctor-rfc3 +15 -0
  13. data/bin/rspec +0 -1
  14. data/lib/asciidoctor-rfc.rb +4 -0
  15. data/lib/asciidoctor/rfc/common/base.rb +218 -0
  16. data/lib/asciidoctor/rfc/common/front.rb +120 -0
  17. data/lib/asciidoctor/rfc/v2/base.rb +341 -0
  18. data/lib/asciidoctor/rfc/v2/blocks.rb +192 -0
  19. data/lib/asciidoctor/rfc/v2/converter.rb +64 -0
  20. data/lib/asciidoctor/rfc/v2/front.rb +69 -0
  21. data/lib/asciidoctor/rfc/v2/inline_anchor.rb +102 -0
  22. data/lib/asciidoctor/rfc/v2/lists.rb +134 -0
  23. data/lib/asciidoctor/rfc/v2/table.rb +112 -0
  24. data/lib/asciidoctor/rfc/v2/validate.rb +738 -0
  25. data/lib/asciidoctor/rfc/v2/validate2.rng +716 -0
  26. data/lib/asciidoctor/rfc/v3/base.rb +358 -0
  27. data/lib/asciidoctor/rfc/v3/blocks.rb +203 -0
  28. data/lib/asciidoctor/rfc/v3/converter.rb +64 -0
  29. data/lib/asciidoctor/rfc/v3/front.rb +115 -0
  30. data/lib/asciidoctor/rfc/v3/inline_anchor.rb +90 -0
  31. data/lib/asciidoctor/rfc/v3/lists.rb +190 -0
  32. data/lib/asciidoctor/rfc/v3/svg.rng +9081 -0
  33. data/lib/asciidoctor/rfc/v3/table.rb +65 -0
  34. data/lib/asciidoctor/rfc/v3/validate.rb +2168 -0
  35. data/lib/asciidoctor/rfc/v3/validate.rng +2143 -0
  36. data/lib/asciidoctor/rfc/version.rb +2 -2
  37. data/spec/asciidoctor/rfc/v2/appendix_spec.rb +124 -0
  38. data/spec/asciidoctor/rfc/v2/area_spec.rb +60 -0
  39. data/spec/asciidoctor/rfc/v2/author_spec.rb +444 -0
  40. data/spec/asciidoctor/rfc/v2/comments_spec.rb +316 -0
  41. data/spec/asciidoctor/rfc/v2/crossref_spec.rb +205 -0
  42. data/spec/asciidoctor/rfc/v2/date_spec.rb +166 -0
  43. data/spec/asciidoctor/rfc/v2/dlist_spec.rb +108 -0
  44. data/spec/asciidoctor/rfc/v2/document_spec.rb +161 -0
  45. data/spec/asciidoctor/rfc/v2/example_spec.rb +50 -0
  46. data/spec/asciidoctor/rfc/v2/front_spec.rb +75 -0
  47. data/spec/asciidoctor/rfc/v2/image_spec.rb +81 -0
  48. data/spec/asciidoctor/rfc/v2/indexterm_spec.rb +66 -0
  49. data/spec/asciidoctor/rfc/v2/inline_formatting_spec.rb +177 -0
  50. data/spec/asciidoctor/rfc/v2/keyword_spec.rb +63 -0
  51. data/spec/asciidoctor/rfc/v2/listing_spec.rb +59 -0
  52. data/spec/asciidoctor/rfc/v2/literal_spec.rb +53 -0
  53. data/spec/asciidoctor/rfc/v2/olist_spec.rb +147 -0
  54. data/spec/asciidoctor/rfc/v2/paragraph_spec.rb +68 -0
  55. data/spec/asciidoctor/rfc/v2/preamble_spec.rb +140 -0
  56. data/spec/asciidoctor/rfc/v2/quote_spec.rb +24 -0
  57. data/spec/asciidoctor/rfc/v2/references_spec.rb +96 -0
  58. data/spec/asciidoctor/rfc/v2/section_spec.rb +260 -0
  59. data/spec/asciidoctor/rfc/v2/sidebar_spec.rb +32 -0
  60. data/spec/asciidoctor/rfc/v2/table_spec.rb +293 -0
  61. data/spec/asciidoctor/rfc/v2/ulist_spec.rb +96 -0
  62. data/spec/asciidoctor/rfc/v2/workgroup_spec.rb +60 -0
  63. data/spec/asciidoctor/rfc/v3/appendix_spec.rb +130 -0
  64. data/spec/asciidoctor/rfc/v3/area_spec.rb +63 -0
  65. data/spec/asciidoctor/rfc/v3/author_spec.rb +540 -0
  66. data/spec/asciidoctor/rfc/v3/comments_spec.rb +308 -0
  67. data/spec/asciidoctor/rfc/v3/crossref_spec.rb +269 -0
  68. data/spec/asciidoctor/rfc/v3/date_spec.rb +149 -0
  69. data/spec/asciidoctor/rfc/v3/dlist_spec.rb +121 -0
  70. data/spec/asciidoctor/rfc/v3/document_spec.rb +109 -0
  71. data/spec/asciidoctor/rfc/v3/example_spec.rb +34 -0
  72. data/spec/asciidoctor/rfc/v3/front_spec.rb +43 -0
  73. data/spec/asciidoctor/rfc/v3/image_spec.rb +81 -0
  74. data/spec/asciidoctor/rfc/v3/indexterm_spec.rb +69 -0
  75. data/spec/asciidoctor/rfc/v3/inline_formatting_spec.rb +319 -0
  76. data/spec/asciidoctor/rfc/v3/keyword_spec.rb +33 -0
  77. data/spec/asciidoctor/rfc/v3/link_spec.rb +34 -0
  78. data/spec/asciidoctor/rfc/v3/listing_spec.rb +59 -0
  79. data/spec/asciidoctor/rfc/v3/literal_spec.rb +51 -0
  80. data/spec/asciidoctor/rfc/v3/olist_spec.rb +168 -0
  81. data/spec/asciidoctor/rfc/v3/paragraph_spec.rb +73 -0
  82. data/spec/asciidoctor/rfc/v3/preamble_spec.rb +112 -0
  83. data/spec/asciidoctor/rfc/v3/quote_spec.rb +91 -0
  84. data/spec/asciidoctor/rfc/v3/references_spec.rb +147 -0
  85. data/spec/asciidoctor/rfc/v3/section_spec.rb +198 -0
  86. data/spec/asciidoctor/rfc/v3/series_info_spec.rb +151 -0
  87. data/spec/asciidoctor/rfc/v3/sidebar_spec.rb +30 -0
  88. data/spec/asciidoctor/rfc/v3/table_spec.rb +275 -0
  89. data/spec/asciidoctor/rfc/v3/ulist_spec.rb +74 -0
  90. data/spec/asciidoctor/rfc/v3/workgroup_spec.rb +33 -0
  91. data/spec/examples/davies-template-bare-06.adoc +361 -0
  92. data/spec/examples/davies-template-bare-06.xml.orig +426 -0
  93. data/spec/examples/example-v2.adoc +181 -0
  94. data/spec/examples/example-v2.xml +675 -0
  95. data/spec/examples/example-v3.adoc +185 -0
  96. data/spec/examples/example-v3.xml +1009 -0
  97. data/spec/examples/mib-doc-template-xml-06.adoc +596 -0
  98. data/spec/examples/mib-doc-template-xml-06.xml.orig +654 -0
  99. data/spec/examples/rfc1149.md +76 -0
  100. data/spec/examples/rfc1149.md.2.xml +94 -0
  101. data/spec/examples/rfc1149.md.3.xml +93 -0
  102. data/spec/examples/rfc1149.md.adoc +65 -0
  103. data/spec/examples/rfc2100.md +149 -0
  104. data/spec/examples/rfc2100.md.2.xml +169 -0
  105. data/spec/examples/rfc2100.md.3.xml +163 -0
  106. data/spec/examples/rfc2100.md.adoc +136 -0
  107. data/spec/examples/rfc3514.md +203 -0
  108. data/spec/examples/rfc3514.md.2.xml +238 -0
  109. data/spec/examples/rfc3514.md.3.xml +258 -0
  110. data/spec/examples/rfc3514.md.adoc +324 -0
  111. data/spec/examples/rfc5841.md +342 -0
  112. data/spec/examples/rfc5841.md.2.xml +393 -0
  113. data/spec/examples/rfc5841.md.3.xml +449 -0
  114. data/spec/examples/rfc5841.md.adoc +414 -0
  115. data/spec/examples/rfc6350.adoc +3499 -0
  116. data/spec/examples/rfc6350.bib +763 -0
  117. data/spec/examples/rfc748.md +79 -0
  118. data/spec/examples/rfc748.md.2.xml +116 -0
  119. data/spec/examples/rfc748.md.3.xml +109 -0
  120. data/spec/examples/rfc748.md.adoc +80 -0
  121. data/spec/examples/rfc7511.md +257 -0
  122. data/spec/examples/rfc7511.md.2.xml +300 -0
  123. data/spec/examples/rfc7511.md.3.xml +347 -0
  124. data/spec/examples/rfc7511.md.adoc +417 -0
  125. data/spec/spec_helper.rb +115 -5
  126. metadata +274 -9
  127. data/.hound.yml +0 -3
  128. data/README.md +0 -84
  129. data/lib/asciidoctor/rfc.rb +0 -7
  130. data/spec/asciidoctor-rfc/.keep +0 -0
@@ -0,0 +1,316 @@
1
+ require "spec_helper"
2
+ describe Asciidoctor::RFC::V2::Converter do
3
+ it "ignores actual Asciidoctor comments" do
4
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
5
+ = Document title
6
+ :abbrev: abbrev_value
7
+ :docName:
8
+ Author
9
+
10
+ == Section1
11
+ Text
12
+
13
+ //Ignorable comment
14
+
15
+ ////
16
+ Multiblock ignorable comment
17
+ ////
18
+ INPUT
19
+ <?xml version="1.0" encoding="US-ASCII"?>
20
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
21
+
22
+ <rfc
23
+ submissionType="IETF">
24
+ <front>
25
+ <title abbrev="abbrev_value">Document title</title>
26
+ <author fullname="Author"/>
27
+ <date day="1" month="January" year="2000"/>
28
+ </front><middle>
29
+ <section anchor="_section1" title="Section1">
30
+ <t>Text</t>
31
+ </section>
32
+ </middle>
33
+ </rfc>
34
+ OUTPUT
35
+ end
36
+
37
+ it "uses Asciidoc inline NOTE admonition" do
38
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
39
+ = Document title
40
+ :abbrev: abbrev_value
41
+ :docName:
42
+ Author
43
+
44
+ == Section1
45
+ Text
46
+
47
+ NOTE: This is a note
48
+ INPUT
49
+ <?xml version="1.0" encoding="US-ASCII"?>
50
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
51
+
52
+ <rfc submissionType="IETF">
53
+ <front>
54
+
55
+ <title abbrev="abbrev_value">Document title</title>
56
+
57
+ <author fullname="Author"/>
58
+
59
+ <date day="1" month="January" year="2000"/>
60
+
61
+
62
+ </front><middle>
63
+ <section anchor="_section1" title="Section1"><t>Text<cref>This is a note</cref></t>
64
+
65
+ </section>
66
+ </middle>
67
+ </rfc>
68
+ OUTPUT
69
+ end
70
+
71
+ it "uses any Asciidoc inline admonition" do
72
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
73
+ = Document title
74
+ :abbrev: abbrev_value
75
+ :docName:
76
+ Author
77
+
78
+ == Section1
79
+ Text
80
+
81
+ WARNING: This is a note
82
+ INPUT
83
+ <?xml version="1.0" encoding="US-ASCII"?>
84
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
85
+
86
+ <rfc submissionType="IETF">
87
+ <front>
88
+
89
+ <title abbrev="abbrev_value">Document title</title>
90
+
91
+ <author fullname="Author"/>
92
+
93
+ <date day="1" month="January" year="2000"/>
94
+
95
+
96
+ </front><middle>
97
+ <section anchor="_section1" title="Section1"><t>Text<cref>This is a note</cref></t>
98
+
99
+ </section>
100
+ </middle>
101
+ </rfc>
102
+ OUTPUT
103
+ end
104
+
105
+ it "strips any inline formatting within Asciidoc inline admonition" do
106
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
107
+ = Document title
108
+ :abbrev: abbrev_value
109
+ :docName:
110
+ Author
111
+
112
+ [[sect1]]
113
+ == Section1
114
+ Text
115
+
116
+ WARNING: Text _Text_ *Text* `Text` ~Text~ ^Text^ http://example.com/[linktext] <<ref>>
117
+ [bibliography]
118
+ == References
119
+ ++++
120
+ <reference anchor='ref' target='https://www.iso.org/standard/67116.html'>
121
+ <front>
122
+ <title>ISO/IEC FDIS 10118-3 -- Information technology -- Security techniques -- Hash-functions -- Part 3: Dedicated hash-functions</title>
123
+ <author>
124
+ <organization>International Organization for Standardization</organization>
125
+ <address>
126
+ <postal>
127
+ <street>BIBC II</street>
128
+ <street>Chemin de Blandonnet 8</street>
129
+ <street>CP 401</street>
130
+ <city>Vernier</city>
131
+ <region>Geneva</region>
132
+ <code>1214</code>
133
+ <country>Switzerland</country>
134
+ </postal>
135
+ <phone>+41 22 749 01 11</phone>
136
+ <email>central@iso.org</email>
137
+ <uri>https://www.iso.org/</uri>
138
+ </address>
139
+ </author>
140
+ <date day='15' month='September' year='2017'/>
141
+ </front>
142
+ </reference>
143
+ ++++
144
+ INPUT
145
+ <?xml version="1.0" encoding="US-ASCII"?>
146
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
147
+
148
+ <rfc submissionType="IETF">
149
+ <front>
150
+
151
+ <title abbrev="abbrev_value">Document title</title>
152
+
153
+ <author fullname="Author"/>
154
+
155
+ <date day="1" month="January" year="2000"/>
156
+
157
+
158
+ </front><middle>
159
+ <section anchor="sect1" title="Section1"><t>Text<cref>Text _Text_ *Text* `Text` ~Text~ ^Text^ http://example.com/[linktext] &lt;&lt;ref&gt;&gt;</cref></t>
160
+
161
+ </section>
162
+ </middle><back>
163
+ <references title="References">
164
+ <reference anchor="ref" target="https://www.iso.org/standard/67116.html">
165
+ <front>
166
+ <title>ISO/IEC FDIS 10118-3 -- Information technology -- Security techniques -- Hash-functions -- Part 3: Dedicated hash-functions</title>
167
+ <author>
168
+ <organization>International Organization for Standardization</organization>
169
+ <address>
170
+ <postal>
171
+ <street>BIBC II</street>
172
+ <street>Chemin de Blandonnet 8</street>
173
+ <street>CP 401</street>
174
+ <city>Vernier</city>
175
+ <region>Geneva</region>
176
+ <code>1214</code>
177
+ <country>Switzerland</country>
178
+ </postal>
179
+ <phone>+41 22 749 01 11</phone>
180
+ <email>central@iso.org</email>
181
+ <uri>https://www.iso.org/</uri>
182
+ </address>
183
+ </author>
184
+ <date day="15" month="September" year="2017"/>
185
+ </front>
186
+ </reference>
187
+ </references>
188
+ </back>
189
+ </rfc>
190
+ OUTPUT
191
+ end
192
+
193
+ it "uses Asciidoc block admonition" do
194
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
195
+ = Document title
196
+ :abbrev: abbrev_value
197
+ :docName:
198
+ Author
199
+
200
+ == Section1
201
+ Text
202
+
203
+ [IMPORTANT]
204
+ .Feeding the Werewolves
205
+ ====
206
+ While werewolves are hardy community members, keep in mind the following dietary concerns:
207
+
208
+ . They are allergic to *cinnamon*.
209
+ . More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.
210
+ . Celery makes them sad.
211
+ ====
212
+ INPUT
213
+ <?xml version="1.0" encoding="US-ASCII"?>
214
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
215
+
216
+ <rfc submissionType="IETF">
217
+ <front>
218
+
219
+ <title abbrev="abbrev_value">Document title</title>
220
+
221
+ <author fullname="Author"/>
222
+
223
+ <date day="1" month="January" year="2000"/>
224
+
225
+
226
+ </front><middle>
227
+ <section anchor="_section1" title="Section1"><t>Text<cref>While werewolves are hardy community members, keep in mind the following dietary concerns:
228
+
229
+
230
+
231
+ They are allergic to cinnamon.
232
+
233
+
234
+
235
+ More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.
236
+
237
+
238
+
239
+ Celery makes them sad.</cref></t>
240
+
241
+ </section>
242
+ </middle>
243
+ </rfc>
244
+ OUTPUT
245
+ end
246
+
247
+ it "uses all options of the Asciidoc block admonition" do
248
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
249
+ = Document title
250
+ :abbrev: abbrev_value
251
+ :docName:
252
+ Author
253
+
254
+ == Section1
255
+ Text
256
+
257
+ [[id]]
258
+ [NOTE,source=GBS]
259
+ .Note Title
260
+ ====
261
+ Any admonition inside the body of the text is a comment.
262
+ ====
263
+ INPUT
264
+ <?xml version="1.0" encoding="US-ASCII"?>
265
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
266
+
267
+ <rfc submissionType="IETF">
268
+ <front>
269
+
270
+ <title abbrev="abbrev_value">Document title</title>
271
+
272
+ <author fullname="Author"/>
273
+
274
+ <date day="1" month="January" year="2000"/>
275
+
276
+
277
+ </front><middle>
278
+ <section anchor="_section1" title="Section1"><t>Text<cref anchor="id" source="GBS">Any admonition inside the body of the text is a comment.</cref></t>
279
+
280
+ </section>
281
+ </middle>
282
+ </rfc>
283
+ OUTPUT
284
+ end
285
+
286
+ it "has a comment at the start of a section" do
287
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
288
+ = Document title
289
+ Author
290
+
291
+ == Section 1
292
+ NOTE: This is an initial note
293
+
294
+ Text
295
+ INPUT
296
+ <?xml version="1.0" encoding="US-ASCII"?>
297
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
298
+
299
+ <rfc submissionType="IETF">
300
+ <front>
301
+
302
+ <title>Document title</title>
303
+
304
+ <author fullname="Author"/>
305
+
306
+ <date day="1" month="January" year="2000"/>
307
+
308
+ </front><middle>
309
+ <section anchor="_section_1" title="Section 1"><t><cref>This is an initial note</cref></t>
310
+
311
+ <t>Text</t></section>
312
+ </middle>
313
+ </rfc>
314
+ OUTPUT
315
+ end
316
+ end
@@ -0,0 +1,205 @@
1
+ require "spec_helper"
2
+ describe Asciidoctor::RFC::V2::Converter do
3
+ it "renders links" do
4
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
5
+ = Document title
6
+ :abbrev: abbrev_value
7
+ :docName:
8
+ Author
9
+
10
+ == Section 1
11
+ http://example.com/
12
+ http://example.com/[linktext]
13
+ INPUT
14
+ <?xml version="1.0" encoding="US-ASCII"?>
15
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
16
+
17
+ <rfc
18
+ submissionType="IETF">
19
+ <front>
20
+ <title abbrev="abbrev_value">Document title</title>
21
+ <author fullname="Author"/>
22
+ <date day="1" month="January" year="2000"/>
23
+ </front><middle>
24
+ <section anchor="_section_1" title="Section 1">
25
+ <t><eref target="http://example.com/"></eref>
26
+ <eref target="http://example.com/">linktext</eref></t>
27
+ </section>
28
+ </middle>
29
+ </rfc>
30
+ OUTPUT
31
+ end
32
+
33
+ it "renders cross-references" do
34
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
35
+ = Document title
36
+ :abbrev: abbrev_value
37
+ :docName:
38
+ Author
39
+
40
+ [[crossreference]]
41
+ == Section 1
42
+
43
+ == Section 2
44
+ See <<crossreference>>.
45
+
46
+ == Section 3
47
+ See <<crossreference,text>>
48
+
49
+ == Section 4
50
+ See <<crossreference,format=counter: text>>
51
+ INPUT
52
+ <?xml version="1.0" encoding="US-ASCII"?>
53
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
54
+
55
+ <rfc
56
+ submissionType="IETF">
57
+ <front>
58
+ <title abbrev="abbrev_value">Document title</title>
59
+ <author fullname="Author"/>
60
+ <date day="1" month="January" year="2000"/>
61
+ </front><middle>
62
+ <section anchor="crossreference" title="Section 1">
63
+ </section>
64
+ <section anchor="_section_2" title="Section 2">
65
+ <t>See <xref target="crossreference"></xref>.</t>
66
+ </section>
67
+ <section anchor="_section_3" title="Section 3">
68
+ <t>See <xref target="crossreference">text</xref></t>
69
+ </section>
70
+ <section anchor="_section_4" title="Section 4">
71
+ <t>See <xref format="counter" target="crossreference">text</xref></t>
72
+ </section>
73
+ </middle>
74
+ </rfc>
75
+ OUTPUT
76
+ end
77
+
78
+ it "renders cross-references to bibliography" do
79
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
80
+ = Document title
81
+ :abbrev: abbrev_value
82
+ :docName:
83
+ Author
84
+
85
+ == Section 1
86
+
87
+ == Section 2
88
+ See <<crossreference>>.
89
+
90
+ == Section 3
91
+ See <<crossreference,text>>
92
+
93
+ [bibliography]
94
+ == References
95
+ ++++
96
+ <reference anchor='crossreference' target='https://tools.ietf.org/html/rfc7253'>
97
+ <front>
98
+ <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
99
+ <author initials="T." surname="Krovetz">
100
+ <organization>Sacramento State</organization>
101
+ </author>
102
+ <date month='May' year='2014'/>
103
+ </front>
104
+ </reference>
105
+ ++++
106
+ INPUT
107
+ <?xml version="1.0" encoding="US-ASCII"?>
108
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
109
+
110
+ <rfc
111
+ submissionType="IETF">
112
+ <front>
113
+ <title abbrev="abbrev_value">Document title</title>
114
+ <author fullname="Author"/>
115
+ <date day="1" month="January" year="2000"/>
116
+ </front><middle>
117
+ <section anchor="_section_1" title="Section 1">
118
+ </section>
119
+ <section anchor="_section_2" title="Section 2">
120
+ <t>See <xref target="crossreference"></xref>.</t>
121
+ </section>
122
+ <section anchor="_section_3" title="Section 3">
123
+ <t>See <xref target="crossreference">text</xref></t>
124
+ </section>
125
+ </middle><back>
126
+ <references title="References">
127
+ <reference anchor='crossreference' target='https://tools.ietf.org/html/rfc7253'>
128
+ <front>
129
+ <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
130
+ <author initials="T." surname="Krovetz">
131
+ <organization>Sacramento State</organization>
132
+ </author>
133
+ <date month='May' year='2014'/>
134
+ </front>
135
+ </reference>
136
+ </references>
137
+ </back>
138
+ </rfc>
139
+ OUTPUT
140
+ end
141
+ it "renders relref references" do
142
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
143
+ = Document title
144
+ :abbrev: abbrev_value
145
+ :docName:
146
+ Author
147
+
148
+ == Section 1
149
+ See <<crossreference,1.3 of>>
150
+ <<crossreference,1.4 comma: text>>
151
+ <<crossreference#fragment1,2.5.3 parens>>
152
+ <<crossreference#fragment2,6.2a bare: text>>
153
+
154
+ [bibliography]
155
+ == References
156
+ ++++
157
+ <reference anchor='crossreference' target='https://www.iso.org/standard/67116.html'>
158
+ <front>
159
+ <title>ISO/IEC FDIS 10118-3 -- Information technology -- Security techniques -- Hash-functions -- Part 3: Dedicated hash-functions</title>
160
+ <author>
161
+ <organization>International Organization for Standardization</organization>
162
+ <address>
163
+ <postal>
164
+ <street>BIBC II</street>
165
+ <street>Chemin de Blandonnet 8</street>
166
+ <street>CP 401</street>
167
+ <city>Vernier</city>
168
+ <region>Geneva</region>
169
+ <code>1214</code>
170
+ <country>Switzerland</country>
171
+ </postal>
172
+ <phone>+41 22 749 01 11</phone>
173
+ <email>central@iso.org</email>
174
+ <uri>https://www.iso.org/</uri>
175
+ </address>
176
+ </author>
177
+ <date day='15' month='September' year='2017'/>
178
+ </front>
179
+ </reference>
180
+ ++++
181
+ INPUT
182
+ <?xml version="1.0" encoding="US-ASCII"?>
183
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
184
+
185
+ <rfc submissionType="IETF">
186
+ <front>
187
+ <title abbrev="abbrev_value">Document title</title>
188
+ <author fullname="Author"/>
189
+ <date day="1" month="January" year="2000"/>
190
+ </front><middle>
191
+ <section anchor="_section_1" title="Section 1">
192
+ <t>See <xref target="crossreference">Section 1.3 of [crossreference]</xref>
193
+ <xref target="crossreference">[crossreference], Section 1.4: text</xref>
194
+ <xref target="crossreference#fragment1">[crossreference] (Section 2.5.3)</xref>
195
+ <xref target="crossreference#fragment2">6.2a: text</xref></t>
196
+ </section>
197
+ </middle><back>
198
+ <references title="References">
199
+ <reference anchor="crossreference" target="https://www.iso.org/standard/67116.html"> <front> <title>ISO/IEC FDIS 10118-3 -- Information technology -- Security techniques -- Hash-functions -- Part 3: Dedicated hash-functions</title> <author> <organization>International Organization for Standardization</organization> <address> <postal> <street>BIBC II</street> <street>Chemin de Blandonnet 8</street> <street>CP 401</street> <city>Vernier</city> <region>Geneva</region> <code>1214</code> <country>Switzerland</country> </postal> <phone>+41 22 749 01 11</phone> <email>central@iso.org</email> <uri>https://www.iso.org/</uri> </address> </author> <date day="15" month="September" year="2017"/> </front></reference>
200
+ </references>
201
+ </back>
202
+ </rfc>
203
+ OUTPUT
204
+ end
205
+ end