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,30 @@
1
+ require "spec_helper"
2
+ describe Asciidoctor::RFC::V3::Converter do
3
+ it "renders a sidebar" do
4
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3)).to be_equivalent_to <<~'OUTPUT'
5
+ [[id]]
6
+ ****
7
+ Sidebar
8
+
9
+ Another sidebar
10
+
11
+ * This is a list
12
+
13
+ ....
14
+ And this is ascii-art
15
+ ....
16
+ ****
17
+ INPUT
18
+ <aside anchor="id">
19
+ <t>Sidebar</t>
20
+ <t>Another sidebar</t>
21
+ <ul>
22
+ <li>This is a list</li>
23
+ </ul>
24
+ <figure>
25
+ <artwork type="ascii-art">And this is ascii-art</artwork>
26
+ </figure>
27
+ </aside>
28
+ OUTPUT
29
+ end
30
+ end
@@ -0,0 +1,275 @@
1
+ require "spec_helper"
2
+ describe Asciidoctor::RFC::V3::Converter do
3
+ it "renders a table" do
4
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3)).to be_equivalent_to <<~'OUTPUT'
5
+ = Document title
6
+ Author
7
+
8
+ == Section 1
9
+ [[id]]
10
+ .Table Title
11
+ |===
12
+ |[[id]] head | head
13
+
14
+ h|header cell | body cell
15
+ | | body cell
16
+ 2+| colspan of 2
17
+ .2+|rowspan of 2 | cell
18
+ |cell
19
+ ^|centre aligned cell | cell
20
+ <|left aligned cell | cell
21
+ >|right aligned cell | cell
22
+ |foot | foot
23
+ |===
24
+ INPUT
25
+ <section anchor="_section_1" numbered="false">
26
+ <name>Section 1</name>
27
+ <table anchor="id">
28
+ <name>Table Title</name>
29
+ <thead>
30
+ <tr>
31
+ <th align="left"> head</th>
32
+ <th align="left">head</th>
33
+ </tr>
34
+ </thead>
35
+ <tbody>
36
+ <tr>
37
+ <th align="left">header cell</th>
38
+ <td align="left">body cell</td>
39
+ </tr>
40
+ <tr>
41
+ <td align="left"></td>
42
+ <td align="left">body cell</td>
43
+ </tr>
44
+ <tr>
45
+ <td colspan="2" align="left">colspan of 2</td>
46
+ </tr>
47
+ <tr>
48
+ <td rowspan="2" align="left">rowspan of 2</td>
49
+ <td align="left">cell</td>
50
+ </tr>
51
+ <tr>
52
+ <td align="left">cell</td>
53
+ </tr>
54
+ <tr>
55
+ <td align="center">centre aligned cell</td>
56
+ <td align="left">cell</td>
57
+ </tr>
58
+ <tr>
59
+ <td align="left">left aligned cell</td>
60
+ <td align="left">cell</td>
61
+ </tr>
62
+ <tr>
63
+ <td align="right">right aligned cell</td>
64
+ <td align="left">cell</td>
65
+ </tr>
66
+ <tr>
67
+ <td align="left">foot</td>
68
+ <td align="left">foot</td>
69
+ </tr>
70
+ </tbody>
71
+ </table>
72
+ </section>
73
+ OUTPUT
74
+ end
75
+ it "ignores cell anchors in a table" do
76
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3)).to be_equivalent_to <<~'OUTPUT'
77
+ = Document title
78
+ Author
79
+
80
+ == Section 1
81
+ [[id]]
82
+ .Table Title
83
+ |===
84
+ |[[id]] head | head
85
+
86
+ h|header cell | body cell
87
+ | | [[id]] body cell
88
+ 2+| colspan of 2
89
+ .2+|rowspan of 2 | cell
90
+ |cell
91
+ ^|centre aligned cell | cell
92
+ <|left aligned cell | cell
93
+ >|right aligned cell | cell
94
+ |foot | foot
95
+ |===
96
+ INPUT
97
+ <section anchor="_section_1" numbered="false">
98
+ <name>Section 1</name>
99
+ <table anchor="id">
100
+ <name>Table Title</name>
101
+ <thead>
102
+ <tr>
103
+ <th align="left"> head</th>
104
+ <th align="left">head</th>
105
+ </tr>
106
+ </thead>
107
+ <tbody>
108
+ <tr>
109
+ <th align="left">header cell</th>
110
+ <td align="left">body cell</td>
111
+ </tr>
112
+ <tr>
113
+ <td align="left"></td>
114
+ <td align="left"> body cell</td>
115
+ </tr>
116
+ <tr>
117
+ <td colspan="2" align="left">colspan of 2</td>
118
+ </tr>
119
+ <tr>
120
+ <td rowspan="2" align="left">rowspan of 2</td>
121
+ <td align="left">cell</td>
122
+ </tr>
123
+ <tr>
124
+ <td align="left">cell</td>
125
+ </tr>
126
+ <tr>
127
+ <td align="center">centre aligned cell</td>
128
+ <td align="left">cell</td>
129
+ </tr>
130
+ <tr>
131
+ <td align="left">left aligned cell</td>
132
+ <td align="left">cell</td>
133
+ </tr>
134
+ <tr>
135
+ <td align="right">right aligned cell</td>
136
+ <td align="left">cell</td>
137
+ </tr>
138
+ <tr>
139
+ <td align="left">foot</td>
140
+ <td align="left">foot</td>
141
+ </tr>
142
+ </tbody>
143
+ </table>
144
+ </section>
145
+ OUTPUT
146
+ end
147
+ it "renders inline formatting within a table" do
148
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3)).to be_equivalent_to <<~'OUTPUT'
149
+ = Document title
150
+ Author
151
+
152
+ == Section 1
153
+ .Table Title
154
+ |===
155
+ |head | head
156
+
157
+ h|header cell | *body* _cell_
158
+ | | body cell<<x>>
159
+ ^|centre aligned cell | cell
160
+ <|left aligned cell | cell
161
+ >|right aligned cell | cell
162
+
163
+ |foot | foot
164
+ |===
165
+ INPUT
166
+ <section anchor="_section_1" numbered="false">
167
+ <name>Section 1</name>
168
+ <table>
169
+ <name>Table Title</name>
170
+ <thead>
171
+ <tr>
172
+ <th align="left">head</th>
173
+ <th align="left">head</th>
174
+ </tr>
175
+ </thead>
176
+ <tbody>
177
+ <tr>
178
+ <th align="left">header cell</th>
179
+ <td align="left"><strong>body</strong> <em>cell</em></td>
180
+ </tr>
181
+ <tr>
182
+ <td align="left"/>
183
+ <td align="left">body cell<xref target="x"/></td>
184
+ </tr>
185
+ <tr>
186
+ <td align="center">centre aligned cell</td>
187
+ <td align="left">cell</td>
188
+ </tr>
189
+ <tr>
190
+ <td align="left">left aligned cell</td>
191
+ <td align="left">cell</td>
192
+ </tr>
193
+ <tr>
194
+ <td align="right">right aligned cell</td>
195
+ <td align="left">cell</td>
196
+ </tr>
197
+ <tr>
198
+ <td align="left">foot</td>
199
+ <td align="left">foot</td>
200
+ </tr>
201
+ </tbody>
202
+ </table>
203
+ </section>
204
+ OUTPUT
205
+ end
206
+ it "renders block formatting within a table" do
207
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3)).to be_equivalent_to <<~'OUTPUT'
208
+ = Document title
209
+ :docName:
210
+ Author
211
+
212
+ == Section 1
213
+ [cols="2"]
214
+ .Table Title
215
+ |===
216
+ |head | head
217
+
218
+ h|header cell
219
+ a|
220
+ * List 1
221
+ * List 2
222
+ | | body cell<<x>>
223
+ ^|centre aligned cell | cell
224
+ <|left aligned cell | cell
225
+ >|right aligned cell | cell
226
+
227
+ |foot | foot
228
+ |===
229
+ INPUT
230
+ <section anchor="_section_1" numbered="false">
231
+ <name>Section 1</name>
232
+ <table>
233
+ <name>Table Title</name>
234
+ <thead>
235
+ <tr>
236
+ <th align="left">head</th>
237
+ <th align="left">head</th>
238
+ </tr>
239
+ </thead>
240
+ <tbody>
241
+ <tr>
242
+ <th align="left">header cell</th>
243
+ <td align="left">
244
+ <ul>
245
+ <li>List 1</li>
246
+ <li>List 2</li>
247
+ </ul>
248
+ </td>
249
+ </tr>
250
+ <tr>
251
+ <td align="left"/>
252
+ <td align="left">body cell<xref target="x"/></td>
253
+ </tr>
254
+ <tr>
255
+ <td align="center">centre aligned cell</td>
256
+ <td align="left">cell</td>
257
+ </tr>
258
+ <tr>
259
+ <td align="left">left aligned cell</td>
260
+ <td align="left">cell</td>
261
+ </tr>
262
+ <tr>
263
+ <td align="right">right aligned cell</td>
264
+ <td align="left">cell</td>
265
+ </tr>
266
+ <tr>
267
+ <td align="left">foot</td>
268
+ <td align="left">foot</td>
269
+ </tr>
270
+ </tbody>
271
+ </table>
272
+ </section>
273
+ OUTPUT
274
+ end
275
+ end
@@ -0,0 +1,74 @@
1
+ require "spec_helper"
2
+ describe Asciidoctor::RFC::V3::Converter do
3
+ it "renders an unordered list" do
4
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3)).to be_equivalent_to <<~'OUTPUT'
5
+ [[id]]
6
+ [empty=true,spacing=compact]
7
+ * First
8
+ * Second
9
+ INPUT
10
+ <ul anchor="id" empty="true" spacing="compact">
11
+ <li>First</li>
12
+ <li>Second</li>
13
+ </ul>
14
+ OUTPUT
15
+ end
16
+
17
+ it "ignores anchors on list items" do
18
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3)).to be_equivalent_to <<~'OUTPUT'
19
+ [[id]]
20
+ * First
21
+ * [[id1]] Second
22
+ INPUT
23
+ <ul anchor="id">
24
+ <li>First</li>
25
+ <li> Second</li>
26
+ </ul>
27
+ OUTPUT
28
+ end
29
+
30
+ it "renders a nested unordered list" do
31
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3)).to be_equivalent_to <<~'OUTPUT'
32
+ [[id]]
33
+ * First
34
+ * Second
35
+ ** Third
36
+ ** Fourth
37
+ * Fifth
38
+ * Sixth
39
+ INPUT
40
+ <ul anchor="id">
41
+ <li>First</li>
42
+ <li><t>Second</t>
43
+ <ul>
44
+ <li>Third</li>
45
+ <li>Fourth</li>
46
+ </ul>
47
+ </li>
48
+ <li>Fifth</li>
49
+ <li>Sixth</li>
50
+ </ul>
51
+ OUTPUT
52
+ end
53
+
54
+ it "renders a nested ordered/unordered list" do
55
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3)).to be_equivalent_to <<~'OUTPUT'
56
+ [[id]]
57
+ * First
58
+ * Second
59
+ [lowerroman]
60
+ .. Third
61
+ .. Fourth
62
+ INPUT
63
+ <ul anchor="id">
64
+ <li>First</li>
65
+ <li><t>Second</t>
66
+ <ol type="i">
67
+ <li>Third</li>
68
+ <li>Fourth</li>
69
+ </ol>
70
+ </li>
71
+ </ul>
72
+ OUTPUT
73
+ end
74
+ end
@@ -0,0 +1,33 @@
1
+ require "spec_helper"
2
+ describe Asciidoctor::RFC::V3::Converter do
3
+ it "renders workgroups" do
4
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
5
+ = Document title
6
+ :docName:
7
+ Author
8
+ :workgroup: first_workgroup, second_workgroup
9
+
10
+ == Section 1
11
+ Text
12
+ INPUT
13
+ <?xml version="1.0" encoding="US-ASCII"?>
14
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
15
+
16
+ <rfc prepTime="2000-01-01T05:00:00Z" version="3" submissionType="IETF">
17
+ <front>
18
+ <title>Document title</title>
19
+ <author fullname="Author">
20
+ </author>
21
+ <date day="1" month="January" year="2000"/>
22
+ <workgroup>first_workgroup</workgroup>
23
+ <workgroup>second_workgroup</workgroup>
24
+ </front><middle>
25
+ <section anchor="_section_1" numbered="false">
26
+ <name>Section 1</name>
27
+ <t>Text</t>
28
+ </section>
29
+ </middle>
30
+ </rfc>
31
+ OUTPUT
32
+ end
33
+ end
@@ -0,0 +1,361 @@
1
+ = Put Your Internet Draft Title Here
2
+ Elwyn Davies <elwynd@dial.pipex.com>
3
+ :doctype: internet-draft
4
+ :name: draft-ietf-xml2rfc-template-06
5
+ :ipr: trust200902
6
+ :status: info
7
+ :abbrev: Abbreviated Title
8
+ :fullname: Elwyn Davies
9
+ :forename_initials: E.B.
10
+ :role: editor
11
+ :surname: Davies
12
+ :organization: Folly Consulting
13
+ :city: Soham
14
+ :country: UK
15
+ :phone: +44 7889 488 335
16
+ :email: elwynd@dial.pipex.com
17
+ :revdate: 2010-04-01
18
+ :area: General
19
+ :workgroup: Internet Engineering Task Force
20
+ :keyword: template
21
+
22
+ [abstract]
23
+ Insert an abstract: MANDATORY. This template is for creating an
24
+ Internet Draft.
25
+
26
+ == Introduction
27
+
28
+ The original specification of xml2rfc format is in <<RFC2629,RFC 2629>>.
29
+
30
+ === Requirements Language
31
+
32
+ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
33
+ "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
34
+ document are to be interpreted as described in <<RFC2119,RFC 2119>>.
35
+
36
+ [[simple_list]]
37
+ == Simple List
38
+
39
+ List styles: 'empty', 'symbols', 'letters', 'numbers', 'hanging',
40
+ 'format'.
41
+
42
+ * First bullet
43
+
44
+ * Second bullet
45
+
46
+ You can write text here as well.
47
+ //[Note: Asciidoc will force new paragraph]
48
+
49
+ == Figures
50
+
51
+ Figures should not exceed 69 characters wide to allow for the indent
52
+ of sections.
53
+
54
+ [[xml_happy]]
55
+ [align=center]
56
+ ====
57
+ Preamble text - can be omitted or empty.
58
+
59
+ [align=left]
60
+ ....
61
+ +-----------------------+
62
+ | Use XML, be Happy :-) |
63
+ |_______________________|
64
+ ....
65
+
66
+ Cross-references allowed in pre- and postamble. <<min_ref>>.
67
+ ====
68
+
69
+ The CDATA means you don't need to escape meta-characters (especially
70
+ < (\&lt;) and & (\&amp;)) but is not essential.
71
+ Figures may also have a title attribute but it won't be displayed unless
72
+ there is also an anchor. White space, both horizontal and vertical, is
73
+ significant in figures even if you don't use CDATA.
74
+
75
+ == Subsections and Tables
76
+
77
+ === A Subsection
78
+
79
+ By default 3 levels of nesting show in table of contents but that
80
+ can be adjusted with the value of the "tocdepth" processing
81
+ instruction.
82
+
83
+ === Tables
84
+
85
+ pass:[..] are very similar to figures:
86
+
87
+ //[Note: Asciidoc does not support preambles and postambles within tables.]
88
+
89
+ Tables use ttcol to define column headers and widths. Every cell then has a "c" element for its content.
90
+
91
+ [[table_example]]
92
+ .A Very Simple Table
93
+ [cols="2*^", frame="sides", grid="cols"]
94
+ |===
95
+ |ttcol #1 |ttcol #2
96
+
97
+ |c #1 |c #2
98
+ |c #3 |c #4
99
+ |c #5 |c #6
100
+ |===
101
+
102
+ which is a very simple example.
103
+
104
+ [[nested_lists]]
105
+ == More about Lists
106
+ Lists with 'hanging labels': the list item is indented the amount of
107
+ the hangIndent:
108
+
109
+ [hang-indent=8]
110
+ short:: With a label shorter than the hangIndent.
111
+
112
+ fantastically long label:: With a label longer than the hangIndent.
113
+
114
+ vspace_trick:: {blank} +
115
+ Forces the new item to start on a new line.
116
+
117
+ Simulating more than one paragraph in a list item using
118
+ <vspace>:
119
+
120
+ [loweralpha]
121
+ . First, a short item.
122
+
123
+ . Second, a longer list item.
124
+ +
125
+ {blank}
126
+ +
127
+ And something that looks like a separate pararaph..
128
+
129
+ NOTE: In Asciidoc, it *is* a separate paragraph.
130
+
131
+ Simple indented paragraph using the "empty" style:
132
+
133
+ [empty,hang-indent=8]
134
+ * The quick, brown fox jumped over the lazy dog and lived to fool
135
+ many another hunter in the great wood in the west.
136
+
137
+
138
+ === Numbering Lists across Lists and Sections
139
+ Numbering items continuously although they are in separate
140
+ <list> elements, maybe in separate sections using the "format"
141
+ style and a "counter" variable.
142
+
143
+ First list:
144
+
145
+ [hang-indent=4,counter=reqs,format=R%d]
146
+ . #1
147
+
148
+ . #2
149
+
150
+ . #3
151
+
152
+ Specify the indent explicitly so that all the items line up
153
+ nicely.
154
+
155
+ Second list:
156
+ [hang-indent=4,counter=reqs,format=R%d]
157
+ . #4
158
+
159
+ . #5
160
+
161
+ . #6
162
+
163
+ === Where the List Numbering Continues
164
+ List continues here.
165
+
166
+ Third list:
167
+ [hang-indent=4,counter=reqs,format=R%d]
168
+ . #7
169
+
170
+ . #8
171
+
172
+ . #9
173
+
174
+ . #10
175
+
176
+ The end of the list.
177
+
178
+ [[codeExample]]
179
+ == Example of Code or MIB Module To Be Extracted
180
+
181
+ // NOTE: in asciidoctor-rfc output we're missing an empty line before
182
+ // the code block and after it. Can't figure out a way to create that...
183
+
184
+ ====
185
+ The <artwork> element has a number of extra attributes
186
+ that can be used to substitute a more aesthetically pleasing rendition
187
+ into HTML output while continuing to use the ASCII art version in the
188
+ text and nroff outputs (see the xml2rfc README for details). It also
189
+ has a "type" attribute. This is currently ignored except in the case
190
+ 'type="abnf"'. In this case the "artwork" is expected to contain a
191
+ piece of valid Augmented Backus-Naur Format (ABNF) grammar. This will
192
+ be syntax checked by xml2rfc and any errors will cause a fatal error
193
+ if the "strict" processing instruction is set to "yes". The ABNF will
194
+ also be colorized in HTML output to highlight the syntactic
195
+ components. Checking of additional "types" may be provided in future
196
+ versions of xml2rfc.
197
+
198
+ ----
199
+
200
+
201
+ /**** an example C program */
202
+
203
+ #include <stdio.h>
204
+
205
+ void
206
+ main(int argc, char *argv[])
207
+ {
208
+ int i;
209
+
210
+ printf("program arguments are:\n");
211
+ for (i = 0; i < argc; i++) {
212
+ printf("%d: \"%s\"\n", i, argv[i]);
213
+ }
214
+
215
+ exit(0);
216
+ } /* main */
217
+
218
+ /* end of file */
219
+
220
+
221
+ ----
222
+ ====
223
+
224
+ [[Acknowledgements]]
225
+ == Acknowledgements
226
+ This template was derived from an initial version written by Pekka Savola and contributed by him to the xml2rfc project.
227
+
228
+ This document is part of a plan to make xml2rfc indispensable <<DOMINATION>>.
229
+
230
+ [[IANA]]
231
+ == IANA Considerations
232
+ This memo includes no request to IANA.
233
+
234
+ All drafts are required to have an IANA considerations section (see
235
+ <<RFC5226,Guidelines for Writing an IANA Considerations Section in RFCs>> for a guide). If the draft does not require IANA to do
236
+ anything, the section contains an explicit statement that this is the
237
+ case (as above). If there are no requirements for IANA, the section will
238
+ be removed during conversion into an RFC by the RFC Editor.
239
+
240
+ [[Security]]
241
+ == Security Considerations
242
+ All drafts are required to have a security considerations section.
243
+ See <<RFC3552,RFC 3552>> for a guide.
244
+
245
+
246
+ [bibliography]
247
+ == Normative References
248
+ ++++
249
+
250
+ <reference anchor='RFC2119' target='https://www.rfc-editor.org/info/rfc2119'>
251
+ <front>
252
+ <title>Key words for use in RFCs to Indicate Requirement Levels</title>
253
+ <author initials='S.' surname='Bradner' fullname='S. Bradner'><organization /></author>
254
+ <date year='1997' month='March' />
255
+ <abstract><t>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.</t></abstract>
256
+ </front>
257
+ <seriesInfo name='BCP' value='14'/>
258
+ <seriesInfo name='RFC' value='2119'/>
259
+ <seriesInfo name='DOI' value='10.17487/RFC2119'/>
260
+ </reference>
261
+
262
+ <reference anchor="min_ref">
263
+ <!-- the following is the minimum to make xml2rfc happy -->
264
+
265
+ <front>
266
+ <title>Minimal Reference</title>
267
+
268
+ <author initials="authInitials" surname="authSurName">
269
+ <organization></organization>
270
+ </author>
271
+
272
+ <date year="2006" />
273
+ </front>
274
+ </reference>
275
+ ++++
276
+
277
+ [bibliography]
278
+ == Informative References
279
+ ++++
280
+ <!-- Here we use entities that we defined at the beginning. -->
281
+
282
+ <reference anchor='RFC2629' target='https://www.rfc-editor.org/info/rfc2629'>
283
+ <front>
284
+ <title>Writing I-Ds and RFCs using XML</title>
285
+ <author initials='M.' surname='Rose' fullname='M. Rose'><organization /></author>
286
+ <date year='1999' month='June' />
287
+ <abstract><t>This memo presents a technique for using XML (Extensible Markup Language) as a source format for documents in the Internet-Drafts (I-Ds) and Request for Comments (RFC) series. This memo provides information for the Internet community.</t></abstract>
288
+ </front>
289
+ <seriesInfo name='RFC' value='2629'/>
290
+ <seriesInfo name='DOI' value='10.17487/RFC2629'/>
291
+ </reference>
292
+
293
+ <reference anchor='RFC3552' target='https://www.rfc-editor.org/info/rfc3552'>
294
+ <front>
295
+ <title>Guidelines for Writing RFC Text on Security Considerations</title>
296
+ <author initials='E.' surname='Rescorla' fullname='E. Rescorla'><organization /></author>
297
+ <author initials='B.' surname='Korver' fullname='B. Korver'><organization /></author>
298
+ <date year='2003' month='July' />
299
+ <abstract><t>All RFCs are required to have a Security Considerations section. Historically, such sections have been relatively weak. This document provides guidelines to RFC authors on how to write a good Security Considerations section. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t></abstract>
300
+ </front>
301
+ <seriesInfo name='BCP' value='72'/>
302
+ <seriesInfo name='RFC' value='3552'/>
303
+ <seriesInfo name='DOI' value='10.17487/RFC3552'/>
304
+ </reference>
305
+
306
+ <reference anchor='RFC5226' target='https://www.rfc-editor.org/info/rfc5226'>
307
+ <front>
308
+ <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
309
+ <author initials='T.' surname='Narten' fullname='T. Narten'><organization /></author>
310
+ <author initials='H.' surname='Alvestrand' fullname='H. Alvestrand'><organization /></author>
311
+ <date year='2008' month='May' />
312
+ <abstract><t>Many protocols make use of identifiers consisting of constants and other well-known values. Even after a protocol has been defined and deployment has begun, new values may need to be assigned (e.g., for a new option type in DHCP, or a new encryption or authentication transform for IPsec). To ensure that such quantities have consistent values and interpretations across all implementations, their assignment must be administered by a central authority. For IETF protocols, that role is provided by the Internet Assigned Numbers Authority (IANA).</t><t>In order for IANA to manage a given namespace prudently, it needs guidelines describing the conditions under which new values can be assigned or when modifications to existing values can be made. If IANA is expected to play a role in the management of a namespace, IANA must be given clear and concise instructions describing that role. This document discusses issues that should be considered in formulating a policy for assigning values to a namespace and provides guidelines for authors on the specific text that must be included in documents that place demands on IANA.</t><t>This document obsoletes RFC 2434. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t></abstract>
313
+ </front>
314
+ <seriesInfo name='RFC' value='5226'/>
315
+ <seriesInfo name='DOI' value='10.17487/RFC5226'/>
316
+ </reference>
317
+
318
+
319
+ <!-- A reference written by by an organization not a person. -->
320
+
321
+ <reference anchor="DOMINATION"
322
+ target="http://www.example.com/dominator.html">
323
+ <front>
324
+ <title>Ultimate Plan for Taking Over the World</title>
325
+
326
+ <author>
327
+ <organization>Mad Dominators, Inc.</organization>
328
+ </author>
329
+
330
+ <date year="1984" />
331
+ </front>
332
+ </reference>
333
+ ++++
334
+
335
+ [[app-additional]]
336
+ [appendix]
337
+ == Additional Stuff
338
+ This becomes an Appendix.
339
+
340
+ ////
341
+ <!-- Change Log
342
+
343
+ v00 2006-03-15 EBD Initial version
344
+
345
+ v01 2006-04-03 EBD Moved PI location back to position 1 -
346
+ v3.1 of XMLmind is better with them at this location.
347
+ v02 2007-03-07 AH removed extraneous nested_list attribute,
348
+ other minor corrections
349
+ v03 2007-03-09 EBD Added comments on null IANA sections and fixed heading capitalization.
350
+ Modified comments around figure to reflect non-implementation of
351
+ figure indent control. Put in reference using anchor="DOMINATION".
352
+ Fixed up the date specification comments to reflect current truth.
353
+ v04 2007-03-09 AH Major changes: shortened discussion of PIs,
354
+ added discussion of rfc include.
355
+ v05 2007-03-10 EBD Added preamble to C program example to tell about ABNF and alternative
356
+ images. Removed meta-characters from comments (causes problems).
357
+
358
+ v06 2010-04-01 TT Changed ipr attribute values to latest ones. Changed date to
359
+ year only, to be consistent with the comments. Updated the
360
+ IANA guidelines reference from the I-D to the finished RFC. -->
361
+ ////