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,308 @@
1
+ require "spec_helper"
2
+ describe Asciidoctor::RFC::V3::Converter do
3
+ it "ignores actual Asciidoctor comments" do
4
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, 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
+ //Ignorable comment
13
+
14
+ ////
15
+ Multiblock ignorable comment
16
+ ////
17
+ INPUT
18
+ <?xml version="1.0" encoding="US-ASCII"?>
19
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
20
+
21
+ <rfc prepTime="2000-01-01T05:00:00Z"
22
+ version="3" submissionType="IETF">
23
+ <front>
24
+ <title abbrev="abbrev_value">Document title</title>
25
+ <author fullname="Author"/>
26
+ <date day="1" month="January" year="2000"/>
27
+ </front><middle>
28
+ <section anchor="_section1" numbered="false">
29
+ <name>Section1</name>
30
+ <t>Text</t>
31
+ </section>
32
+ </middle>
33
+ </rfc>
34
+ </rfc>
35
+ OUTPUT
36
+ end
37
+
38
+ it "uses Asciidoc inline NOTE admonition" do
39
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
40
+ = Document title
41
+ :abbrev: abbrev_value
42
+ :docName:
43
+ Author
44
+
45
+ == Section1
46
+ Text
47
+
48
+ NOTE: This is a note
49
+ INPUT
50
+ <?xml version="1.0" encoding="US-ASCII"?>
51
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
52
+
53
+ <rfc submissionType="IETF" prepTime="2000-01-01T05:00:00Z" version="3">
54
+ <front>
55
+
56
+ <title abbrev="abbrev_value">Document title</title>
57
+
58
+ <author fullname="Author"/>
59
+
60
+
61
+ <date day="1" month="January" year="2000"/>
62
+ </front><middle>
63
+ <section anchor="_section1" numbered="false"><name>Section1</name><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: :rfc3, 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" prepTime="2000-01-01T05:00:00Z" version="3">
87
+ <front>
88
+
89
+ <title abbrev="abbrev_value">Document title</title>
90
+
91
+ <author fullname="Author"/>
92
+
93
+
94
+ <date day="1" month="January" year="2000"/>
95
+ </front><middle>
96
+ <section anchor="_section1" numbered="false"><name>Section1</name><t>Text<cref>This is a note</cref></t>
97
+
98
+ </section>
99
+ </middle>
100
+ </rfc>
101
+ OUTPUT
102
+ end
103
+
104
+ it "uses full range of inline formatting within Asciidoc inline admonition" do
105
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
106
+ = Document title
107
+ :abbrev: abbrev_value
108
+ :docName:
109
+ Author
110
+
111
+ [[sect1]]
112
+ == Section1
113
+ Text
114
+
115
+ WARNING: Text _Text_ *Text* `Text` ~Text~ ^Text^ http://example.com/[linktext] <<ref>> <<crossreference#fragment,section bare: text>>
116
+
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" prepTime="2000-01-01T05:00:00Z" version="3">
149
+ <front>
150
+ <title abbrev="abbrev_value">Document title</title>
151
+ <author fullname="Author"/>
152
+ <date day="1" month="January" year="2000"/>
153
+
154
+ </front><middle>
155
+ <section anchor="sect1" numbered="false"><name>Section1</name><t>Text<cref>Text <em>Text</em> <strong>Text</strong> <tt>Text</tt> <sub>Text</sub> <sup>Text</sup> <eref target="http://example.com/">linktext</eref> <xref target="ref"/> <relref relative="fragment" section="section" displayFormat="bare" target="crossreference">text</relref></cref></t>
156
+ </section>
157
+ </middle><back>
158
+ <references anchor="_references">
159
+ <name>References</name>
160
+ <reference anchor="ref" target="https://www.iso.org/standard/67116.html">
161
+ <front>
162
+ <title>ISO/IEC FDIS 10118-3 -- Information technology -- Security techniques -- Hash-functions -- Part 3: Dedicated hash-functions</title>
163
+ <author>
164
+ <organization>International Organization for Standardization</organization>
165
+ <address>
166
+ <postal>
167
+ <street>BIBC II</street>
168
+ <street>Chemin de Blandonnet 8</street>
169
+ <street>CP 401</street>
170
+ <city>Vernier</city>
171
+ <region>Geneva</region>
172
+ <code>1214</code>
173
+ <country>Switzerland</country>
174
+ </postal>
175
+ <phone>+41 22 749 01 11</phone>
176
+ <email>central@iso.org</email>
177
+ <uri>https://www.iso.org/</uri>
178
+ </address>
179
+ </author>
180
+ <date day="15" month="September" year="2017"/>
181
+ </front>
182
+ </reference>
183
+ </references>
184
+ </back>
185
+ </rfc>
186
+ OUTPUT
187
+ end
188
+
189
+ it "uses Asciidoc block admonition" do
190
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
191
+ = Document title
192
+ :abbrev: abbrev_value
193
+ :docName:
194
+ Author
195
+
196
+ == Section1
197
+ Text
198
+
199
+ [IMPORTANT]
200
+ .Feeding the Werewolves
201
+ ====
202
+ While werewolves are hardy community members, keep in mind the following dietary concerns:
203
+
204
+ . They are allergic to cinnamon.
205
+ . More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.
206
+ . Celery makes them sad.
207
+ ====
208
+ INPUT
209
+ <?xml version="1.0" encoding="US-ASCII"?>
210
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
211
+
212
+ <rfc prepTime="2000-01-01T05:00:00Z"
213
+ version="3" submissionType="IETF">
214
+ <front>
215
+ <title abbrev="abbrev_value">Document title</title>
216
+ <author fullname="Author"/>
217
+ <date day="1" month="January" year="2000"/>
218
+ </front><middle>
219
+ <section anchor="_section1" numbered="false">
220
+ <name>Section1</name>
221
+ <t>Text
222
+ <cref>
223
+ While werewolves are hardy community members, keep in mind the following dietary concerns:
224
+ They are allergic to cinnamon.
225
+ More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.
226
+ Celery makes them sad.
227
+ </cref></t>
228
+ </section>
229
+ </middle>
230
+ </rfc>
231
+ OUTPUT
232
+ end
233
+
234
+ it "uses all options of the Asciidoc block admonition" do
235
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
236
+ = Document title
237
+ :abbrev: abbrev_value
238
+ :docName:
239
+ Author
240
+
241
+ == Section1
242
+ Text
243
+
244
+ [[id]]
245
+ [NOTE,display=true,source=GBS]
246
+ .Note Title
247
+ ====
248
+ Any admonition inside the body of the text is a comment.
249
+ ====
250
+ INPUT
251
+ <?xml version="1.0" encoding="US-ASCII"?>
252
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
253
+
254
+ <rfc prepTime="2000-01-01T05:00:00Z"
255
+ version="3" submissionType="IETF">
256
+ <front>
257
+ <title abbrev="abbrev_value">Document title</title>
258
+ <author fullname="Author">
259
+ </author>
260
+ <date day="1" month="January" year="2000"/>
261
+ </front><middle>
262
+ <section anchor="_section1" numbered="false">
263
+ <name>Section1</name>
264
+ <t>Text
265
+ <cref anchor="id" display="true" source="GBS">
266
+ Any admonition inside the body of the text is a comment.
267
+ </cref></t>
268
+ </section>
269
+ </middle>
270
+ </rfc>
271
+ </section>
272
+ </middle>
273
+ </rfc>
274
+ OUTPUT
275
+ end
276
+
277
+ it "has a comment at the start of a section" do
278
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
279
+ = Document title
280
+ Author
281
+
282
+ == Section 1
283
+ NOTE: This is an initial note
284
+
285
+ Text
286
+ INPUT
287
+ <?xml version="1.0" encoding="US-ASCII"?>
288
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
289
+
290
+ <rfc submissionType="IETF" prepTime="2000-01-01T05:00:00Z" version="3">
291
+ <front>
292
+
293
+ <title>Document title</title>
294
+
295
+ <author fullname="Author"/>
296
+
297
+
298
+ <date day="1" month="January" year="2000"/>
299
+ </front><middle>
300
+ <section anchor="_section_1" numbered="false"><name>Section 1</name>
301
+ <t><cref>This is an initial note</cref></t>
302
+
303
+ <t>Text</t></section>
304
+ </middle>
305
+ </rfc>
306
+ OUTPUT
307
+ end
308
+ end
@@ -0,0 +1,269 @@
1
+ require "spec_helper"
2
+ describe Asciidoctor::RFC::V3::Converter do
3
+ it "renders links" do
4
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, 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 prepTime="2000-01-01T05:00:00Z"
18
+ version="3" submissionType="IETF">
19
+ <front>
20
+ <title abbrev="abbrev_value">Document title</title>
21
+ <author fullname="Author">
22
+ </author>
23
+ <date day="1" month="January" year="2000"/>
24
+ </front><middle>
25
+ <section anchor="_section_1" numbered="false">
26
+ <name>Section 1</name>
27
+ <t><eref target="http://example.com/"></eref>
28
+ <eref target="http://example.com/">linktext</eref></t>
29
+ </section>
30
+ </middle>
31
+ </rfc>
32
+ OUTPUT
33
+ end
34
+ it "renders cross-references" do
35
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
36
+ = Document title
37
+ :abbrev: abbrev_value
38
+ :docName:
39
+ Author
40
+
41
+ [[crossreference]]
42
+ == Section 1
43
+
44
+ == Section 2
45
+ See <<crossreference>>.
46
+
47
+ == Section 3
48
+ See <<crossreference,text>>
49
+
50
+ == Section 4
51
+ See <<crossreference,format=counter: text>>
52
+ INPUT
53
+ <?xml version="1.0" encoding="US-ASCII"?>
54
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
55
+
56
+ <rfc prepTime="2000-01-01T05:00:00Z"
57
+ version="3" submissionType="IETF">
58
+ <front>
59
+ <title abbrev="abbrev_value">Document title</title>
60
+ <author fullname="Author">
61
+ </author>
62
+ <date day="1" month="January" year="2000"/>
63
+ </front><middle>
64
+ <section anchor="crossreference" numbered="false">
65
+ <name>Section 1</name>
66
+ </section>
67
+ <section anchor="_section_2" numbered="false">
68
+ <name>Section 2</name>
69
+ <t>See <xref target="crossreference"></xref>.</t>
70
+ </section>
71
+ <section anchor="_section_3" numbered="false">
72
+ <name>Section 3</name>
73
+ <t>See <xref target="crossreference">text</xref></t>
74
+ </section>
75
+ <section anchor="_section_4" numbered="false">
76
+ <name>Section 4</name>
77
+ <t>See <xref format="counter" target="crossreference">text</xref></t>
78
+ </section>
79
+ </middle>
80
+ </rfc>
81
+ OUTPUT
82
+ end
83
+ it "renders cross-references to bibliography" do
84
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
85
+ = Document title
86
+ :abbrev: abbrev_value
87
+ :docName:
88
+ Author
89
+
90
+ == Section 1
91
+
92
+ == Section 2
93
+
94
+ See <<crossreference>>.
95
+
96
+ == Section 3
97
+ See <<crossreference,text>>
98
+
99
+ [bibliography]
100
+ == References
101
+ ++++
102
+ <reference anchor='crossreference' target='https://www.iso.org/standard/67116.html'>
103
+ <front>
104
+ <title>ISO/IEC FDIS 10118-3 -- Information technology -- Security techniques -- Hash-functions -- Part 3: Dedicated hash-functions</title>
105
+ <author>
106
+ <organization>International Organization for Standardization</organization>
107
+ <address>
108
+ <postal>
109
+ <street>BIBC II</street>
110
+ <street>Chemin de Blandonnet 8</street>
111
+ <street>CP 401</street>
112
+ <city>Vernier</city>
113
+ <region>Geneva</region>
114
+ <code>1214</code>
115
+ <country>Switzerland</country>
116
+ </postal>
117
+ <phone>+41 22 749 01 11</phone>
118
+ <email>central@iso.org</email>
119
+ <uri>https://www.iso.org/</uri>
120
+ </address>
121
+ </author>
122
+ <date day='15' month='September' year='2017'/>
123
+ </front>
124
+ </reference>
125
+ ++++
126
+ INPUT
127
+ <?xml version="1.0" encoding="US-ASCII"?>
128
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
129
+
130
+ <rfc prepTime="2000-01-01T05:00:00Z"
131
+ version="3" submissionType="IETF">
132
+ <front>
133
+ <title abbrev="abbrev_value">Document title</title>
134
+ <author fullname="Author">
135
+ </author>
136
+ <date day="1" month="January" year="2000"/>
137
+ </front><middle>
138
+ <section anchor="_section_1" numbered="false">
139
+ <name>Section 1</name>
140
+ </section>
141
+ <section anchor="_section_2" numbered="false">
142
+ <name>Section 2</name>
143
+ <t>See <xref target="crossreference"></xref>.</t>
144
+ </section>
145
+ <section anchor="_section_3" numbered="false">
146
+ <name>Section 3</name>
147
+ <t>See <xref target="crossreference">text</xref></t>
148
+ </section>
149
+ </middle><back>
150
+ <references anchor="_references">
151
+ <name>References</name>
152
+ <reference anchor='crossreference' target='https://www.iso.org/standard/67116.html'>
153
+ <front>
154
+ <title>ISO/IEC FDIS 10118-3 -- Information technology -- Security techniques -- Hash-functions -- Part 3: Dedicated hash-functions</title>
155
+ <author>
156
+ <organization>International Organization for Standardization</organization>
157
+ <address>
158
+ <postal>
159
+ <street>BIBC II</street>
160
+ <street>Chemin de Blandonnet 8</street>
161
+ <street>CP 401</street>
162
+ <city>Vernier</city>
163
+ <region>Geneva</region>
164
+ <code>1214</code>
165
+ <country>Switzerland</country>
166
+ </postal>
167
+ <phone>+41 22 749 01 11</phone>
168
+ <email>central@iso.org</email>
169
+ <uri>https://www.iso.org/</uri>
170
+ </address>
171
+ </author>
172
+ <date day='15' month='September' year='2017'/>
173
+ </front>
174
+ </reference>
175
+ </references>
176
+ </back>
177
+ </rfc>
178
+ OUTPUT
179
+ end
180
+ it "renders relref references" do
181
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
182
+ = Document title
183
+ :abbrev: abbrev_value
184
+ :docName:
185
+ Author
186
+
187
+ == Section 1
188
+ See <<crossreference,1.3 of>>
189
+ <<crossreference,1.4 comma: text>>
190
+ <<crossreference#fragment1,2.5.3 parens>>
191
+ <<crossreference#fragment2,6.2a bare: text>>
192
+
193
+ [bibliography]
194
+ == References
195
+ ++++
196
+ <reference anchor='crossreference' target='https://www.iso.org/standard/67116.html'>
197
+ <front>
198
+ <title>ISO/IEC FDIS 10118-3 -- Information technology -- Security techniques -- Hash-functions -- Part 3: Dedicated hash-functions</title>
199
+ <author>
200
+ <organization>International Organization for Standardization</organization>
201
+ <address>
202
+ <postal>
203
+ <street>BIBC II</street>
204
+ <street>Chemin de Blandonnet 8</street>
205
+ <street>CP 401</street>
206
+ <city>Vernier</city>
207
+ <region>Geneva</region>
208
+ <code>1214</code>
209
+ <country>Switzerland</country>
210
+ </postal>
211
+ <phone>+41 22 749 01 11</phone>
212
+ <email>central@iso.org</email>
213
+ <uri>https://www.iso.org/</uri>
214
+ </address>
215
+ </author>
216
+ <date day='15' month='September' year='2017'/>
217
+ </front>
218
+ </reference>
219
+ ++++
220
+ INPUT
221
+ <?xml version="1.0" encoding="US-ASCII"?>
222
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
223
+
224
+ <rfc submissionType="IETF" prepTime="2000-01-01T05:00:00Z" version="3">
225
+ <front>
226
+ <title abbrev="abbrev_value">Document title</title>
227
+ <author fullname="Author"/>
228
+ <date day="1" month="January" year="2000"/>
229
+
230
+ </front><middle>
231
+ <section anchor="_section_1" numbered="false">
232
+ <name>Section 1</name>
233
+ <t>See <relref section="1.3" displayFormat="of" target="crossreference"/>
234
+ <relref section="1.4" displayFormat="comma" target="crossreference">text</relref>
235
+ <relref relative="fragment1" section="2.5.3" displayFormat="parens" target="crossreference"/>
236
+ <relref relative="fragment2" section="6.2a" displayFormat="bare" target="crossreference">text</relref></t>
237
+ </section>
238
+ </middle><back>
239
+ <references anchor="_references">
240
+ <name>References</name>
241
+ <reference anchor="crossreference" target="https://www.iso.org/standard/67116.html">
242
+ <front>
243
+ <title>ISO/IEC FDIS 10118-3 -- Information technology -- Security techniques -- Hash-functions -- Part 3: Dedicated hash-functions</title>
244
+ <author>
245
+ <organization>International Organization for Standardization</organization>
246
+ <address>
247
+ <postal>
248
+ <street>BIBC II</street>
249
+ <street>Chemin de Blandonnet 8</street>
250
+ <street>CP 401</street>
251
+ <city>Vernier</city>
252
+ <region>Geneva</region>
253
+ <code>1214</code>
254
+ <country>Switzerland</country>
255
+ </postal>
256
+ <phone>+41 22 749 01 11</phone>
257
+ <email>central@iso.org</email>
258
+ <uri>https://www.iso.org/</uri>
259
+ </address>
260
+ </author>
261
+ <date day="15" month="September" year="2017"/>
262
+ </front>
263
+ </reference>
264
+ </references>
265
+ </back>
266
+ </rfc>
267
+ OUTPUT
268
+ end
269
+ end